mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-24 08:14:18 +00:00
Ask for confirmation when nuking
Bug: T131975 Change-Id: I908c1aacdc8069ea9ae1ec860eef5421d9da2fab
This commit is contained in:
parent
50d948448e
commit
8bf771fc40
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"predef": [
|
"predef": [
|
||||||
"jQuery"
|
"jQuery",
|
||||||
|
"mediaWiki"
|
||||||
],
|
],
|
||||||
/* Common */
|
/* Common */
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,8 @@ class SpecialNuke extends SpecialPage {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$out->addModules( 'ext.nuke.confirm' );
|
||||||
|
|
||||||
if ( $username === '' ) {
|
if ( $username === '' ) {
|
||||||
$out->addWikiMsg( 'nuke-list-multiple' );
|
$out->addWikiMsg( 'nuke-list-multiple' );
|
||||||
} else {
|
} else {
|
||||||
|
|
14
ext.nuke.confirm.js
Normal file
14
ext.nuke.confirm.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
( function ( mw, $ ) {
|
||||||
|
$( document ).ready( function () {
|
||||||
|
/*global confirm */
|
||||||
|
|
||||||
|
// Confirm nuke
|
||||||
|
$( 'form[name="nukelist"]' ).on( 'submit', function () {
|
||||||
|
var pages = $( this ).find( 'input[name="pages[]"][type="checkbox"]:checked' );
|
||||||
|
if ( pages.length ) {
|
||||||
|
return confirm( mw.msg( 'nuke-confirm', pages.length ).text() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
} );
|
||||||
|
}( mediaWiki, jQuery ) );
|
|
@ -30,6 +30,14 @@
|
||||||
"scripts": [
|
"scripts": [
|
||||||
"ext.nuke.js"
|
"ext.nuke.js"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"ext.nuke.confirm": {
|
||||||
|
"scripts": [
|
||||||
|
"ext.nuke.confirm.js"
|
||||||
|
],
|
||||||
|
"messages": [
|
||||||
|
"nuke-confirm"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ResourceFileModulePaths": {
|
"ResourceFileModulePaths": {
|
||||||
|
|
|
@ -30,5 +30,6 @@
|
||||||
"nuke-viewchanges": "view changes",
|
"nuke-viewchanges": "view changes",
|
||||||
"nuke-namespace": "Limit to namespace:",
|
"nuke-namespace": "Limit to namespace:",
|
||||||
"nuke-linkoncontribs": "mass delete",
|
"nuke-linkoncontribs": "mass delete",
|
||||||
"nuke-linkoncontribs-text": "Mass delete pages where {{GENDER:$1|this user}} is the only author"
|
"nuke-linkoncontribs-text": "Mass delete pages where {{GENDER:$1|this user}} is the only author",
|
||||||
|
"nuke-confirm": "You are about to delete {{PLURAL:$1|one page|$1 pages}}. Are you sure that you want to delete?"
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,5 +41,6 @@
|
||||||
"nuke-viewchanges": "Used as link text.\n\nThe link points to History page of the page.\n\nThis message follows:\n* {{msg-mw|nuke-editby}} and {{msg-mw|comma-separator}}\n* or empty string (if username is empty).\n{{Identical|View changes}}",
|
"nuke-viewchanges": "Used as link text.\n\nThe link points to History page of the page.\n\nThis message follows:\n* {{msg-mw|nuke-editby}} and {{msg-mw|comma-separator}}\n* or empty string (if username is empty).\n{{Identical|View changes}}",
|
||||||
"nuke-namespace": "Label shown on [[Special:Nuke]] in front of the namespace input that allows choosing a namespace to filter the search by",
|
"nuke-namespace": "Label shown on [[Special:Nuke]] in front of the namespace input that allows choosing a namespace to filter the search by",
|
||||||
"nuke-linkoncontribs": "Used as link text which is used on [[Special:Contributions]] and [[Special:DeletedContributions]].\n\nOnly added if a user has rights to nuke pages.\n\nThe link has the tooltip {{msg-mw|Nuke-linkoncontribs-text}}.\n{{Identical|Mass delete}}",
|
"nuke-linkoncontribs": "Used as link text which is used on [[Special:Contributions]] and [[Special:DeletedContributions]].\n\nOnly added if a user has rights to nuke pages.\n\nThe link has the tooltip {{msg-mw|Nuke-linkoncontribs-text}}.\n{{Identical|Mass delete}}",
|
||||||
"nuke-linkoncontribs-text": "Tooltip for the link which is labeled {{msg-mw|Nuke-linkoncontribs}} Parameters:\n* $1 is the target user name used for GENDER."
|
"nuke-linkoncontribs-text": "Tooltip for the link which is labeled {{msg-mw|Nuke-linkoncontribs}} Parameters:\n* $1 is the target user name used for GENDER.",
|
||||||
|
"nuke-confirm": "Message when the user is trying to delete pages."
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue