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

来自萌娘文库
跳转至: 导航搜索
(同步小工具)
1个标签Bot
 
(跨站同步)
1个标签Bot
 
第1行: 第1行:
/* eslint-disable prefer-arrow-callback */
+
/* <pre> */
/* eslint-disable prefer-template */
+
/**
/* eslint-disable comma-dangle */
+
* -------------------------------------------------------------------------
/* eslint-disable no-var */
+
* !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
/* eslint dot-notation: ["error", { "allowPattern": "^(?:catch|default)$" } ] */
+
* -------------------------------------------------------------------------
/* eslint-disable no-unused-vars */
+
*/
/* eslint-disable no-redeclare */
+
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/CleanDeleteReasons/MediaWiki:Gadget-CleanDeleteReasons.js|user=[[U:AnnAngela]]|longId=2ed6c0ce53260c5c00dbbb17cf0a74b0255e597b|shortId=2ed6c0c|message=upgrade}}';
/* global mw, $, OO, moment, Cron, prettyPrint, LocalObjectStorage, lazyload, wgULS */
+
 
/* eslint-enable no-unused-vars */
 
/* eslint-enable no-redeclare */
 
 
"use strict";
 
"use strict";
// <pre>
 
 
$(function () {
 
$(function () {
 
     var wpReason = $("#wpReason");
 
     var wpReason = $("#wpReason");
第17行: 第14行:
 
             $("#wpReason").val("");
 
             $("#wpReason").val("");
 
         }
 
         }
         $.get(mw.config.get("wgServer") + mw.config.get("wgScriptPath") + "/index.php?action=render&curid=" + mw.config.get("wgArticleId"), function (h) {
+
         $.get("".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScriptPath"), "/index.php?action=render&curid=").concat(mw.config.get("wgArticleId")), function (h) {
 
             var root = $("<div/>").html(h);
 
             var root = $("<div/>").html(h);
 
             var reason = root.find(".mw-parser-output > .infoBox.will2Be2Deleted #reason");
 
             var reason = root.find(".mw-parser-output > .infoBox.will2Be2Deleted #reason");
 
             var actor = root.find(".mw-parser-output > .infoBox.will2Be2Deleted #actor a").first();
 
             var actor = root.find(".mw-parser-output > .infoBox.will2Be2Deleted #actor a").first();
 
             if (reason.length === 1 && actor.length === 1) {
 
             if (reason.length === 1 && actor.length === 1) {
                 $("#wpReason").val("删除被挂删的页面,[[User_talk:" + actor.text() + "|" + actor.text() + "]]的挂删理由:''" + reason.text() + "''");
+
                 $("#wpReason").val("\u5220\u9664\u88AB\u6302\u5220\u7684\u9875\u9762\uFF0C[[User_talk:".concat(actor.text(), "|").concat(actor.text(), "]]\u7684\u6302\u5220\u7406\u7531\uFF1A''").concat(reason.text(), "''"));
 
             }
 
             }
 
         });
 
         });
 
     }
 
     }
 
});
 
});
// </pre>
+
 
 +
/* </pre> */

2022年9月6日 (二) 01:35的最新版本

/* <pre> */
/**
 * -------------------------------------------------------------------------
 * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 * -------------------------------------------------------------------------
 */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/CleanDeleteReasons/MediaWiki:Gadget-CleanDeleteReasons.js|user=[[U:AnnAngela]]|longId=2ed6c0ce53260c5c00dbbb17cf0a74b0255e597b|shortId=2ed6c0c|message=upgrade}}';

"use strict";
$(function () {
    var wpReason = $("#wpReason");
    if (mw.config.get("wgAction") === "delete" && wpReason.length > 0) {
        if (/(?:^内容|內容|被清空前|页面为空|頁面為空|page was empty|content was|content before blanking was)/i.test($("#wpReason").val())) {
            $("#wpReason").val("");
        }
        $.get("".concat(mw.config.get("wgServer")).concat(mw.config.get("wgScriptPath"), "/index.php?action=render&curid=").concat(mw.config.get("wgArticleId")), function (h) {
            var root = $("<div/>").html(h);
            var reason = root.find(".mw-parser-output > .infoBox.will2Be2Deleted #reason");
            var actor = root.find(".mw-parser-output > .infoBox.will2Be2Deleted #actor a").first();
            if (reason.length === 1 && actor.length === 1) {
                $("#wpReason").val("\u5220\u9664\u88AB\u6302\u5220\u7684\u9875\u9762\uFF0C[[User_talk:".concat(actor.text(), "|").concat(actor.text(), "]]\u7684\u6302\u5220\u7406\u7531\uFF1A''").concat(reason.text(), "''"));
            }
        });
    }
});

/* </pre> */