本网站正在建设中(~ ̄▽ ̄)~

  • 你好~!欢迎来到中文歌声合成个人收集站-VCPedia.cn!
  • 若发现页面信息有误投稿至本站,请联系管理员。

MediaWiki:Gadget-edit.js

VCPedia.cn ——关于中文歌声合成的一切。
跳到导航 跳到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
/* <pre> */
/**
 * -------------------------------------------------------------------------
 * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 * -------------------------------------------------------------------------
 */
var _addText = '{{difMGP|适配镜像站、本地化}}';

"use strict";
var __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
$(function () {
    var e_1, _a, e_2, _b;
    if (mw.config.get("wgPageName").startsWith("萌娘百科_talk:讨论版/")) {
        $(".mw-editnotice + .mw-warning-with-logexcerpt").hide();
    }
    var sanity = $(document.createElement("span"));
    var sanityClean = function (h) {
        sanity.text(h);
        return sanity.html();
    };
    var wpSummary = $('[name="wpSummary"]');
    $(".mw-summary-preset-item a").on("click", function (_a) {
        if ( $(this).parent().attr('title') != null){
    	    wpSummary.val((wpSummary.val()+" "+$(this).parent().attr('title')).trim());
            }
        else {
            var summary = _a.target;
            wpSummary.val((wpSummary.val()+" "+$(summary).text()).trim());
            }
        wpSummary.trigger("focus");
        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]) {
        var replaces_1 = [];
        $("#wpTextbox1").val($("#wpTextbox1").val().replace(/http:\/\/([a-z\d]+\.bilibili\.[a-z\d]+)/ig, function (raw, $1) {
            var result = "https://".concat($1);
            replaces_1.push(raw, result);
        }));
        oouiDialog.alert("\u60A8\u7684\u7F16\u8F91\u5185\u5BB9\u542B\u6709\u4EE5\u4E0B http \u94FE\u63A5\uFF0C\u5DF2\u81EA\u52A8\u66FF\u6362\u4E3A\u5BF9\u5E94\u7684 https \u94FE\u63A5\uFF1A<ul><li>".concat(replaces_1.map(function (raw, result) { return "<code>".concat(sanityClean(raw), "</code> \u2192 <code>").concat(sanityClean(result), "</code>"); }), "</li></ul>"), {
            title: "萌娘百科提醒您",
            size: "medium"
        });
    }
    var prefixNumber = function (num) {
        var result = "".concat(num);
        if (result.length === 1) {
            result = "0".concat(result);
        }
        return result;
    };
    if ($(".permissions-errors, #wpTextbox1[readonly]")[1] && mw.config.get("wgUserName") && !$(".newComment")[0]) {
        var wgNamespaceNumber = mw.config.get("wgNamespaceNumber"), 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 wgPageName_1 = mw.config.get("wgPageName");
        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_1) ? 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()))), "&section=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");
    if (explainconflict[0]) {
        $("html, body").animate({
            scrollTop: explainconflict.closest(".infoBox").offset().top - 2
        }, 137);
    }
});

/* </pre> */