Hide Smilies area

Làm ẩn khu vực hiện trước các emotion trong vnsharing, giảm việc Firefox ngốn CPU vì các emoticon hiện sẵn~ Viết lại từ Hide Objects User Script

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          Hide Smilies area
// @author        Draconic
// @namespace     http://Vn-Sharing.net/
// @version       0.1
// @description   Làm ẩn khu vực hiện trước các emotion trong vnsharing, giảm việc Firefox ngốn CPU vì các emoticon hiện sẵn~ Viết lại từ Hide Objects User Script
// @include       http://vn-sharing.net/forum/newthread.php*
// @include       http://vn-sharing.net/forum/newreply.php*
// ==/UserScript==

(function() {


// Main Function Call //
hideTag('ul');

// The Guts //
function hideTag(tag, d) {
	d = (d && d.createElement) ? d : document;
	for (var a = d.getElementsByTagName(tag), i = 0, e, f, g, s; e = a[i]; ++i) {
		if (e.id=="vB_Editor_001_smiliebox"){
		if (e.style.display == 'none' || e.style.visibility == 'hidden' || (s = d.defaultView.getComputedStyle(e, '')).display == 'none' || s.visibility == 'hidden') {
			
				continue;
		}
		
		f = d.createElement('div');
		f.appendChild(e.parentNode.replaceChild(f, e));
		f.style.display = 'none';
		
		f = f.parentNode.insertBefore(d.createElement('div'), f);
		with (f.style) {
			backgroundColor =   'gray';
			color =             'white';
			outline =           '1px dashed invert';
			overflow =          'hidden';
			cursor =            'pointer';
			borderColor =       'transparent';
			position =          (s.position                  || 'static');
			cssFloat =          (s.cssFloat                  || 'none');
			clear =             (s.clear                     || 'none');
			display = (tag == 'object' ? 'block' : s.display || 'block');
			width =  (e.width  ? e.width + 'px'  : s.width   || 'auto');
			height = (e.height ? e.height + 'px' : s.height  || 'auto');
			top =               (s.top                       || 'auto');
			right =             (s.right                     || 'auto');
			bottom =            (s.bottom                    || 'auto');
			left =              (s.left                      || 'auto');
			marginTop =         (s.marginTop                 || '0');
			marginRight =       (s.marginRight               || '0');
			marginBottom =      (s.marginBottom              || '0');
			marginLeft =        (s.marginLeft                || '0');
			paddingTop =        (s.paddingTop                || '0');
			paddingRight =      (s.paddingRight              || '0');
			paddingBottom =     (s.paddingBottom             || '0');
			paddingLeft =       (s.paddingLeft               || '0');
			borderTopWidth =    (s.borderTopWidth            || '0');
			borderRightWidth =  (s.borderRightWidth          || '0');
			borderBottomWidth = (s.borderBottomWidth         || '0');
			borderLeftWidth =   (s.borderLeftWidth           || '0');
		}
		/*f.addEventListener('click', function () {
			this.parentNode.replaceChild(this.nextSibling.firstChild, this.nextSibling);
			this.parentNode.removeChild(this);
		}, true);*/
		f.innerHTML = 'Smilies đã được ẩn :D';
		}
	}
}
})();