使用者:Wong128hk/monobook.js
註:重取頁面,文方新焉。
- Firefox / Safari:押 Shift 並點 重新載入,或合鍵 Ctrl-F5 或 Ctrl-R(Mac 為 ⌘-R)。
- Google Chrome:點 Ctrl-Shift-R(Mac為 ⌘-Shift-R)。
- Internet Explorer:押 Ctrl 並點 重新整理,或合鍵 Ctrl-F5。
- Opera:須至 Tools → Preferences 清謄本(Mac 為 Opera → Preferences)。
// [[:en:User:Lupin/popups.js]]
mw.loader.load(
'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
document.write('<script type="text/javascript" src="'
+ 'http://zh-yue.wikipedia.org/w/index.php?title=User:Sl/wiki/sim2trad.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
document.write('<script type="text/javascript" src="'
+ 'http://zh-yue.wikipedia.org/w/index.php?title=User:hillgentleman/trad2sim.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
origStr = "";
function supplane(num) {
if(num >= 65536) num -= 65536;
var num1 = Math.floor(num / 1024) + 55296;
var num2 = num % 1024 + 56320;
return String.fromCharCode(num1) + String.fromCharCode(num2);
}
function converts2t() {
var content = document.getElementById("bodyContent").innerHTML;
var newStr = "";
if(origStr.length > 0)
content = origStr;
if(content.length == 0) {
newStr = default_text;
}
else for(var i = 0; i < content.length; i++) {
var unicode = content.charCodeAt(i);
if(unicode >= 55296 && unicode <= 56319) {
var unicode1 = content.charCodeAt(++i);
if(unicode1 >= 56320 && unicode1 <= 57343) {
unicode = 1024 * unicode - 56557568 + unicode1 - 56320;
}
}
var unicode2 = table2t[unicode];
if(unicode2 > 65535) {
newStr += supplane(unicode2);
}
else if(unicode > 65535 && !unicode2) {
newStr += supplane(unicode);
}
else {
newStr += ( unicode2 ) ? String.fromCharCode(unicode2) : String.fromCharCode(unicode);
}
}
origStr = content;
document.getElementById("bodyContent").innerHTML = newStr;
}
function convertt2s() {
var content = document.getElementById("bodyContent").innerHTML;
var newStr = "";
if(origStr.length > 0)
content = origStr;
if(content.length == 0) {
newStr = default_text;
}
else for(var i = 0; i < content.length; i++) {
var unicode = content.charCodeAt(i);
if(unicode >= 55296 && unicode <= 56319) {
var unicode1 = content.charCodeAt(++i);
if(unicode1 >= 56320 && unicode1 <= 57343) {
unicode = 1024 * unicode - 56557568 + unicode1 - 56320;
}
}
var unicode2 = table2s[unicode];
if(unicode2 > 65535) {
newStr += supplane(unicode2);
}
else if(unicode > 65535 && !unicode2) {
newStr += supplane(unicode);
}
else {
newStr += ( unicode2 ) ? String.fromCharCode(unicode2) : String.fromCharCode(unicode);
}
}
origStr = content;
document.getElementById("bodyContent").innerHTML = newStr;
}
function convertorig() {
if(origStr.length > 0)
document.getElementById("bodyContent").innerHTML = origStr;
}
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript"></' + 'script>');