User:SnowFireWolf/common.js

/* Wikiplus */ mw.loader.load('https://wikiplus-app.smartgslb.com/Main.js');

/*WikiEditor Toolbar*/ mw.loader.load('https://minecraft-zh.gamepedia.com/index.php?title=User:Jinxia2311/edittools.js&action=raw&ctype=text/javascript');

mw.loader.load("https://mwashfds.github.io/fds/libs/wmlib.dev.js"); mw.loader.load('https://mwashfds.github.io/mediawiki/gamepedia/ui_translate_zh-CN.js'); mw.loader.load('https://mwashfds.github.io/mediawiki/gamepedia/adremover.dev.js'); //解析当前条目及命名空间 /* if (currnamespace == "%E5%88%A9%E7%94%A8%E8%80%85") {currnamespace = "User"} if (currnamespace == "%E5%88%A9%E7%94%A8%E8%80%85%E3%83%BB%E3%83%88%E3%83%BC%E3%82%AF") {currnamespace = "User_talk"} if (currnamespace == "%E7%89%B9%E5%88%A5") {currnamespace = "Special"} if (currnamespace == "%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB") {currnamespace = "Module"} if (currnamespace == "Minecraft_Wiki%E3%83%BB%E3%83%88%E3%83%BC%E3%82%AF") {currnamespace = "Minecraft_Wiki_Talk"} if (currnamespace == "%E6%A8%A1%E5%9D%97") {currnamespace = "Module"} if (currnamespace == "%E3%83%BB%E3%83%88%E3%83%BC%E3%82%AF") {currnamespace = "Talk"} */ /* if (outputc.search("Edited ")>-1) {outputc=outputc.replace("Edited ","编辑了")} if (outputc.search("Created ")>-1) {outputc=outputc.replace("Created ","创建了")} if (outputc.search("about")>-1) {outputc=outputc.replace("about ","于大约")} if (outputc.search("an hour ")>-1) {outputc=outputc.replace("an hour ","1个小时")} if (outputc.search(" hours ")>-1) {outputc=outputc.replace(" hours ","个小时")} if (outputc.search(" minutes ")>-1) {outputc=outputc.replace(" minutes ","分钟")} if (outputc.search("days")>-1) {outputc=outputc.replace("days ","日")} if (outputc.search("a month")>-1) {outputc=outputc.replace("a month ","1个月")} if (outputc.search("months")>-1) {outputc=outputc.replace("months","个月")} if (outputc.search("ago-1) {outputc=outputc.replace("agodiff-1) {outputc=outputc.replace(">diff<",">差异hist-1) {outputc=outputc.replace(">hist<",">历史-1) {outputb=outputb.replace("Wikis Edited","编辑过的Wiki量")} if (outputb.search("Contributions")>-1) {outputb=outputb.replace("Contributions","贡献量")} if (outputb.search("Creations")>-1) {outputb=outputb.replace("Creations","创建页面数")} if (outputb.search("Edits")>-1) {outputb=outputb.replace("Edits","编辑数")} if (outputb.search("Deletes")>-1) {outputb=outputb.replace("Deletes","删除页面数")} if (outputb.search("Patrols")>-1) {outputb=outputb.replace("Patrols","巡查数")} if (outputb.search("Wiki Rank")>-1) {outputb=outputb.replace("Wiki Rank","Wiki排名")} if (outputb.search("Leaderboard")>-1) {outputb=outputb.replace("Leaderboard","排行榜")} if (outputb.search("Gamepedia Rank")>-1) {outputb=outputb.replace("Gamepedia Rank","Gamepedia排名")} if (outputb.search("Friends")>-1) {outputb=outputb.replace("Friends","好友数")} document.getElementsByClassName("section stats")[0].innerHTML = outputb;} if (clockwork2 == undefined) { var clockwork2 = setInterval("translateUI",1000);} } */ //还原地址 /* title = document.getElementById('firstHeading'); if (currnamespace == "User_talk") { title.innerHTML = title.innerHTML.replace("用户讨论","User talk");title.innerHTML = title.innerHTML.replace("利用者・トーク","User talk");} if (currnamespace == "User") { title.innerHTML = title.innerHTML.replace("用户","User");title.innerHTML = title.innerHTML.replace("利用者","User");} if (currnamespace == "Talk") { title.innerHTML = title.innerHTML.replace("讨论","Talk");title.innerHTML = title.innerHTML.replace("トーク","Talk");} if (currnamespace == "Special") {title.innerHTML = title.innerHTML.replace("特別","Special");} if (currnamespace == "Module") { title.innerHTML = title.innerHTML.replace("模块","Module");title.innerHTML = title.innerHTML.replace("モジュール","Module");} */ //简单AJAX /* var xmlhttp; function sendAjaxRequest(url) {xmlhttp=null; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest; } else if (window.ActiveXObject) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp !== null) { xmlhttp.onreadystatechange=state_Change; xmlhttp.open("GET",url,true); xmlhttp.send(null); xmlhttp.requestURL=url;} else { console.warn("Failed to load document from [" + xmlhttp.requestURL +"]:\nDoes not support object XMLHTTP.");} setTimeout("Returned = xmlhttp.responseText;",2000)} function state_Change { if (xmlhttp.readyState==4) {// 4 = "loaded" if (xmlhttp.status==200) {// 200 = "OK" return(xmlhttp.responseText);} else { console.warn("Failed to load document from [" + xmlhttp.requestURL +"]:\nRefused to response.");}}}} console.warn("AdLook Toolbox for MediaWiki has executed."); */