MediaWiki:Common.js:修订间差异

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) {