|
|
| 第1行: |
第1行: |
| /* <pre> */
| |
| /**
| |
| * -------------------------------------------------------------------------
| |
| * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
| |
| * -------------------------------------------------------------------------
| |
| */
| |
| var _addText = '{{difMGP|适配镜像站、本地化}}';
| |
|
| |
| "use strict"; | | "use strict"; |
| var __values = (this && this.__values) || function(o) { | | var __values = (this && this.__values) || function(o) { |
| 第39行: |
第31行: |
| var wgPageName = mw.config.get("wgPageName"); | | var wgPageName = mw.config.get("wgPageName"); |
| var wgNamespaceNumber = mw.config.get("wgNamespaceNumber"); | | var wgNamespaceNumber = mw.config.get("wgNamespaceNumber"); |
| if (wgPageName.startsWith("萌娘百科_talk:讨论版/")) {
| |
| $(".mw-editnotice + .mw-warning-with-logexcerpt").hide();
| |
| }
| |
| var sanityClean = function (h) { | | var sanityClean = function (h) { |
| return $("<span>").text(h).html(); | | return $("<span>").text(h).html(); |
| 第57行: |
第46行: |
| return false; | | return false; |
| }); | | }); |
| $(".wikiEditor-ui-controls").css("background-color", $("#content").css("background-color"));
| |
| if ($(".mw-summary-preset")[0]) {
| |
| $(".CheckNewSectionOn").hide();
| |
| }
| |
| else {
| |
| $(".CheckNewSectionOff").hide();
| |
| $('.headerInputbox a[href*="preload=Template%3A权限申请%2F"], .headerInputbox a[href*="preload=Template%3A%E6%9D%83%E9%99%90%E7%94%B3%E8%AF%B7%2F"]').attr("target", "_self");
| |
| }
| |
| if ($(".AbusefilterWarningNoHttp")[0]) { | | if ($(".AbusefilterWarningNoHttp")[0]) { |
| var replaces = []; | | var replaces = []; |
| 第72行: |
第53行: |
| })); | | })); |
| oouiDialog.alert("您的编辑内容含有以下 http 链接,已自动替换为对应的 https 链接:<ul><li>".concat(replaces.map(function (raw, result) { return "<code>".concat(sanityClean(raw), "</code> \u2192 <code>").concat(sanityClean(result), "</code>"); }), "</li></ul>"), { | | oouiDialog.alert("您的编辑内容含有以下 http 链接,已自动替换为对应的 https 链接:<ul><li>".concat(replaces.map(function (raw, result) { return "<code>".concat(sanityClean(raw), "</code> \u2192 <code>").concat(sanityClean(result), "</code>"); }), "</li></ul>"), { |
| title: "萌娘百科提醒您", | | title: "兽耳维基提醒您", |
| size: "medium" | | size: "medium" |
| }); | | }); |
| 第83行: |
第64行: |
| return result; | | return result; |
| }; | | }; |
| if ($(".permissions-errors, #wpTextbox1[readonly]")[1] && mw.config.get("wgUserName") && !$(".newComment")[0]) {
| |
| var ns = [];
| |
| if (wgNamespaceNumber < 0 || wgNamespaceNumber % 2 === 1) {
| |
| return;
| |
| }
| |
| var talkNamespaceNumber = wgNamespaceNumber + 1;
| |
| var talkns = -1;
| |
| try {
| |
| for (var _c = __values(Object.entries(mw.config.get("wgNamespaceIds"))), _d = _c.next(); !_d.done; _d = _c.next()) {
| |
| var _e = __read(_d.value, 2), k = _e[0], v = _e[1];
| |
| if (v === wgNamespaceNumber) {
| |
| ns.push(k);
| |
| }
| |
| if (talkns === -1 && v === talkNamespaceNumber) {
| |
| talkns = k;
| |
| }
| |
| }
| |
| }
| |
| catch (e_1_1) { e_1 = { error: e_1_1 }; }
| |
| finally {
| |
| try {
| |
| if (_d && !_d.done && (_a = _c["return"])) _a.call(_c);
| |
| }
| |
| finally { if (e_1) throw e_1.error; }
| |
| }
| |
| if (!ns[0]) {
| |
| return;
| |
| }
| |
| var page_1 = mw.config.get("wgPageName");
| |
| var pageToLowerCase = page_1.toLowerCase();
| |
| try {
| |
| for (var ns_1 = __values(ns), ns_1_1 = ns_1.next(); !ns_1_1.done; ns_1_1 = ns_1.next()) {
| |
| var n = ns_1_1.value;
| |
| if (pageToLowerCase.startsWith(n)) {
| |
| page_1 = page_1.replace(new RegExp("^".concat(n, ":"), "i"), "");
| |
| break;
| |
| }
| |
| }
| |
| }
| |
| catch (e_2_1) { e_2 = { error: e_2_1 }; }
| |
| finally {
| |
| try {
| |
| if (ns_1_1 && !ns_1_1.done && (_b = ns_1["return"])) _b.call(ns_1);
| |
| }
| |
| finally { if (e_2) throw e_2.error; }
| |
| }
| |
| var talkpage_1 = "".concat(talkns, ":").concat(page_1);
| |
| var container = $("<div/>", {
| |
| "class": "editRequest"
| |
| });
| |
| var now_1 = new Date();
| |
| container.append("虽然您无权编辑本页面,但您可以点击右侧按钮在本页的讨论页提出编辑请求,让可以编辑的人代为编辑:");
| |
| $("<span/>").addClass("newComment").text("提出编辑请求").on("click", function () {
| |
| window.open("".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScriptPath"), "/index.php?action=edit&preload=Template:编辑请求/").concat(/^MediaWiki:Conversiontable\/zh-[a-z]+$/.test(wgPageName) ? page_1 : "comment", "&preloadtitle=编辑请求 - ").concat(encodeURIComponent("".concat(mw.config.get("wgUserName"), " - ").concat(now_1.getFullYear(), ".").concat(prefixNumber(now_1.getMonth() + 1), ".").concat(prefixNumber(now_1.getDate()))), "§ion=new&title=").concat(encodeURIComponent(talkpage_1)), "_blank");
| |
| }).appendTo(container);
| |
| $("#mw-content-text").children(".wikiEditor-ui:first, textarea[readonly]:first").before("<hr>").before(container);
| |
| }
| |
| var explainconflict = $("#mw-content-text > .mw-explainconflict #explainconflict-info"); | | var explainconflict = $("#mw-content-text > .mw-explainconflict #explainconflict-info"); |
| if (explainconflict[0]) { | | if (explainconflict[0]) { |
| 第148行: |
第72行: |
| if (![0, 2].includes(wgNamespaceNumber) || wgNamespaceNumber === 2 && !wgPageName.includes("/") || mw.config.get("wgPageContentModel") !== "wikitext") { | | if (![0, 2].includes(wgNamespaceNumber) || wgNamespaceNumber === 2 && !wgPageName.includes("/") || mw.config.get("wgPageContentModel") !== "wikitext") { |
| $("#multiboilerplateform").remove(); | | $("#multiboilerplateform").remove(); |
| }
| |
| if (new URLSearchParams(location.search).get("preloadtitle").startsWith("编辑请求") &&
| |
| wgNamespaceNumber === 5 &&
| |
| !mw.config.get("wgUserGroups").some(function (value) { return ["patroller", "sysop", "techeditor", "interface-admin", "staff"].includes(value); })) {
| |
| OO.ui.alert($('<p>进行<b>实质性</b>修改时,需要通过<a href="/萌娘百科:提案" style="font-weight:bold">提案</a>或<a href="/萌娘百科:快速提案" style="font-weight:bold">快速提案</a>流程才可对方针和指引进行改动。</p><p>在讨论页发起的编辑请求仅可用于修正错别字等<b>非实质性</b>修改。</p>'), {
| |
| title: "提醒",
| |
| size: "small",
| |
| actions: [
| |
| {
| |
| action: "Confirm",
| |
| label: "我知道了"
| |
| },
| |
| ]
| |
| });
| |
| } | | } |
| }); | | }); |
|
| |
| /* </pre> */
| |