User:Albuseer/vector.js
外观
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google Chrome、Firefox、Microsoft Edge及Safari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
/* jQuery section Begin */ jQuery(document).ready(function($){
if (/Wikipedia:首(页|頁)(\/(自訂首頁設計|自订首页设计)\/.*)?/.test(wgPageName) && wgAction == 'view'){
$('#firstHeading').hide();
$('#contentSub').hide();
$('#content').css('background','white url(/skins-1.5/vector/images/border.png) repeat-y scroll left top');
$('li.selected').css('background','white url(/skins-1.5/vector/images/tab-current-fade.png)');
$('#ca-nstab-project a span').text(wgULS('首页', '首頁'));
document.title="维基百科,自由的百科全书";
}
$('h1,h2,h3,h4,h5,h6').each(
function(){
$(this)
.append(' ')
.append(
$(this).children('span.editsection')
.css('display','inline')
.css('float','none')
.css('font-size','small')
.css('margin-left','5px')
.css('line-height','90%').hide()
)
.hover(
function(){$(this).children('span.editsection').show()},
function(){$(this).children('span.editsection').hide()}
)
}
);
/* Prototype code to show collapsing left nav options */
/* First draft and will be changing greatly */
$( '#panel' ).addClass( 'collapsible-nav' );
// Always show the first portal
$( '#panel > div.portal:first' )
.addClass( 'expanded' )
.find( 'div.body' )
.show();
// Remember which portals to hide and show
$( '#panel > div.portal:not(:first)' )
.each( function() {
if ( $.cookie( 'vector-nav-' + $(this).attr( 'id' ) ) == 'true' ) {
$(this)
.addClass( 'expanded' )
.find( 'div.body' )
.show();
}else{
$(this).addClass( 'collapsed' );
}
});
// Toggle the selected menu's class and expand or collapse the menu
$('#panel > div.portal[id!=p-navigation]').click(
function() {
$(this).siblings('div[id!=p-navigation]')
.addClass('collapsed')
.removeClass('expanded')
.find('div.body')
.hide('fast');
$(this)
.addClass('expanded')
.removeClass('collapsed')
.find('div.body')
.show('fast');
$.cookie( 'vector-nav-' + $(this).parent().attr( 'id' ), $(this).parent().is( '.collapsed' ) );
}
);
/* jQuery section End */ });