“MediaWiki:Gadget-widgetPreload.js”的版本间的差异

来自萌娘共享
跳转至: 导航搜索
(跨站同步)
1个标签由机器人或全自动脚本执行的操作
 
1个标签由机器人或全自动脚本执行的操作
第5行: 第5行:
 
  * -------------------------------------------------------------------------
 
  * -------------------------------------------------------------------------
 
  */
 
  */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/widgetPreload/MediaWiki:Gadget-widgetPreload.js|user=[[U:AnnAngela]]|longId=3ea858d1abfa9a00e93328836c9754ba6a8033e6|shortId=3ea858d|message=chore(widgetPreload): Rename to correct one}}';
+
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/widgetPreload/MediaWiki:Gadget-widgetPreload.js|user=[[U:AnnAngela]]|longId=f5b2227a801147f261acc12f7e1e187dbfd3f9ad|shortId=f5b2227|message=style: Remove unnecessary `return`}}';
  
 
"use strict";
 
"use strict";
第16行: 第16行:
 
                 window.onbeforeunload = undefined;
 
                 window.onbeforeunload = undefined;
 
                 $(window).off("beforeunload");
 
                 $(window).off("beforeunload");
                 location.replace("".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScriptPath"), "/index.php?action=edit&title=").concat(mw.config.get("wgPageName").replace(/ |_/g, "").replace(/^([^/]*)[/\\].*$/i, "$1").split(regex).map(function (n) {
+
                 location.replace("".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScriptPath"), "/index.php?action=edit&title=").concat(mw.config.get("wgPageName").replace(/ |_/g, "").replace(/^([^/]*)[/\\].*$/i, "$1").split(regex).map(function (n) { return toUpperFirstCase(n); }).join("")));
                    return toUpperFirstCase(n);
 
                }).join("")));
 
 
                 return;
 
                 return;
 
             }
 
             }

2023年3月14日 (二) 10:26的版本

/* <pre> */
/**
 * -------------------------------------------------------------------------
 * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 * -------------------------------------------------------------------------
 */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/widgetPreload/MediaWiki:Gadget-widgetPreload.js|user=[[U:AnnAngela]]|longId=f5b2227a801147f261acc12f7e1e187dbfd3f9ad|shortId=f5b2227|message=style: Remove unnecessary `return`}}';

"use strict";
$(function () {
    var toUpperFirstCase = function (t) { return "".concat("".concat(t[0]).substring(0, 1).toUpperCase()).concat("".concat(t).substring(1)); };
    if (mw.config.get("wgNamespaceNumber") === 274 && !mw.config.get("wgCurRevisionId")) {
        if (mw.config.get("wgAction") === "edit") {
            var regex = /[-_,./\\]/;
            if (regex.test(mw.config.get("wgPageName"))) {
                window.onbeforeunload = undefined;
                $(window).off("beforeunload");
                location.replace("".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScriptPath"), "/index.php?action=edit&title=").concat(mw.config.get("wgPageName").replace(/ |_/g, "").replace(/^([^/]*)[/\\].*$/i, "$1").split(regex).map(function (n) { return toUpperFirstCase(n); }).join("")));
                return;
            }
            var flag = "wg".concat(mw.config.get("wgTitle")).replace(/ /g, "");
            $("#wpTextbox1").val("<noinclude> </noinclude><includeonly><!--{if !isset($".concat(flag, ") || !$").concat(flag, "}--><!--{assign var=\"").concat(flag, "\" value=true scope=\"global\"}--><script>\n\"use strict\";\nwindow.RLQ = window.RLQ || [];\nwindow.RLQ.push(() => {\n\n});\n</script><!--{/if}--></includeonly>"));
        }
        if ($("#mw-content-text > .mw-parser-output > .noarticletext")[0]) {
            $(document.body).addClass("noWidget");
        }
    }
});

/* </pre> */