diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index 75e52521..930ea2ca 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -165,6 +165,8 @@ class UniversalLanguageSelectorHooks { global $wgULSGeoService; $vars['wgULSGeoService'] = $wgULSGeoService; + $vars['wgULSIMEEnabled']= wgULSIMEEnabled; + // ULS is localized using jquery.i18n library. Unless it knows // the localized locales, it can create 404 response. To avoid that, // send the locales available at server. Also avoid directory scanning diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php index 5a4cd143..223149d1 100644 --- a/UniversalLanguageSelector.php +++ b/UniversalLanguageSelector.php @@ -56,6 +56,11 @@ $wgExtensionCredits['other'][] = array( */ $wgULSGeoService = 'http://freegeoip.net/json/'; +/** + * IME system of ULS can be disabled by setting this value false; + */ +$wgULSIMEEnabled = true; + /** * Try to use preferred interface language for anonymous users. * Do not use if you are caching anonymous page views without diff --git a/i18n/en.json b/i18n/en.json index 5ad51053..455d301f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -33,5 +33,10 @@ "ext-uls-input-more-settings" : "More settings", "jquery-ime-other-languages": "Other languages", "jquery-ime-disable-text": "Disable input method", -"jquery-ime-help": "Help" +"jquery-ime-help": "Help", +"ext-uls-input-disable": "Disable input method tools", +"ext-uls-input-enable": "Enable input method tools", +"ext-uls-input-disable-info": "Input method tools are disabled.", +"ext-uls-input-enable-info": "Input method tools are enabled." } + diff --git a/i18n/ml.json b/i18n/ml.json index bc0a7040..6df265c7 100644 --- a/i18n/ml.json +++ b/i18n/ml.json @@ -31,5 +31,6 @@ "ext-uls-input-settings-more-languages-tooltip": "\u0d15\u0d42\u0d1f\u0d41\u0d24\u0d7d \u0d2d\u0d3e\u0d37\u0d15\u0d7e", "ext-uls-input-more-settings": "\u0d15\u0d42\u0d1f\u0d41\u0d24\u0d7d \u0d15\u0d4d\u0d30\u0d2e\u0d40\u0d15\u0d30\u0d23\u0d19\u0d4d\u0d19\u0d7e", "jquery-ime-other-languages": "\u0d2e\u0d31\u0d4d\u0d31\u0d41 \u0d2d\u0d3e\u0d37\u0d15\u0d7e", - "jquery-ime-disable-text": "\u0d0e\u0d34\u0d41\u0d24\u0d4d\u0d24\u0d41\u0d2a\u0d15\u0d30\u0d23\u0d02 \u0d35\u0d47\u0d23\u0d4d\u0d1f\u0d46\u0d28\u0d4d\u0d28\u0d41\u0d35\u0d46\u0d2f\u0d4d\u0d15\u0d4d\u0d15\u0d41\u0d15" + "jquery-ime-disable-text": "\u0d0e\u0d34\u0d41\u0d24\u0d4d\u0d24\u0d41\u0d2a\u0d15\u0d30\u0d23\u0d02 \u0d35\u0d47\u0d23\u0d4d\u0d1f\u0d46\u0d28\u0d4d\u0d28\u0d41\u0d35\u0d46\u0d2f\u0d4d\u0d15\u0d4d\u0d15\u0d41\u0d15", + "ext-uls-input-disable": "എഴുത്തുപകരണം വേണ്ട" } \ No newline at end of file diff --git a/i18n/qqq.json b/i18n/qqq.json index 1409630d..db729b68 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -34,5 +34,9 @@ "ext-uls-input-more-settings": "Menu item lable displayed in the input method selector menu", "jquery-ime-other-languages": "Title text used for language list in the input method selector menu", "jquery-ime-disable-text": "Label used for disabling input method from input method selector menu", - "jquery-ime-help": "Text for help link" + "jquery-ime-help": "Text for help link", + "ext-uls-input-disable": "Label for disable input tools button", + "ext-uls-input-enable": "Label for enable input tools button", + "ext-uls-input-disable-info": "Info text for disable input tools button", + "ext-uls-input-enable-info": "Info text for disable input tools button" } \ No newline at end of file diff --git a/resources/css/ext.uls.css b/resources/css/ext.uls.css index 1c4746cc..b7d8531a 100644 --- a/resources/css/ext.uls.css +++ b/resources/css/ext.uls.css @@ -114,4 +114,71 @@ button.button.blue.disabled:hover { color: white; cursor: default; text-shadow: none; +} + +button.button.green { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #008740; + background-image: -ms-linear-gradient(top, #00974b, #008740); + background-image: -moz-linear-gradient(top, #00974b, #008740); + background-image: linear-gradient(#00974b, #008740); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #00974b), + color-stop(100%, #008740) ); + background-image: -webkit-linear-gradient(top, #00974b, #008740); + border: 1px #0f9b3b solid; + -ms-filter: + "progid:DXImageTransform.Microsoft.gradient(startColorstr='#00974b', endColorstr='#008740', GradientType=0)"; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#00974b', + endColorstr='#008740', GradientType=0 ); +} + +button.button.green:hover { + background-color: #119750; + background-image: -moz-linear-gradient(top, #10a65b, #119750); + background-image: -ms-linear-gradient(top, #10a65b, #119750); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #10a65b), + color-stop(100%, #119750) ); + background-image: -webkit-linear-gradient(top, #10a65b, #119750); + background-image: linear-gradient(#10a65b, #119750); + -ms-filter: + "progid:DXImageTransform.Microsoft.gradient(startColorstr='#10a65b', endColorstr='#119750', GradientType=0)"; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#10a65b', + endColorstr='#119750', GradientType=0 ); +} + +button.button.green:active { + background-color: #007236; + background-image: -moz-linear-gradient(top, #007236, #007236); + background-image: -ms-linear-gradient(top, #007236, #007236); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #007236), + color-stop(100%, #007236) ); + background-image: -webkit-linear-gradient(top, #007236, #007236); + background-image: linear-gradient(#007236, #007236); + -ms-filter: + "progid:DXImageTransform.Microsoft.gradient(startColorstr='#007236', endColorstr='#007236', GradientType=0)"; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#007236', + endColorstr='#007236', GradientType=0 ); +} + +button.button.green:disabled, +button.button.green:disabled.hover, +button.button.green.disabled, +button.button.green.disabled:hover + { + color: white; + text-shadow: none; + cursor: default; + background-color: #2ca368; + background-image: -moz-linear-gradient(top, #2ca368, #2ca368); + background-image: -ms-linear-gradient(top, #2ca368, #2ca368); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #2ca368), + color-stop(100%, #2ca368) ); + background-image: -webkit-linear-gradient(top, #2ca368, #2ca368); + background-image: linear-gradient(#2ca368, #2ca368); + border-color: #278f5b; + -ms-filter: + "progid:DXImageTransform.Microsoft.gradient(startColorstr='#2ca368', endColorstr='#2ca368', GradientType=0)"; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#2ca368', + endColorstr='#2ca368', GradientType=0 ); } \ No newline at end of file diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index 1c4ca0ac..5ace5863 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -111,7 +111,7 @@ this.prepareUIFonts(); this.prepareContentFonts(); this.prepareWebfontsCheckbox(); - + this.$template.i18n(); this.listen(); }, diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js index dae4759e..6d52f910 100644 --- a/resources/js/ext.uls.ime.js +++ b/resources/js/ext.uls.ime.js @@ -67,7 +67,29 @@ load: function () { this.registry = inputPreferences.get( 'ime' ) || this.registry; + }, + + disable: function () { + this.registry['enable'] = false; + }, + + enable: function () { + this.registry['enable'] = true; + }, + + isEnabled: function () { + + if ( this.registry['enable'] === false ){ + return false; + } + + if ( mw.config.get( 'wgULSIMEEnabled' ) === false ){ + return false; + } + + return true; } + } ); // MediaWiki specific overrides for jquery.ime @@ -105,9 +127,13 @@ return $moreSettingsLink; }; - $( document ).ready( function () { + mw.ime.disable = function () { + $( inputSelector ).unbind( '.ime' ); + }; - $( 'body' ).on( 'focus', inputSelector, function () { + mw.ime.setup = function () { + + $( 'body' ).on( 'focus.ime', inputSelector, function () { var $input = $( this ); $input.ime( { @@ -135,8 +161,17 @@ } ); } ); + }; + + $( document ).ready( function () { + // Load the ime preferences $.ime.preferences.load(); + + if ( $.ime.preferences.isEnabled() ) { + mw.ime.setup(); + } + } ); diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index b667fcc6..b604619d 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -47,6 +47,14 @@ + '' + '' + // Disable IME system button + + '