无编辑摘要
imported>=海豚= 无编辑摘要 |
imported>=海豚= 无编辑摘要 |
||
第22行: | 第22行: | ||
var wgUserGroups = mw.config.get("wgUserGroups"); | var wgUserGroups = mw.config.get("wgUserGroups"); | ||
var isMGPMGUser = wgUserGroups.includes("patroller") || wgUserGroups.includes("sysop"); | var isMGPMGUser = wgUserGroups.includes("patroller") || wgUserGroups.includes("sysop"); | ||
/* 修正验证码 */ | |||
function tcc() { | |||
var tcBtn = document.getElementById("TencentCaptcha"); | |||
if (tcBtn && !tcBtn.disabled) { | |||
var originText = tcBtn.innerText; | |||
tcBtn.innerText = "正在加载验证码,请稍候……"; | |||
var wpCaptchaWord = document.getElementById("wpCaptchaWord"); | |||
var wpCaptchaId = document.getElementById("wpCaptchaId"); | |||
var c = setInterval(function () { | |||
if (typeof window.TencentCaptcha === "function") { | |||
clearInterval(c); | |||
if (!tcBtn.disabled) { | |||
new window.TencentCaptcha(document.getElementById("TencentCaptcha")); | |||
tcBtn.innerText = originText; | |||
} | |||
} | |||
}, 100); | |||
document.getElementById("wpSave").addEventListener("click", function (e) { | |||
if (!tcBtn.disabled && (!wpCaptchaWord.value || !wpCaptchaId.value)) { | |||
alert("请点击验证按钮,完成验证后再提交"); | |||
e.preventDefault(); | |||
e.stopImmediatePropagation(); | |||
e.stopPropagation(); | |||
} | |||
}, { | |||
capture: true | |||
}); | |||
} | |||
} | |||
//滚动公告 | //滚动公告 | ||
function autoScroll(obj) { | function autoScroll(obj) { | ||
第347行: | 第376行: | ||
}); | }); | ||
}, 200); | }, 200); | ||
//图片地址 | |||
mw.loader.using("mediawiki.Uri").then(function () { | |||
setInterval(function () { | |||
$(document.querySelectorAll('img[src*="//img.moegirl.org/"]:not(.org-changed), img[src*="//commons.moegirl.org/"]:not(.org-changed)')).each(function (_, ele) { | |||
try { | |||
var url = new mw.Uri(ele.src); | |||
if (["img.moegirl.org", "commons.moegirl.org"].includes(url.host)) { | |||
url.host += ".cn"; | |||
ele.src = url; | |||
} | |||
ele.classList.add("org-changed"); | |||
} catch (e) { } | |||
}); | |||
}, 200); | |||
}); | |||
//修正hash跳转错误 | //修正hash跳转错误 | ||
if ($(".mw-collapsible")[0]) { | if ($(".mw-collapsible")[0]) { |