Skip to content

Commit

Permalink
feat: 非维护组/技术组成员提方针编辑请求时提醒要走提案
Browse files Browse the repository at this point in the history
  • Loading branch information
BearBin1215 authored Jul 31, 2023
1 parent d6644bb commit d73e7c9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/gadgets/site-js/MediaWiki:Gadget-site-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,4 +608,24 @@
$window.on("load", () => {
$window.triggerHandler("resize");
});
// 非维护组、技术组成员提出方针编辑请求时提醒需要走提案
if (
decodeURIComponent(window.location.href).indexOf("Template:编辑请求") > -1 &&
mw.config.get("wgNamespaceNumber") === 5 &&
mw.config.get("wgAction") === "edit" &&
!mw.config.get("wgUserGroups").some((value) => ["patroller", "sysop", "techeditor", "scripteditor", "interface-admin", "staff"].includes(value))
) {
OO.ui.alert(
$('<p>进行<b>实质性</b>修改时,需要通过<a href="https://zh.moegirl.org.cn/萌娘百科:提案" style="font-weight:bold">提案</a>或<a href="https://zh.moegirl.org.cn/萌娘百科:快速提案" style="font-weight:bold">快速提案</a>流程才可对方针和指引进行改动。</p><p>在讨论页发起的编辑请求仅可用于修正错别字等<b>非实质性</b>修改。</p>'),
{
title: "提醒",
size: "small",
actions: [
{
action: "Confirm",
label: "我知道了",
},
],
});
}
})();

0 comments on commit d73e7c9

Please sign in to comment.