jenkins-bot has submitted this change and it was merged.

Change subject: Improve special page UI a little
......................................................................


Improve special page UI a little

Added "Delete selected" buttons both above and below the table - only
become visible once the table is displayed. Also added "select all" and
"select none".

Change-Id: I4b418c0f7d62ddeba3f3b931d80bd3300a128440
---
M SmiteSpam.php
M SpecialSmiteSpam.php
M i18n/en.json
M i18n/qqq.json
M static/js/ext.smitespam.retriever.js
5 files changed, 35 insertions(+), 3 deletions(-)

Approvals:
  jan: Looks good to me, but someone else must approve
  Polybuildr: Looks good to me, approved
  Yaron Koren: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/SmiteSpam.php b/SmiteSpam.php
index b47b430..289ff15 100644
--- a/SmiteSpam.php
+++ b/SmiteSpam.php
@@ -45,6 +45,9 @@
                'smitespam-delete-page-success-msg',
                'smitespam-delete-page-failure-msg',
                'smitespam-deleted-reason',
+               'powersearch-toggleall',
+               'powersearch-togglenone',
+               'smitespam-select',
        ),
 );
 
diff --git a/SpecialSmiteSpam.php b/SpecialSmiteSpam.php
index 9793fcc..1433f95 100644
--- a/SpecialSmiteSpam.php
+++ b/SpecialSmiteSpam.php
@@ -54,6 +54,11 @@
                                )
                        )
                );
+
+               $out->addHTML( '<div id="smitespam-select-options"></div>' );
+
+               $out->addHTML( '<input type="submit" value="'
+                       . $this->msg( 'smitespam-delete-selected' ) . '" 
style="display:none;">' );
                $out->addHTML( Html::openElement( 'table', array(
                        'class' => 'wikitable',
                        'id' => 'smitespam-page-list',
@@ -61,7 +66,7 @@
 
                $out->addHTML( Html::closeElement( 'table' ) );
                $out->addHTML( '<input type="submit" value="'
-                       . $this->msg( 'smitespam-delete-selected' ) . '">' );
+                       . $this->msg( 'smitespam-delete-selected' ) . '" 
style="display:none;">' );
                $out->addHTML( Html::closeElement( 'form' ) );
 
                $out->addModules( 'ext.SmiteSpam.retriever' );
diff --git a/i18n/en.json b/i18n/en.json
index 30013bf..41cac73 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -20,5 +20,6 @@
        "smitespam-probability-low": "Low",
        "smitespam-probability-medium": "Medium",
        "smitespam-probability-high": "High",
-       "smitespam-probability-very-high": "Very high"
+       "smitespam-probability-very-high": "Very high",
+       "smitespam-select": "Select: "
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index abf249a..b17e47f 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -22,5 +22,6 @@
        "smitespam-probability-low": "Low probability\n{{Identical|Low}}",
        "smitespam-probability-medium": "Medium 
probability\n{{Identical|Medium}}",
        "smitespam-probability-high": "High probability\n{{Identical|High}}",
-       "smitespam-probability-very-high": "Very high probability"
+       "smitespam-probability-very-high": "Very high probability",
+       "smitespam-select": "Followed by two links: 
{{msg-mw|Powersearch-toggleall}} and {{msg-mw|Powersearch-togglenone}} which 
respectively selects all pages and de-selects all pages\n{{Identical|Select}}"
 }
diff --git a/static/js/ext.smitespam.retriever.js 
b/static/js/ext.smitespam.retriever.js
index 4b1d808..63116a8 100644
--- a/static/js/ext.smitespam.retriever.js
+++ b/static/js/ext.smitespam.retriever.js
@@ -127,6 +127,28 @@
                        $( '#displayed-page-number' ).text( 
resultPageToDisplay.getValue() + 1 );
                },
                displayResults: function () {
+                       $( '#smitespam-delete-pages input[type="submit"]' 
).show();
+                       var $selectAll = $( '<a>' )
+                               .attr( 'href', '#' )
+                               .text( mw.msg( 'powersearch-toggleall' ) )
+                               .on( 'click', function () {
+                                       $( '#smitespam-page-list 
input[type="checkbox"]' ).each( function () {
+                                               $( this ).prop( 'checked', true 
).triggerHandler( 'change' );
+                                       } );
+                               } );
+                       var $selectNone = $( '<a>' )
+                               .attr( 'href', '#' )
+                               .text( mw.msg( 'powersearch-togglenone' ) )
+                               .on( 'click', function () {
+                                       $( '#smitespam-page-list 
input[type="checkbox"]' ).each( function () {
+                                               $( this ).prop( 'checked', 
false ).triggerHandler( 'change' );
+                                       } );
+                               } );
+                       $( '#smitespam-select-options' ).empty();
+                       $( '#smitespam-select-options' ).append( mw.msg( 
'smitespam-select' ) );
+                       $( '#smitespam-select-options' ).append( $selectAll );
+                       $( '#smitespam-select-options' ).append( ', ' );
+                       $( '#smitespam-select-options' ).append( $selectNone );
                        $( '#smitespam-page-list' ).empty();
                        function checkboxChanged() {
                                var id = $( this ).val();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b418c0f7d62ddeba3f3b931d80bd3300a128440
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SmiteSpam
Gerrit-Branch: master
Gerrit-Owner: Polybuildr <v.a.ghai...@gmail.com>
Gerrit-Reviewer: Polybuildr <v.a.ghai...@gmail.com>
Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: jan <j...@jans-seite.de>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to