diff --git a/lib/jquery.ime/css/jquery.ime.css b/lib/jquery.ime/css/jquery.ime.css index 687ebf4d..9d5e7416 100644 --- a/lib/jquery.ime/css/jquery.ime.css +++ b/lib/jquery.ime/css/jquery.ime.css @@ -1,8 +1,7 @@ -div.imeselector { +.imeselector { position: absolute; - background: url('../images/ime-active.svg') no-repeat scroll left center - transparent; - background-size: 15px; + /* @embed */ + background: url('../images/ime-active.png') no-repeat left center; cursor: pointer; height: 15px; margin: 1px 0 0; @@ -15,7 +14,7 @@ div.imeselector { z-index: 9999; } -div.imeselector a { +.imeselector a { text-decoration: none; outline: none; color: #222222; @@ -24,30 +23,6 @@ div.imeselector a { padding-bottom: 4px; } -.ime-disable-link span { - text-align: right; - margin-left: 10px; - color: #888; - font-size: smaller; -} - -.ime-disable-link:hover span { - color: #eee; -} - -.ime-list-title, -.ime-lang-title { - color: #39d; - border-bottom: solid 1px #39d; - text-align: left; - font-size: larger; - padding-bottom: 5px; - padding-left: 20px; - padding-top: 9px; - margin-bottom: 1px; - cursor: default; -} - .imeselector .caret { margin-left: 2px; margin-top: 8px; @@ -64,40 +39,46 @@ div.imeselector a { width: 0; } -.imeselector-menu .sub-menu { - left: 100%; - position: absolute; - top: 0; - visibility: hidden; - margin-top: -1px; +span.ime-disable-link { + color: #222222; + line-height: 1em; + padding-top: 4px; + padding-left: 20px; + padding-bottom: 4px; + white-space: nowrap; } -.imeselector-menu li:hover .sub-menu { - visibility: visible; +span.ime-disable-shortcut { + text-align: right; + margin-left: 10px; + color: #888; + font-size: smaller; + padding-right: 4px; +} + +.ime-disable-link:hover span { + color: #eee; +} + +.ime-list-title, +.ime-lang-title { + color: #39d; + border-bottom: solid 1px #39d; + text-align: left; + font-size: larger; + font-weight: normal; + padding-bottom: 5px; + padding-left: 20px; + padding-top: 9px; + margin: 0 0 1px; +} + +.ime-language-list-wrapper { + position: relative; + padding: 0; display: block; -} - -.imeselector-menu .checked a { - background: url(../images/tick.svg) 4px no-repeat; - background-size: 12px 12px; -} - -ul.ime-language-list { - overflow: auto; + overflow-y: auto; max-height: 150px; - width: 300px; - list-style: none; - padding: 0 0; -} - -div.ime-language-list { - overflow: hidden; - width: 250px; - padding: 0 0; -} - -.ime-language-list { - margin: 0; } .imeselector-menu { @@ -107,9 +88,9 @@ div.ime-language-list { z-index: 1000; display: none; float: left; + margin-top: 13px; min-width: 160px; padding: 0; - list-style: none; border: 1px solid #888; background-color: #FFFFFF; -webkit-border-radius: 5px; @@ -124,6 +105,13 @@ div.ime-language-list { text-align: left; } +.imeselector-menu ul { + width: 100%; + padding: 0; + margin: 0; + list-style: none; +} + /* The triangle shaped callout */ .imeselector-menu:before { border-bottom: 7px solid #888; @@ -147,23 +135,29 @@ div.ime-language-list { top: -6px; } +.imeselector-menu .checked { + /* @embed */ + background: url(../images/tick.png) 4px center no-repeat; +} + .imeselector-menu .ime-help-link { background-color: #f0f0f0; border-radius: 0 0 5px 5px; border-top: 1px solid #ddd; margin-top: 6px; - padding: 2px 0 2px 0; + padding: 2px 0; color: #444; } -.imeselector-menu .ime-help-link>a:hover { +.imeselector-menu .ime-help-link > a:hover { background-color: #f0f0f0; color: #000; } .imeselector-menu a { display: block; - padding: 3px 20px; + padding-left: 20px; + padding-right: 20px; clear: both; font-weight: normal; color: #333333; @@ -171,7 +165,7 @@ div.ime-language-list { white-space: nowrap; } -.imeselector-menu li>a:hover { +.imeselector-menu li > a:hover { text-decoration: none; color: #ffffff; background-color: #5089e8; @@ -184,4 +178,4 @@ div.ime-language-list { .imeselector-menu li { position: relative; -} \ No newline at end of file +} diff --git a/lib/jquery.ime/images/ime-active.png b/lib/jquery.ime/images/ime-active.png new file mode 100644 index 00000000..9a3479aa Binary files /dev/null and b/lib/jquery.ime/images/ime-active.png differ diff --git a/lib/jquery.ime/images/ime-active.svg b/lib/jquery.ime/images/ime-active.svg deleted file mode 100644 index f4e790a3..00000000 --- a/lib/jquery.ime/images/ime-active.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - \ No newline at end of file diff --git a/lib/jquery.ime/images/tick.png b/lib/jquery.ime/images/tick.png new file mode 100644 index 00000000..239e4c52 Binary files /dev/null and b/lib/jquery.ime/images/tick.png differ diff --git a/lib/jquery.ime/images/tick.svg b/lib/jquery.ime/images/tick.svg deleted file mode 100644 index f47f48b7..00000000 --- a/lib/jquery.ime/images/tick.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - \ No newline at end of file diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js index 078be7eb..8cf7c529 100644 --- a/lib/jquery.ime/jquery.ime.js +++ b/lib/jquery.ime/jquery.ime.js @@ -212,6 +212,10 @@ data = $this.data( 'ime' ), options = typeof option === 'object' && option; + if( $this.prop( 'readonly' ) || $this.prop( 'disabled' ) ) { + return; + } + if ( !data ) { data = new IME( this, options ); $this.data( 'ime', data ); @@ -413,480 +417,6 @@ }( jQuery ) ); -( function ( $ ) { - 'use strict'; - - $.extend( $.ime.preferences, { - registry: { - language : 'en', - previousLanguages: [], // array of previous languages - imes: { - 'en': 'system' - } - }, - - setLanguage: function ( language ) { - this.registry.language = language; - if ( !this.registry.previousLanguages ) { - this.registry.previousLanguages = []; - } - //Add to the previous languages, but avoid duplicates. - if ( $.inArray( language, this.registry.previousLanguages ) === -1 ) { - this.registry.previousLanguages.push( language ); - } - }, - - getLanguage: function () { - return this.registry.language; - }, - - getPreviousLanguages: function () { - return this.registry.previousLanguages; - }, - - // Set the given IM as the last used for the language - setIM: function ( inputMethod ) { - if( !this.registry.imes ){ - this.registry.imes= {}; - } - this.registry.imes[this.getLanguage()] = inputMethod; - }, - - // Return the last used or the default IM for language - getIM: function ( language ) { - if( !this.registry.imes ){ - this.registry.imes= {}; - } - return this.registry.imes[language] || $.ime.languages[language].inputmethods[0]; - }, - - save: function () { - // save registry in cookies or localstorage - }, - - load: function () { - // load registry from cookies or localstorage - } - } ); -}( jQuery ) ); -( function ( $ ) { - 'use strict'; - - function IMESelector ( element, options ) { - this.$element = $( element ); - this.options = $.extend( {}, IMESelector.defaults, options ); - this.active = false; - this.$imeSetting = null; - this.$menu = null; - this.inputmethod = null; - this.init(); - this.listen(); - } - - IMESelector.prototype = { - constructor: IMESelector, - - init: function () { - this.prepareSelectorMenu(); - this.position(); - this.$imeSetting.hide(); - }, - - prepareSelectorMenu: function() { - - // TODO: In this approach there is a menu for each editable area. - // With correct event mapping we can probably reduce it to one menu. - this.$imeSetting = $( selectorTemplate ); - this.$menu = $( '