使用者:RalfX/monobook.js
註:重取頁面,文方新焉。
- Firefox / Safari:押 Shift 並點 重新載入,或合鍵 Ctrl-F5 或 Ctrl-R(Mac 為 ⌘-R)。
- Google Chrome:點 Ctrl-Shift-R(Mac為 ⌘-Shift-R)。
- Internet Explorer:押 Ctrl 並點 重新整理,或合鍵 Ctrl-F5。
- Opera:須至 Tools → Preferences 清謄本(Mac 為 Opera → Preferences)。
$(function () {
var x;
if (!(x = document.getElementById('ca-edit') )) return;
var url;
if (!(url = x.getElementsByTagName('a')[0] )) return;
if (!(url = url.href )) return;
var y = mw.util.addPortletLink('p-cactions', url+"§ion=0", '0', 'ca-edit-0',
'Edit the lead section of this page', '0', x.nextSibling);
y.className = x.className; // steal classes from the the edit tab...
x.className = 'istalk'; // ...and make the edit tab have no right margin
// exception: don't steal the "selected" class unless actually editing section 0:
if (/(^| )selected( |$)/.test(y.className)) {
if (!document.editform || !document.editform.wpSection
|| document.editform.wpSection.value != "0") {
y.className = y.className.replace(/(^| )selected( |$)/g, "$1");
x.className += ' selected';
}
}
});
//