test>屠麟傲血 无编辑摘要 |
(本地化) |
||
| (未显示同一用户的1个中间版本) | |||
| 第1行: | 第1行: | ||
"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"); | ||
var sanityClean = function (h) { | var sanityClean = function (h) { | ||
return $("<span>").text(h).html(); | return $("<span>").text(h).html(); | ||
| 第57行: | 第46行: | ||
return false; | return false; | ||
}); | }); | ||
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; | ||
}; | }; | ||
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(); | ||
} | } | ||
}); | }); | ||
2024年1月2日 (二) 23:33的最新版本
"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;
var wgPageName = mw.config.get("wgPageName");
var wgNamespaceNumber = mw.config.get("wgNamespaceNumber");
var sanityClean = function (h) {
return $("<span>").text(h).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;
});
if ($(".AbusefilterWarningNoHttp")[0]) {
var replaces = [];
$("#wpTextbox1").val($("#wpTextbox1").val().replace(/http:\/\/([a-z\d]+\.bilibili\.[a-z\d]+)/ig, function (raw, $1) {
var result = "https://".concat($1);
replaces.push(raw, result);
}));
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: "兽耳维基提醒您",
size: "medium"
});
}
var prefixNumber = function (num) {
var result = "".concat(num);
if (result.length === 1) {
result = "0".concat(result);
}
return result;
};
var explainconflict = $("#mw-content-text > .mw-explainconflict #explainconflict-info");
if (explainconflict[0]) {
$("html, body").animate({
scrollTop: explainconflict.closest(".infoBox").offset().top - 2
}, 137);
}
if (![0, 2].includes(wgNamespaceNumber) || wgNamespaceNumber === 2 && !wgPageName.includes("/") || mw.config.get("wgPageContentModel") !== "wikitext") {
$("#multiboilerplateform").remove();
}
});