MediaWiki:Gadget-sixtabs.js
外观
注意:保存后,更改可能不会立即发生。单击此处以了解如何绕过浏览器的缓存。
- Mozilla / Firefox / Safari:按住Shift键同时单击重新加载,或按Ctrl-Shift-R(苹果 Mac 上的Cmd-Shift-R);
- Internet Explorer:按住Ctrl键同时单击刷新,或按Ctrl-F5;
- Konqueror:只需单击重新加载按钮,或按F5;
- Opera用户可能需要在工具→首选项中完全清除其缓存。
$(document).ready( function() {
var $action, $main, $talk, $edit, $hist, $move, $clone, href, title, ns = mw.config.get( 'wgNamespaceNumber' );
if ( ns < 0 || mw.config.get('skin') !== 'monobook' ) {
return
}
$action = $('#p-cactions').find('li');
$main = $action.eq(0);
$talk = $action.filter('#ca-talk');
$edit = $action.filter('#ca-edit');
$hist = $action.filter('#ca-history');
if ( ns % 2 ) {
$clone = $main;
$move = $talk;
id = 'subject';
title = '';
} else {
$clone = $talk;
$move = $main;
id = 'talk';
title = 'Talk:';
}
if ( !$edit.length ) {
$edit = $action.filter('#ca-viewsource');
}
if ( !$main.length || !$talk.length || !$edit.length || !$hist.length || $clone.hasClass( 'new' ) ) {
return;
}
$move.after( $hist );
$move.after( $edit );
href = mw.util.wikiScript('index') + '?title' + mw.util.wikiUrlencode( title + mw.config.get( 'wgTitle' ) ) + '&action=';
mw.util.addPortletLink
(
'p-cactions', href + 'history', $hist.text(), 'ca-history-' + id, id + ' history', '', $clone.next().get(0)
);
mw.util.addPortletLink
(
'p-cactions', href + 'edit', 'Edit', 'ca-edit-' + id, 'Edit ' + id, '', $clone.next().get(0)
);
});