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

Change subject: Visual indication while saving the settings
......................................................................


Visual indication while saving the settings

* Button label change to "applying changes"
* Button become disabled
* Cursor changes to "progress"

Bug: 53772
Change-Id: I1de459590ea9b357965a73f274d566eba8c04482
---
M i18n/en.json
M i18n/qqq.json
M resources/css/ext.uls.languagesettings.css
M resources/js/ext.uls.displaysettings.js
M resources/js/ext.uls.inputsettings.js
M resources/js/ext.uls.languagesettings.js
6 files changed, 33 insertions(+), 1 deletion(-)

Approvals:
  Amire80: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 03046e4..61a7b81 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -47,5 +47,6 @@
 "ext-uls-input-disable-notification-undo": "Undo",
 "ext-uls-input-disable-notification-info-personal": "You can enable the input 
tools at any time from the language settings.",
 "ext-uls-input-disable-notification-info-interlanguage": "You can enable the 
input tools at any time from the language settings next to the language list.",
+"ext-uls-language-settings-applying": "Applying...",
 "ext-uls-language-settings-preferences-link": "More language settings"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1267663..80e1b6e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -48,5 +48,6 @@
     "ext-uls-input-disable-notification-undo": "Undo link text in the input 
method disable notification bubble",
     "ext-uls-input-disable-notification-info-personal": "Notification bubble 
text when input methods are disabled, appears if the ULS is at personal 
toolbar",
     "ext-uls-input-disable-notification-info-interlanguage": "Notification 
bubble text when input methods are disabled, appears if the ULS is at 
interlanguage toolbar",
+    "ext-uls-language-settings-applying": "Label for apply settings button in 
language settings screen, while settings being saved. Please keep it short.",
     "ext-uls-language-settings-preferences-link": "Text for the link showin in 
user preference screen"
-}
\ No newline at end of file
+}
diff --git a/resources/css/ext.uls.languagesettings.css 
b/resources/css/ext.uls.languagesettings.css
index b7a1b94..7ec8deb 100644
--- a/resources/css/ext.uls.languagesettings.css
+++ b/resources/css/ext.uls.languagesettings.css
@@ -120,3 +120,7 @@
 label.checkbox input[type="checkbox"] {
        float: left;
 }
+
+.waiting {
+       cursor: progress;
+}
\ No newline at end of file
diff --git a/resources/js/ext.uls.displaysettings.js 
b/resources/js/ext.uls.displaysettings.js
index 8045063..07f1529 100644
--- a/resources/js/ext.uls.displaysettings.js
+++ b/resources/js/ext.uls.displaysettings.js
@@ -573,6 +573,7 @@
                                return;
                        }
 
+                       displaySettings.$parent.setBusy( true );
                        // Save the preferences
                        mw.webfonts.preferences.save( function ( result ) {
                                var newFonts = 
mw.webfonts.preferences.registry.fonts || {},
@@ -595,6 +596,7 @@
                                displaySettings.dirty = false;
                                // Update the back-up preferences for the case 
of canceling
                                displaySettings.savedRegistry = $.extend( true, 
{}, mw.webfonts.preferences );
+                               displaySettings.$parent.setBusy( false );
                        } );
                },
 
diff --git a/resources/js/ext.uls.inputsettings.js 
b/resources/js/ext.uls.inputsettings.js
index a3f79c4..11e592f 100644
--- a/resources/js/ext.uls.inputsettings.js
+++ b/resources/js/ext.uls.inputsettings.js
@@ -507,6 +507,7 @@
                                // No changes to save in this module.
                                return;
                        }
+                       inputSettings.$parent.setBusy( true );
 
                        if ( previousLanguage ) {
                                previousIM = 
inputSettings.savedRegistry.imes[previousLanguage];
@@ -530,6 +531,7 @@
                                inputSettings.dirty = false;
                                // Update the back-up preferences for the case 
of canceling
                                inputSettings.savedRegistry = $.extend( true, 
{}, $.ime.preferences.registry );
+                               inputSettings.$parent.setBusy( false );
                        } );
                },
 
diff --git a/resources/js/ext.uls.languagesettings.js 
b/resources/js/ext.uls.languagesettings.js
index 8b75c36..01fa1b6 100644
--- a/resources/js/ext.uls.languagesettings.js
+++ b/resources/js/ext.uls.languagesettings.js
@@ -235,6 +235,28 @@
                },
 
                /**
+                * Put the language settings panel in busy mode.
+                * Busy mode means displaying a progress cursor,
+                * and showing the 'apply' button as disabled and with
+                * a different label.
+                * @param {boolean} busy set true to put the panel in busy mode,
+                *     false to unset the busy mode.
+                */
+               setBusy: function ( busy ) {
+                       var $applyButton = this.$window.find( 
'button.uls-settings-apply' );
+
+                       if ( busy ) {
+                               this.$window.addClass( 'waiting' );
+                               $applyButton
+                                       .text( $.i18n( 
'ext-uls-language-settings-applying' ) )
+                                       .prop( 'disabled', true );
+                       } else {
+                               this.$window.removeClass( 'waiting' );
+                               $applyButton.text( $.i18n( 
'ext-uls-language-settings-apply' ) );
+                       }
+               },
+
+               /**
                 * Close this language settings window, and
                 * call onClose if defined from the previous context.
                 */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1de459590ea9b357965a73f274d566eba8c04482
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to