无编辑摘要
imported>=海豚= 无编辑摘要 |
imported>=海豚= 无编辑摘要 |
||
(未显示同一用户的22个中间版本) | |||
第3行: | 第3行: | ||
window.origHeadElem = document.getElementById("firstHeading") || document.getElementById("section_0"); | window.origHeadElem = document.getElementById("firstHeading") || document.getElementById("section_0"); | ||
window.origHeadHTML=window.origHeadElem.innerHTML; | window.origHeadHTML=window.origHeadElem.innerHTML; | ||
if ( mw.config.get( ' | if (mw.config.get('wgNamespaceNumber') != -1){ | ||
window.newtrad2sim=function(){ | window.newtrad2sim=function(){ | ||
var listobj=pview.getElementsByTagName("ul")[0]; | var listobj=pview.getElementsByTagName("ul")[0]; | ||
if(listobj.parentNode.className.indexOf("emptyPortlet")<0){ | if(listobj.parentNode.className.indexOf("emptyPortlet")<0){ | ||
window.localStorage.setItem('Traditional Chinese', true); | window.localStorage.setItem('Traditional Chinese', true); | ||
location.reload(); | |||
} | } | ||
}; | }; | ||
window.newtrad2simm=function(){ | window.newtrad2simm=function(){ | ||
window.localStorage.setItem('Traditional Chinese', true); | window.localStorage.setItem('Traditional Chinese', true); | ||
location.reload(); | |||
}; | }; | ||
第41行: | 第32行: | ||
window.simrestorem=function(){ | window.simrestorem=function(){ | ||
localStorage.removeItem('Traditional Chinese'); | localStorage.removeItem('Traditional Chinese'); | ||
location.reload(); | |||
}; | }; | ||
第58行: | 第46行: | ||
}else{ | }else{ | ||
var pview=document.getElementById("p-namespaces"); | var pview=document.getElementById("p-namespaces"); | ||
var listobj=pview.getElementsByTagName("ul")[0]; | var listobj=pview.getElementsByTagName("ul")[0]; | ||
if(listobj.parentNode.className.indexOf("emptyPortlet")<0){ | if(listobj.parentNode.className.indexOf("emptyPortlet")<0){ | ||
第69行: | 第56行: | ||
} | } | ||
} | } | ||
} | if (window.localStorage.getItem('Traditional Chinese')) { | ||
document.querySelector("body").innerHTML=window.newtrad2simcore(" "+document.querySelector("body").innerHTML).substr(1); | |||
window.origHeadElem.innerHTML=window.newtrad2simcore(" "+window.origHeadElem.innerHTML).substr(1); | |||
var convtag=document.getElementById("ca-conv-text"); | |||
convtag.parentElement.innerHTML="<a href=\"javascript:window.simrestorem()\" title=\"復原\" id=\"ca-conv-text\">港台繁體<\/a>"; | |||
} |