MediaWiki:Common.js
跳至導覽
跳至搜尋
注意:在您儲存之後您必須清除瀏覽器快取才可看到最新的變更。
- Firefox / Safari:按住 Shift 時點選 重新整理,或按 Ctrl-F5 或 Ctrl-R (Mac 則為 ⌘-R)
- Google Chrome:按 Ctrl-Shift-R (Mac 則為 ⌘-Shift-R)
- Internet Explorer / Edge:按住 Ctrl 時點選 重新整理,或按 Ctrl-F5
- Opera:按 Ctrl-F5。
/* 此 JavaScript 會用於使用者載入的每一個頁面。 */
function AppendCategoryTreeToSidebar() {
try {
var node = document.getElementById( "p-tb" )
.getElementsByTagName('div')[0]
.getElementsByTagName('ul')[0];
var aNode = document.createElement( 'a' );
var liNode = document.createElement( 'li' );
aNode.appendChild( document.createTextNode( 'CategoryTree' ) );
aNode.setAttribute( 'href' , '[[w:en:Special:CategoryTree]]' );
liNode.appendChild( aNode );
liNode.className = 'plainlinks';
node.appendChild( liNode );
} catch(e) {
// lets just ignore what's happened
return;
}
}
addOnloadHook( AppendCategoryTreeToSidebar );