diff --git a/resources/css/ext.uls.inputsettings.css b/resources/css/ext.uls.inputsettings.css index 73cb02c7..f7518e9a 100644 --- a/resources/css/ext.uls.inputsettings.css +++ b/resources/css/ext.uls.inputsettings.css @@ -32,4 +32,20 @@ div.input-settings-block { text-decoration: none; color: #ffffff; background-color: #5089e8; -} \ No newline at end of file +} + +.uls-ime-more-settings-link { + /* @embed */ + background: transparent url('../images/cog-16x16-ltr.png') right center no-repeat; + background-color: #f0f0f0; + border-radius: 0 0 5px 5px; + border-top: 1px solid #ddd; + margin-top: 6px; + padding: 2px 0 2px 0; + color: #444; +} + +.uls-ime-more-settings-link > a:hover { + background-color: #f0f0f0; + color: #000; +} diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js index 85157e14..399694d8 100644 --- a/resources/js/ext.uls.ime.js +++ b/resources/js/ext.uls.ime.js @@ -75,6 +75,34 @@ imePath: mwImeRulesPath } ); + // Add a 'more setttings' link that takes to input settings of ULS + $.fn.imeselector.Constructor.prototype.helpLink = function () { + var $moreSettingsLink, imeselector; + + imeselector = this; + + $moreSettingsLink = $( '' ).text( 'More settings' ) + .addClass( 'uls-ime-more-settings-link' ) + .attr( 'data-i18n', 'ext-uls-ime-more-settings' ); + + $moreSettingsLink.languagesettings( { + defaultModule: 'input', + onClose: function () { + // on close of input settings, keep focus in input area. + imeselector.$element.focus(); + }, + top: imeselector.$element.offset().top + } ); + + // Hide the menu. + $moreSettingsLink.on( 'click', function (e) { + imeselector.$menu.removeClass( 'open' ); + e.stopPropagation(); + } ); + + return $moreSettingsLink; + }; + $( document ).ready( function () { $( 'body' ).on( 'focus', inputSelector, function () { diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 8ee6cee1..b667fcc6 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -351,7 +351,7 @@ onSave: function ( success ) { if ( success ) { // Live ime update - this.$parent.hide(); + this.$parent.close(); } else { // FIXME failure. what to do?! }