その他の操作
ページの作成:「→* * 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…」 |
細 Waki285 がページ「MediaWiki:Gadgets-checkRestricted.js」を「MediaWiki:Gadget-checkRestricted.js」に、リダイレクトを残さずに移動しました: ページ名の誤字・脱字 |
||
(相違点なし)
|
2024年7月13日 (土) 21:35時点における版
/**
* 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) {
return;
}
for (var i = 0; i < restrictedGroups.length; i++) {
var $group = $form.find("label[for='wpGroup-" + restrictedGroups[i] + "']");
if ($group.length > 0) {
$group.css("color", "red");
$group.append(" (restricted)");
}
}
var $form2 = $("form[name=editGroup]");
if ($form2.length === 0) {
return;
}
var $initInput = $("input[name='conflictcheck-originalgroups']");
var initGroups = $initInput.val().split(",");
$form2.on("submit", function (e) {
e.preventDefault();
$form2.append($("input[name=saveusergroups").clone().prop("type", "hidden"));
var $group = $form2.find("input[name^='wpGroup-']:checked");
var $user = $form2.find("input[type=hidden][name=user]");
var user = $user.val();
var executor = mw.config.get("wgUserName");
if (executor === user) {
$form2.off("submit");
$form2.submit();
return;
}
var danger = false;
for (var i = 0; i < $group.length; i++) {
var group = $group.eq(i).prop("name").replace("wpGroup-", "");
if (restrictedGroups.indexOf(group) === -1) {
continue;
}
if (initGroups.indexOf(group) !== -1) {
continue;
}
danger = true;
}
if (danger) {
if (confirm("You are about to add a restricted group to this user. Are you sure you want to continue?")) {
if (confirm("Are you really sure?")) {
if (confirm("Are you REALLY REALLY sure?")) {
alert("Okay, you asked for it...");
$form2.off("submit");
// wait 1sec
setTimeout(function () {
$form2.submit();
}, 1000);
} else {
return;
}
} else {
return;
}
} else {
return;
}
}
$form2.off("submit");
$form2.submit();
});
})();