Bước tới nội dung

Thành viên:DHN/monobook.js

Bách khoa toàn thư mở Wikipedia

Chú ý: Sau khi lưu thay đổi trang, bạn phải xóa bộ nhớ đệm của trình duyệt để nhìn thấy các thay đổi. Google Chrome, Firefox, Internet ExplorerSafari: Giữ phím ⇧ Shift và nhấn nút Reload/Tải lại trên thanh công cụ của trình duyệt. Để biết chi tiết và hướng dẫn cho các trình duyệt khác, xem Trợ giúp:Xóa bộ nhớ đệm.

method=1;
on_off=1;
dockspell=1;
dauCu=true;
useCookie=true;
radio=true;

// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://vi.wikipedia.org/w/index.php?title=Th%C3%A0nh_vi%C3%AAn:Vinhtantran/wikiEd.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');


/* Chia ra [[Thành viên:Mxn/Trang Chính 3]] thành tab */
/* Dựa trên mã nguồn của [http://vi.wikipedia.org/skins-1.5/common/wikibits.js] */

// fold sections for Trang Chính
// XXX: needs testing on IE/Mac and safari
// more comments to follow
function tabbedsects() {
	var container = document.getElementById('page-sects');
	if (!container || !document.createElement) return;
	if (container.nodeName.toLowerCase() == 'a') return; // Occasional IE problem
	container.className = container.className + 'jsprefs';
	var sections = new Array();
	children = container.childNodes;
	var seci = 0;
	for (i = 0; i < children.length; i++) {
		if (children[i].nodeName.toLowerCase() == 'div') {
			children[i].id = 'prefsection-' + seci;
			children[i].className = 'prefsection';
			if (is_opera || is_khtml)
				children[i].className = 'prefsection operaprefsection';
			legends = children[i].getElementsByTagName('h2');
			sections[seci] = new Object();
			legends[0].className = 'mainLegend';
			if (legends[0] && legends[0].firstChild.nodeValue)
				sections[seci].text = legends[0].firstChild.nodeValue;
			else
				sections[seci].text = '# ' + seci;
			sections[seci].secid = children[i].id;
			seci++;
			if (sections.length != 1) children[i].style.display = 'none';
			else var selectedid = children[i].id;
		}
	}
	var toc = document.createElement('ul');
	toc.id = 'preftoc';
	toc.selectedid = selectedid;
	for (i = 0; i < sections.length; i++) {
		var li = document.createElement('li');
		if (i == 0) li.className = 'selected';
		var a = document.createElement('a');
		a.href = '#' + sections[i].secid;
		a.onmousedown = a.onclick = uncoversection;
		a.appendChild(document.createTextNode(sections[i].text));
		a.secid = sections[i].secid;
		li.appendChild(a);
		toc.appendChild(li);
	}
	container.parentNode.insertBefore(toc, container.parentNode.childNodes[0]);
//	document.getElementById('prefsubmit').id = 'prefcontrol';
}

function uncoversection() {
	oldsecid = this.parentNode.parentNode.selectedid;
	newsec = document.getElementById(this.secid);
	if (oldsecid != this.secid) {
		ul = document.getElementById('preftoc');
		document.getElementById(oldsecid).style.display = 'none';
		newsec.style.display = 'block';
		ul.selectedid = this.secid;
		lis = ul.getElementsByTagName('li');
		for (i = 0; i< lis.length; i++) lis[i].className = '';
		this.parentNode.className = 'selected';
	}
	return false;
}


//******************Công cụ đặc biệt cho Bảo quản viên****************
// tác giả: [[:en:User:Voice of All]]
// Việt hóa: [[:vi:User:Vinhtantran]]
importScript('User:Vinhtantran/Specialadmin/monobook.js');
importScript("User:Vinhtantran/Adminwarnings/monobook.js");


//*****


addLoadEvent(tabbedsects);