MediaWiki:Gadget-checkRestricted.js: Difference between revisions
ページの作成:「→* * CheckRestricted - 2024 Waki285 * Confirms when an attempt is made to grant the specified authority to another person. * @license MIT or Apache-2.0: (function () { var spName = mw.config.get("wgCanonicalSpecialPageName"); if (spName !== "Userrights") { return; } if (typeof restrictedGroups === "undefined") { var restrictedGroups = ["checkuser", "suppress"]; } var $form = $("#mw-content-text form"); if ($form.length === 0) { r…」 |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/** | /** | ||
* CheckRestricted - 2024 Waki285 | * CheckRestricted - 2024 Waki285 | ||
* Confirms when an attempt is made to grant the specified | * Confirms when an attempt is made to grant the specified permission to another person. | ||
* @license MIT or Apache-2.0 | * @license MIT or Apache-2.0 | ||
*/ | */ | ||
Line 11: | Line 11: | ||
} | } | ||
if (typeof restrictedGroups === "undefined") { | if (typeof window.restrictedGroups === "undefined") { | ||
window.restrictedGroups = ["checkuser", "suppress"]; | |||
} | } | ||
Line 32: | Line 32: | ||
if ($form2.length === 0) { | if ($form2.length === 0) { | ||
return; | |||
} | |||
var $user = $form2.find("input[type=hidden][name=user]"); | |||
var user = $user.val(); | |||
var executor = mw.config.get("wgUserName"); | |||
if (executor === user) { | |||
return; | return; | ||
} | } | ||
Line 44: | Line 51: | ||
var $group = $form2.find("input[name^='wpGroup-']:checked"); | var $group = $form2.find("input[name^='wpGroup-']:checked"); | ||
var danger = false; | var danger = false; |