/* generated javascript */ var skin = 'monobook'; var stylepath = '/skins-1.5'; /* MediaWiki:Common.js */ // /* == 中文處理 == */ //设置中文语言页 var htmlE=document.documentElement; htmlE.setAttribute("lang",wgUserLanguage); htmlE.setAttribute("xml:lang",wgUserLanguage); //返回繁簡字串 function wgULS(hans,hant,cn,tw,hk,sg,zh){ return {//保證每一語言有值 'zh-hans':hans||cn||sg, 'zh-hant':hant||tw||hk, 'zh-cn':cn||hans||sg, 'zh-sg':sg||hans||cn, 'zh-tw':tw||hant||hk, 'zh-hk':hk||hant||tw, 'zh':zh||hant||hans||cn||tw||hk||sg }[wgUserLanguage]; } /* 當需要時載入對應的 scripts */ if (wgAction == "edit" || wgAction == "submit") //scripts specific to editing pages { importScript("MediaWiki:Common.js/edit.js") } else if (wgPageName == "Special:Search") //scripts specific to Special:Search { importScript("MediaWiki:Common.js/search.js") } /* 所有用戶在加載任何頁面時,這裡的JavaScript都會加載 == 辅助处理 == */ //功能設定 if(!window.JSConfig){var JSConfig={};} JSConfig.collapseText=wgULS('隐藏▲','隱藏▲');//指示折叠收缩的默认文字 JSConfig.expandText=wgULS('显示▼','顯示▼');//指示折叠展开的默认文字 JSConfig.autoCollapse=2; //文章少于 autoCollapse 个折叠块时,不自动折叠 JSConfig.SpecialSearchEnhancedDisabled=false; //是否禁止增加其它搜索引擎 function forEach(callback,array){ var i=0,j=array.length; while(i=JSConfig.autoCollapse&&hasClass(item.container,"autocollapse") ) ); } }); //修正摺疊後定位變化 hookEvent("load",function(){if(location.hash){location.href=location.hash;}}); /* == 首頁輸出修正 == */ /** 首页输出修正 ******************************************************* 描述: 维护者: [[User:Fdcn]] */ // "首頁" == wgTitle 代表重定向頁 if ( wgTitle == '首页' && ( wgNamespaceNumber == 0 || wgNamespaceNumber == 1 ) ) { addOnloadHook( function () { try { var Node = document.getElementById( 'ca-nstab-main' ).firstChild; var label = wgULS('首页','首頁'); if ( Node.textContent ) { // Per DOM Level 3 Node.textContent = label; } else if ( Node.innerText ) { // IE doesn't handle .textContent Node.innerText = label; } else { // Fallback Node.replaceChild( Node.firstChild, document.createTextNode( label ) ); } } catch(e) {}// bailing out! } ); if(wgNamespaceNumber == 0){ addOnloadHook( function () { addPortletLink('p-lang', getWikiPath('Wikipedia:维基百科语言列表'), wgULS('维基百科语言列表','維基百科語言列表'), 'interwiki-completelist',wgULS('维基百科的完整各语言列表', '維基百科的完整各語言列表')); }); } } /* == 取消討論頁的[+]按鈕 == */ addOnloadHook(function () { if(document.getElementById('no-newsection') && document.getElementById('ca-addsection')) { document.getElementById('ca-addsection').style.display="none"; } }); /* ==WikiMiniAtlas世界地圖== */ /** WikiMiniAtlas ******************************************************* * * 描述:WikiMiniAtlas是一個popup而可點選與拖曳的世界地圖。 * 這個腳本將會讓所有的經緯度標示中顯示WikiMiniAtlas的popup開啟按鈕。 * 由於被許多計畫使用,因此腳本放置在元維基中。 * 更多資訊請詳見[[Meta:WikiMiniAtlas]]。 * 創建者:[[:en:User:Dschwen]] */ if (wgServer == "https://secure.wikimedia.org") { var metaBase = "https://secure.wikimedia.org/wikipedia/meta"; } else { var metaBase = "http://meta.wikimedia.org"; } importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400") /* ==反frame== */ try { if (top.location != self.location) { top.location.replace(self.location); } }catch(ex){ top.location.replace(self.location); } /** Cookies ***************************************************************************** */ function setCookie(cookieName, cookieValue) { var today = new Date(); var expire = new Date(); var nDays = 30; expire.setTime( today.getTime() + (3600000 * 24 * nDays) ); document.cookie = cookieName + "=" + escape(cookieValue) + ";path=/w" + ";expires="+expire.toGMTString(); document.cookie = cookieName + "=" + escape(cookieValue) + ";path=/wiki" + ";expires="+expire.toGMTString(); } function getCookie(cookieName) { var start = document.cookie.indexOf( cookieName + "=" ); if ( start == -1 ) return ""; var len = start + cookieName.length + 1; if ( ( !start ) && ( cookieName != document.cookie.substring( 0, cookieName.length ) ) ) { return ""; } var end = document.cookie.indexOf( ";", len ); if ( end == -1 ) end = document.cookie.length; return unescape( document.cookie.substring( len, end ) ); } function deleteCookie(cookieName) { if ( getCookie(cookieName) ) { document.cookie = cookieName + "=" + ";path=/w" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; document.cookie = cookieName + "=" + ";path=/wiki" + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } } /* ==保護選項校正== */ if(wgAction=="protect") { addOnloadHook( function(){ var pform=document.getElementById("mw-Protect-Form"); var timeoptions; timeoptions=pform["wpProtectExpirySelection-edit"].options; if(timeoptions[0].value!="existing"){ timeoptions[timeoptions.length-1].selected=true; ProtectionForm.updateExpiryList(pform["wpProtectExpirySelection-edit"]); } timeoptions=pform["wpProtectExpirySelection-move"].options; if(timeoptions[0].value!="existing"){ timeoptions[timeoptions.length-1].selected=true; ProtectionForm.updateExpiryList(pform["wpProtectExpirySelection-move"]); } }); } /* ==站内搜索统计== see http://wikistics.falsikon.de/ */ // This script is needed for anonymously logging search terms by the Squids; see [[wikt:de:MediaWiki:If-search.js]] // The search URL will contain the search term // Please modify retroactively // You may have to adapt this? function $(ID) {return document.getElementById(ID);} function tfSearch(s,t) { if ($(s)) { $(s).setAttribute("onsubmit", "SubSearch("+t+")"); $(s).parentNode.innerHTML = $(s).parentNode.innerHTML; // f***ing IE } } function LogSearch() { tfSearch('searchform',1); tfSearch('search',3); tfSearch('powersearch',2); tfSearch('bodySearch',4); oSEAp = $("searchform").action.replace(/^.*\/wiki\//, ""); } addOnloadHook(LogSearch); function SubSearch(s) { var x="/"; if (s<2) { if ($("searchInput").value == "") {x="";} $("searchform").action = "/wiki/"+oSEAp+x+$("searchInput").value; } else if (s<3) { if ($("powerSearchText").value == "") {x="";} $("powersearch").getElementsByTagName("input")[0].value = oSEAp+x+$("powerSearchText").value; } else if (s<4) { if ($("searchText").value == "") {x="";} $("search").firstChild.value = oSEAp+x+$("searchText").value; } else if (s<5) { if ($("bodySearchIput").value == "") {x="";} $("bodySearch").action = "/wiki/"+oSEAp+x+$("bodySearchIput").value; } } // /* MediaWiki:Monobook.js */ /* 请与[[MediaWiki:Common.js]]保持协调一致 */