diff --git a/i18n/en.json b/i18n/en.json index 7eca407f..5fd47afe 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 b8c7b561..b6b7531d 100644 --- a/resources/css/ext.uls.inputsettings.css +++ b/resources/css/ext.uls.inputsettings.css @@ -31,22 +31,40 @@ div.input-settings-block { 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: 4px 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: auto 16px; + padding-left: 22px; + padding-bottom: 10px; +} + +.uls-ime-more-settings-link { + /* @embed */ + background: transparent url('../images/cog.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: auto 14px; + border-left: 1px solid #CCCCCC; + width: 22px; + height: 14px; + float: right; +} + +.uls-ime-menu-settings-item > a:hover { background-color: #f0f0f0; color: #000; } @@ -87,4 +105,4 @@ div.input-settings-block { margin: 12px 0; padding: 6px 10px; background: #f0f0f0; -} \ No newline at end of file +} diff --git a/resources/images/cog.png b/resources/images/cog.png new file mode 100644 index 00000000..a8ec25f5 Binary files /dev/null and b/resources/images/cog.png differ diff --git a/resources/images/cog.svg b/resources/images/cog.svg index bf8dafce..93791b19 100644 --- a/resources/images/cog.svg +++ b/resources/images/cog.svg @@ -7,12 +7,38 @@ 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" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" - width="42" - height="31.999998" - viewBox="0 0 42 31.999998" + width="20" + height="14" + viewBox="0 0 20 14" id="Layer_1" - xml:space="preserve">image/svg+xml + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none;marker-end:none" + inkscape:connector-curvature="0" /> \ No newline at end of file + style="fill:#434343;fill-opacity:1;stroke:none" + inkscape:connector-curvature="0" /> \ 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 00000000..fa53810d Binary files /dev/null and b/resources/images/remove-input.png differ diff --git a/resources/images/remove-input.svg b/resources/images/remove-input.svg new file mode 100644 index 00000000..72978d26 --- /dev/null +++ b/resources/images/remove-input.svg @@ -0,0 +1,30 @@ + + + +image/svg+xml + \ No newline at end of file diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js index 18410820..ec1cd027 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 = $( '' ).text( 'More settings' ) - .addClass( 'uls-ime-more-settings-link' ) - .attr( 'data-i18n', 'ext-uls-input-more-settings' ); + $disableInputToolsLink = $( '' ) + .addClass( 'uls-ime-disable-link' ) + .attr( 'data-i18n', 'ext-uls-input-disable' ); + + $moreSettingsLink = $( '' ) + .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 $( '
' ) + .addClass( 'uls-ime-menu-settings-item' ) + .append( $disableInputToolsLink, $moreSettingsLink ); }; mw.ime.disable = function () {