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() {
$(this).addClass( 'collapsed' );
}
);
// Toggle the selected menu's class and expand or collapse the menu
$('#panel > div.portal[id!=p-navigation] > h5').click(
function() {
$(this).parent().siblings('div[id!=p-navigation]')
.addClass('collapsed')
.removeClass('expanded')
.find('div.body')
.hide('fast');
$(this).parent()
.toggleClass('expanded')
.toggleClass('collapsed')
.find('div.body')
.slideToggle('fast');
}
);
/* language section collapse */
var langs = ['en','de','fr','pl','it','ja','nl','es','simple','zh-classical','zh-yue','wuu','la'];
var finish = langs.length;
if ($('#p-lang > div > ul > li').size() > finish){
$('#p-lang > div > ul > li').hide();
var count = 0;
for (i=0;i<finish;i++){
$('#p-lang .interwiki-'+langs[i]).show();
count++;
}
if (count < finish){
for (i=count;i++;i<finish){
$('#p-lang > div > ul').append(
$('#p-lang > div > ul').children(':hidden:first').show()
)
}
}
$('#p-lang > div > ul').append('<li id="p-lang-more"><span style="size:small; text-color:gray">There is more</span></li>')
}else{
$('#p-lang > div > ul').append('<li><span style="size:small; text-color:gray">That\'s all</span></li>')
}
$('#panel').css('position','fixed')
/* jQuery section End */ });