Santhosh has uploaded a new change for review.

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


Change subject: Provide disable input tools option in IME menu
......................................................................

Provide disable input tools option in IME menu

Bug: 48533
Change-Id: Ie856cbda344ae2624567fb6c2d6206996c3b10dc
---
M i18n/en.json
M resources/css/ext.uls.inputsettings.css
A resources/images/remove-input.png
A resources/images/remove-input.svg
M resources/js/ext.uls.ime.js
5 files changed, 79 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/70/64270/1

diff --git a/i18n/en.json b/i18n/en.json
index 7eca407..5fd47af 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -39,7 +39,6 @@
 "ext-uls-disable-input-method": "Disable input method",
 "ext-uls-disable-input-method-desc": "Use a regular keyboard",
 "ext-uls-input-settings-more-languages-tooltip": "More languages",
-"ext-uls-input-more-settings" : "More settings",
 "jquery-ime-other-languages": "Other languages",
 "jquery-ime-disable-text": "Disable input method",
 "jquery-ime-help": "Help",
diff --git a/resources/css/ext.uls.inputsettings.css 
b/resources/css/ext.uls.inputsettings.css
index b8c7b56..2650ec9 100644
--- a/resources/css/ext.uls.inputsettings.css
+++ b/resources/css/ext.uls.inputsettings.css
@@ -31,22 +31,39 @@
        background-color: #5089e8;
 }
 
