注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
?_=1
来访问最新页面。https://zh.moegirl.org.cn/User:Ave/common.js?_=1
mw.loader.load('https://zh.moegirl.org/index.php?title=User:AnnAngela/js/navbox-link.js&action=raw&ctype=text/javascript');
mw.loader.load('https://zh.moegirl.org/index.php?title=User:AnnAngela/js/mwPanel.js&action=raw&ctype=text/javascript');
mw.loader.load('https://zh.moegirl.org/index.php?title=User:AnnAngela/js/watchlist-log.js&action=raw&ctype=text/javascript');
mw.loader.load('/index.php?title=User:東東君/js/uploader.js&action=raw&ctype=text/javascript');//批量上传图片
mw.loader.load("/index.php?title=User:BearBin/js/OneKeyPurge.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/QuickThank.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/BulkMove.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/Excel2Wiki.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/TableExporter.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/ShowContributors.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/MassEdit.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/TextDiff.js&action=raw&ctype=text/javascript");
mw.loader.load("/index.php?title=User:BearBin/js/ListEnhancer.js&action=raw&ctype=text/javascript");
window.TextDiff = true;
$('img[srcset*=".svg.png"]').each(function (_, ele) {
if ($(ele).attr("srcset").indexOf("img.moegirl.org.cn/") > -1) {
$(ele).attr("src", $(ele).attr("src").replace(/thumb\//g, "").replace(/\.svg\/.*/g, ".svg"));
$(ele).attr("srcset", $(ele).attr("srcset").replace(/thumb\//g, "").replace(/\.svg\/[^ ]*/g, ".svg"));
}
});
$("img[data-lazy-src*='.svg.png']").each(function (_, ele) {
if ($(ele).attr("data-lazy-src").indexOf("img.moegirl.org.cn/") > -1) {
var dataLazySrcset = $(ele).attr("data-lazy-srcset");
$(ele)
.attr("src", $(ele).attr("data-lazy-src").replace(/thumb\//g, "").replace(/\.svg\/.*/g, ".svg"))
.attr("srcset", dataLazySrcset ? dataLazySrcset.replace(/thumb\//g, "").replace(/\.svg\/[^ ]*/g, ".svg") : "")
.removeAttr("data-lazy-state");
$(ele).replaceWith($(ele).clone());
}
});
$(function () {
$("pre").each(function () {
$("head").append("<style>pre::before{content:attr(lang);display:block;text-align:right;font-weight:700;margin-right:.5em;}</style>");
var preLang = $(this).attr("lang");
if (!preLang) {
var className = $(this).attr("class");
var match = className ? className.match(/lang-[a-zA-Z]*/i) : null;
preLang = match ? match[0].replace("lang-", "") : "";
$(this).attr("lang", preLang);
}
});
});
mw.loader.using(['site']).then(function() {
i18n = {
specialpage: "特殊:上传文件",
multiupload: "批量上传:",
yes: "是",
no: "否",
sourcefiles: "源文件名:",
uploadfiles: "上传文件",
nofiles: "请选择要上传的文件!",
uploading: "上传中……",
uploaded: "已上传:",
failed: "上传失败",
done: "上传成功"
};
if (mw.config.get("wgPageName")!==i18n.specialpage) return;
$("#wpUploadFile").parent().parent().addClass("regularFileSelect");
$("tr.regularFileSelect").after('<tr><td class="mw-label">'+i18n.multiupload+'</td><td class="mw-input"><label><input type="radio" name="multipleFiles" value="'+i18n.yes+'" /> '+i18n.yes+'</label> <label><input type="radio" name="multipleFiles" value="'+i18n.no+'" checked="" /> '+i18n.no+'</label></td></tr>');
$("tr.regularFileSelect").after('<tr class="multipleFileSelect" style="display:none;"><td class="mw-label">'+i18n.sourcefiles+'</td><td class="mw-input"><input type="file" id="multiupload" multiple /></td></tr>');
$("input[name='wpUpload']").addClass("regularFileSelect");
$("#wpDestFile").parent().parent().addClass("regularFileSelect");
$("#wpIgnoreWarning").parent().parent().addClass("regularFileSelect");
$("span.mw-htmlform-submit-buttons").append('<input type="button" value="'+i18n.uploadfiles+'" class="multipleFileSelect" style="display:none;" id="multiFileSubmit" />');
$("input[name='multipleFiles']").change(function(){
if (this.value===i18n.yes) {
$(".regularFileSelect").hide();
$(".multipleFileSelect").show();
}
else {
$(".regularFileSelect").show();
$(".multipleFileSelect").hide();
}
});
$("#multiFileSubmit").click(function() {
files = $("#multiupload")[0].files;
if (files.length === 0) {
alert(i18n.nofiles);
return false;
}
summary = $("#wpUploadDescription").val();
if (summary !== "") text = summary;
else text = "";
watch = "preferences";
if ($("#wpWatchthis").is(":checked")) watch = "watch";
else watch = "nochange";
curFile = 0;
$("#firstHeading").text(i18n.uploading);
$("#mw-content-text").html("<h3>"+i18n.uploaded+"</h3><ul></ul><div style='display:none;' id='multiUploadFailed'><h3>"+i18n.failed+"</h3><ul></ul></div>");
function gNF() {
if(curFile>files.length) {
$("#mw-content-text").append("<h3>"+i18n.done+"</h3>");
return;
}
if(files[curFile] === undefined) {
curFile++;
gNF();
return;
}
$.ajax({url:'/api.php',data:{action:'query',meta:'tokens',format:'json'},dataType:'json'}).done(function(data) {
fd = new FormData();
fd.append("action","upload");
fd.append("token",data.query.tokens.csrftoken);
fd.append("filename",files[curFile].name);
fd.append("file",files[curFile]);
if (text !== "") fd.append("text",text);
fd.append("watchlist",watch);
fd.append("ignorewarnings",1);
fd.append("format","json");
$.ajax({
url:'/api.php',
method:'POST',
data:fd,
cache:false,
contentType:false,
processData:false,
type:'POST'
}).done(function(d){
$("#mw-content-text > ul").append('<li><a href="'+d.upload.imageinfo.descriptionurl+'" target="_blank">'+d.upload.filename+'</a></li>');
curFile++;
gNF();
}).fail(function(d) {
$("#multiUploadFailed ul").append('<li>'+files[curFile].name+'</li>');
$("#multiUploadFailed").show();
curFile++;
gNF();
});
});
}
gNF();
});
});