MediaWiki:Gadget-widgetPreload.js
注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:前往菜单 → 设置(Mac为Opera → Preferences),然后隐私和安全 → 清除浏览数据 → 缓存的图片和文件。
/* <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=3ea858d1abfa9a00e93328836c9754ba6a8033e6|shortId=3ea858d|message=chore(widgetPreload): Rename to correct one}}'; "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> */