-.uls-ime-more-settings-link {
-       /* @embed */
-       background: transparent url('../images/cog-16x16-ltr.png') right center 
no-repeat;
-       background-image: -webkit-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
-       background-image: -moz-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
-       background-image: linear-gradient(transparent, transparent), 
url('../images/cog.svg');
-       background-size: 20px auto;
+.uls-ime-menu-settings-item {
        background-color: #f0f0f0;
        border-radius: 0 0 5px 5px;
        border-top: 1px solid #ddd;
        margin-top: 6px;
-       padding: 2px 0 2px 0;
+       padding: 2px;
        color: #444;
 }
 
-.uls-ime-more-settings-link > a:hover {
+.uls-ime-disable-link {
+       /* @embed */
+       background: transparent url('../images/remove-input.png') left top 
no-repeat;
+       background-image: -webkit-linear-gradient(transparent, transparent), 
url('../images/remove-input.svg');
+       background-image: -moz-linear-gradient(transparent, transparent), 
url('../images/remove-input.svg');
+       background-image: linear-gradient(transparent, transparent), 
url('../images/remove-input.svg');
+       background-size: 16px auto;
+       padding-left: 25px;
+       padding-bottom: 10px;
+}
+
+.uls-ime-more-settings-link {
+       /* @embed */
+       background: transparent url('../images/cog-16x16-ltr.png') right top 
no-repeat;
+       background-image: -webkit-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
+       background-image: -moz-linear-gradient(transparent, transparent), 
url('../images/cog.svg');
+       background-image: linear-gradient(transparent, transparent), 
url('../images/cog.svg');
+       background-size: 20px auto;
+       width: 25px;
+       height:25px;
+       float:right;
+}
+
+.uls-ime-menu-settings-item > a:hover {
        background-color: #f0f0f0;
        color: #000;
 }
@@ -87,4 +104,4 @@
        margin: 12px 0;
        padding: 6px 10px;
        background: #f0f0f0;
-}
\ No newline at end of file
+}
diff --git a/resources/images/remove-input.png 
b/resources/images/remove-input.png
new file mode 100644
index 0000000..acd5938
--- /dev/null
+++ b/resources/images/remove-input.png
Binary files differ
diff --git a/resources/images/remove-input.svg 
b/resources/images/remove-input.svg
new file mode 100644
index 0000000..51e0377
--- /dev/null
+++ b/resources/images/remove-input.svg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   version="1.1"
+   width="16"
+   height="16"
+   viewBox="0 0 16 16"
+   id="Layer_1"
+   xml:space="preserve"><metadata
+   id="metadata7"><rdf:RDF><cc:Work
+       rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+         rdf:resource="http://purl.org/dc/dcmitype/StillImage"; 
/><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+   id="defs5" />
+<path
+   d="m 7.203125,1.1525567 c 0,0 -0.046035,0.114102 -0.1093749,0.2499992 
-0.059486,0.1276119 -0.1717269,0.2591933 -0.1718747,0.265625 -0.037299,0.00282 
-0.1874024,0.05322 -0.3906245,0.062496 -0.2709628,0.012376 -0.6260083,0.00217 
-1,-0.015626 C 4.7832665,1.6794299 3.98593,1.6080902 3.4531254,1.6994242 l 
-0.01562,0 C 3.1154955,1.7593744 2.8866516,1.9736797 2.7187552,2.1994235 
2.5483819,2.4284977 2.4250607,2.6882242 2.3437554,2.9337986 2.2193799,3.3094622 
2.1742776,3.5984323 2.1562548,3.7462995 L 2.3174402e-8,3.7463069 l 0,9.1875011 
L 16,12.933808 l 0,-9.1875011 -13.0781245,0 C 2.9464624,3.5970644 
2.9849,3.4025744 3.0624997,3.1681815 3.1280083,2.9703168 3.2154622,2.7674032 
3.3125,2.6369314 3.409539,2.5064597 3.5033583,2.4493023 3.5937508,2.4338065 c 
0.3061346,-0.052483 1.1285161,-0.00498 1.890625,0.031254 0.3810539,0.018142 
0.7588323,0.030213 1.0781244,0.015627 0.3192921,-0.014586 0.575556,0.00206 
0.8437511,-0.2187497 C 7.6157286,2.089427 7.6855051,1.902578 
7.7656253,1.7306875 7.8457479,1.5587968 7.9062507,1.4025624 7.9062507,1.4025624 
L 7.203125,1.1525632 z m -5.6874998,4.6874997 1.2343744,0 c 0.077057,0 
0.1406254,0.047943 0.1406254,0.1250001 l 0,1.2500013 c 0,0.077045 
-0.06357,0.1406242 -0.1406254,0.1406242 l -1.2343744,0 c -0.077057,0 
-0.1406254,-0.06357 -0.1406254,-0.1406242 l 0,-1.2500013 c 0,-0.077051 
0.06357,-0.1250001 0.1406254,-0.1250001 z m 2.2656249,0 1.2343756,0 c 
0.077057,0 0.1406254,0.047943 0.1406254,0.1250001 l 0,1.2500013 c 0,0.077045 
-0.06357,0.1406242 -0.1406254,0.1406242 l -1.2343756,0 c -0.077057,0 
-0.1406242,-0.06357 -0.1406242,-0.1406242 l 0,-1.2500013 c 0,-0.077051 
0.06357,-0.1250001 0.1406242,-0.1250001 z m 2.2656249,0 1.2343756,0 c 
0.077057,0 0.1406254,0.047943 0.1406254,0.1250001 l 0,1.2500013 c 0,0.077045 
-0.06357,0.1406242 -0.1406254,0.1406242 l -1.2343756,0 c -0.077057,0 
-0.1406242,-0.06357 -0.1406242,-0.1406242 l 0,-1.2500013 c 0,-0.077051 
0.06357,-0.1250001 0.1406242,-0.1250001 z m 2.265626,0 1.2343744,0 c 0.077057,0 
0.1406256,0.047943 0.1406256,0.1250001 l 0,1.2500013 c 0,0.077045 
-0.06357,0.1406242 -0.1406256,0.1406242 l -1.2343744,0 c -0.077057,0 
-0.1406254,-0.06357 -0.1406254,-0.1406242 l 0,-1.2500013 c 0,-0.077051 
0.06357,-0.1250001 0.1406254,-0.1250001 z m 2.265625,0 1.234376,0 c 0.07704,0 
0.140624,0.047943 0.140624,0.1250001 l 0,1.2500013 c 0,0.077045 
-0.06357,0.1406242 -0.140624,0.1406242 l -1.234376,0 c -0.07706,0 
-0.140625,-0.06357 -0.140625,-0.1406242 l 0,-1.2500013 c 0,-0.077051 
0.06357,-0.1250001 0.140625,-0.1250001 z m 2.265624,0 1.234375,0 c 0.07705,0 
0.140624,0.047943 0.140624,0.1250001 l 0,1.2500013 c 0,0.077045 
-0.06357,0.1406242 -0.140624,0.1406242 l -1.234375,0 c -0.07705,0 
-0.140626,-0.06357 -0.140626,-0.1406242 l 0,-1.2500013 c 0,-0.077051 
0.06357,-0.1250001 0.140626,-0.1250001 z m -10.265625,2.4062507 1.2343756,0 c 
0.077057,0 0.1406242,0.06357 0.1406242,0.1406254 l 0,1.234374 c 0,0.077045 
-0.06357,0.1406254 -0.1406242,0.1406254 l -1.2343756,0 c -0.077057,0 
-0.1406254,-0.06357 -0.1406254,-0.1406254 l 0,-1.234374 c 0,-0.077045 
0.06357,-0.1406254 0.1406254,-0.1406254 z m 2.3281258,0 1.2343744,0 c 
0.077057,0 0.1406254,0.06357 0.1406254,0.1406254 l 0,1.234374 c 0,0.077045 
-0.06357,0.1406254 -0.1406254,0.1406254 l -1.2343744,0 c -0.077057,0 
-0.1406254,-0.06357 -0.1406254,-0.1406254 l 0,-1.234374 c 0,-0.077045 
0.06357,-0.1406254 0.1406254,-0.1406254 z m 2.3281246,0 1.2500003,0 c 
0.077057,0 0.1406254,0.06357 0.1406254,0.1406254 l 0,1.234374 c 0,0.077045 
-0.06357,0.1406254 -0.1406254,0.1406254 l -1.2500003,0 c -0.077057,0 
-0.1406253,-0.06357 -0.1406253,-0.1406254 l 0,-1.234374 c 0,-0.077045 
0.06357,-0.1406254 0.1406253,-0.1406254 z m 2.3437505,0 1.2343741,0 c 0.07706,0 
0.140626,0.06357 0.140626,0.1406254 l 0,1.234374 c 0,0.077045 
-0.06357,0.1406254 -0.140626,0.1406254 l -1.2343741,0 c -0.077057,0 
-0.1406254,-0.06357 -0.1406254,-0.1406254 l 0,-1.234374 c 0,-0.077045 
0.06357,-0.1406254 0.1406254,-0.1406254 z m 2.3281251,0 1.234374,0 c 0.07705,0 
0.140626,0.06357 0.140626,0.1406254 l 0,1.234374 c 0,0.077045 
-0.06357,0.1406254 -0.140626,0.1406254 l -1.234374,0 c -0.07705,0 
-0.140626,-0.06357 -0.140626,-0.1406254 l 0,-1.234374 c 0,-0.077045 
0.06357,-0.1406254 0.140626,-0.1406254 z m -8.7031259,2.8437499 9.5937509,0 c 
0.07704,0 0.124999,0.06357 0.124999,0.140625 l 0,0.640625 c 0,0.07706 
-0.04794,0.140625 -0.124999,0.140625 l -9.5937509,0 c -0.077057,0 
-0.1249996,-0.06357 -0.1249996,-0.140625 l 0,-0.640625 c 0,-0.07705 
0.04795,-0.140625 0.1249996,-0.140625 z"
+   id="path4443"
+   
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#565656;fill-opacity:1;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
 /><rect
