Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/202764

Change subject: Add javascript confirmation to Special:GlobalRenameQueue
......................................................................

Add javascript confirmation to Special:GlobalRenameQueue

Implement a similar confirmation step that Special:GlobalRenameUser has
when approving or rejecting a request to prevent accidental clicks of
the wrong button.

Bug: T95428
Change-Id: I6c7d65a75c7ee4991c73555a55c91b458a247e42
---
M i18n/en.json
M i18n/qqq.json
M includes/CentralAuthHooks.php
M includes/specials/SpecialGlobalRenameQueue.php
A modules/ext.centralauth.globalrenamequeue.js
5 files changed, 27 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/64/202764/1

diff --git a/i18n/en.json b/i18n/en.json
index 54af761..50b4d18 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -393,6 +393,7 @@
        "centralauth-rename-progress-logs-fieldset": "Log entries",
        "centralauth-rename-movelog" : "Automatically moved page while renaming 
the user \"[[Special:CentralAuth/$1|$1]]\" to 
\"[[Special:CentralAuth/$2|$2]]\"",
        "centralauth-rename-confirm" : "Do you really want to globally rename 
this user?",
+       "centralauth-rename-deny": "Do you really want to deny this request?",
        "log-name-gblrename": "Global rename log",
        "log-description-gblrename": "This log tracks the global renaming of 
users.",
        "logentry-gblrename-rename" : "$1 globally {{GENDER:$2|renamed}} $4 to 
$5",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ffc6e86..2cf8efe 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -406,6 +406,7 @@
        "centralauth-rename-progress-logs-fieldset": "Text on fieldset around 
log entries",
        "centralauth-rename-movelog": "Move log comment used when automatically 
moving user pages\n\n* $1 is the user's old name\n* $2 is the user's new name",
        "centralauth-rename-confirm": "Confirmation text asking whether the 
global account should really be renamed.\n\nSee also:\n* 
{{msg-mw|Centralauth-usermerge-confirm}}",
+       "centralauth-rename-deny": "Confirm text asking whether the global 
rename request should really be denied.",
        "log-name-gblrename": "Log page title",
        "log-description-gblrename": "Log page description",
        "logentry-gblrename-rename": "{{Logentry}}\nAdditional parameters:\n* 
$4 - old username\n* $5 - new username\nSee also:\n* 
{{msg-mw|Logentry-gblrename-merge}}",
diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index 9acb208..f82ed19 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -82,6 +82,15 @@
                        $wgSpecialPages['GlobalRenameQueue'] = 
'SpecialGlobalRenameQueue';
                        $wgSpecialPageGroups['GlobalRenameQueue'] = 'users';
                        $wgResourceModules['ext.centralauth.globalrenamequeue'] 
= array(
+                               'scripts'        => 
'ext.centralauth.globalrenamequeue.js',
+                               'localBasePath' => "{$caBase}/modules",
+                               'remoteExtPath' => 'CentralAuth/modules',
+                               'messages' => array(
+                                       'centralauth-rename-confirm',
+                                       'centralauth-rename-deny'
+                               )
+                       );
+                       
$wgResourceModules['ext.centralauth.globalrenamequeue.styles'] = array(
                                'styles'        => 
'ext.centralauth.globalrenamequeue.less',
                                'localBasePath' => "{$caBase}/modules",
                                'remoteExtPath' => 'CentralAuth/modules',
diff --git a/includes/specials/SpecialGlobalRenameQueue.php 
b/includes/specials/SpecialGlobalRenameQueue.php
index a249aa4..4e4f768 100644
--- a/includes/specials/SpecialGlobalRenameQueue.php
+++ b/includes/specials/SpecialGlobalRenameQueue.php
@@ -339,8 +339,9 @@
                        'mediawiki.ui',
                        'mediawiki.ui.button',
                        'mediawiki.ui.input',
-                       'ext.centralauth.globalrenamequeue',
+                       'ext.centralauth.globalrenamequeue.styles',
                ) );
+               $out->addModules( 'ext.centralauth.globalrenamequeue' );
 
                $status = $form->show();
                if ( $status instanceof Status && $status->isOk() ) {
diff --git a/modules/ext.centralauth.globalrenamequeue.js 
b/modules/ext.centralauth.globalrenamequeue.js
new file mode 100644
index 0000000..f55d526
--- /dev/null
+++ b/modules/ext.centralauth.globalrenamequeue.js
@@ -0,0 +1,14 @@
+( function ( mw, $ ) {
+       'use strict';
+       $( function () {
+               /*global confirm */
+
+               // Confirm renames
+               $( '#mw-renamequeue-approve' ).click( function() {
+                       return confirm( mw.msg( 'centralauth-rename-confirm' ) 
);
+               } );
+               $( '#mw-renamequeue-deny' ).click( function() {
+                       return confirm( mw.msg( 'centralauth-rename-deny' ) );
+               } );
+       } );
+}( mediaWiki, jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/202764
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c7d65a75c7ee4991c73555a55c91b458a247e42
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to