+   width="1.211776"
+   height="20.600193"
+   x="10.911682"
+   y="-10.096233"
+   transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)"
+   id="rect2982-0-9"
+   style="fill:#565656;fill-opacity:1;stroke:none" /></svg>
\ No newline at end of file
diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js
index 715798f..81117f4 100644
--- a/resources/js/ext.uls.ime.js
+++ b/resources/js/ext.uls.ime.js
@@ -104,13 +104,16 @@
 
        // Add a 'more setttings' link that takes to input settings of ULS
        $.fn.imeselector.Constructor.prototype.helpLink = function () {
-               var $moreSettingsLink, imeselector;
+               var $disableInputToolsLink, $moreSettingsLink, imeselector;
 
                imeselector = this;
 
-               $moreSettingsLink = $( '<a>' ).text( 'More settings' )
-                       .addClass( 'uls-ime-more-settings-link' )
-                       .attr( 'data-i18n', 'ext-uls-input-more-settings' );
+               $disableInputToolsLink = $( '<span>' )
+                       .addClass( 'uls-ime-disable-link' )
+                       .attr( 'data-i18n', 'ext-uls-input-disable' );
+
+               $moreSettingsLink = $( '<span>' )
+                       .addClass( 'uls-ime-more-settings-link' );
 
                $moreSettingsLink.languagesettings( {
                        defaultModule: 'input',
@@ -127,9 +130,21 @@
                        e.stopPropagation();
                } );
 
-               $moreSettingsLink.i18n();
+               $disableInputToolsLink.i18n();
 
-               return $moreSettingsLink;
+               $disableInputToolsLink.on( 'click', function (e) {
+                       $.ime.preferences.disable();
+                       imeselector.hide();
+                       imeselector.$menu.removeClass( 'open' );
+                       $.ime.preferences.save( function () {
+                               mw.ime.disable();
+                       } );
+                       e.stopPropagation();
+               } );
+
+               return $( '<div>' )
+                       .addClass( 'uls-ime-menu-settings-item' )
+                       .append( $disableInputToolsLink, $moreSettingsLink );
        };
 
        mw.ime.disable = function () {
@@ -139,8 +154,7 @@
        mw.ime.setup = function () {
 
                $( 'body' ).on( 'focus.ime', inputSelector, function () {
-                       var imeselector,
-                               $input = $( this );
+                       var $input = $( this );
 
                        $input.ime( {
                                languages: mw.ime.getIMELanguageList(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie856cbda344ae2624567fb6c2d6206996c3b10dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

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

Reply via email to