Skip to content

Commit

Permalink
Updated jQuery.ime with changes from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
ershad committed Nov 14, 2012
1 parent c24c714 commit 8b3f15e
Show file tree
Hide file tree
Showing 17 changed files with 690 additions and 115 deletions.
Binary file added images/ime-active.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tick.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 52 additions & 60 deletions jquery.ime.css
@@ -1,8 +1,7 @@
div.imeselector {
.imeselector {
position: absolute;
background: url('chrome-extension://__MSG_@@extension_id__/images/ime-active.svg') no-repeat scroll left center
transparent;
background-size: 15px;
/* @embed */
background: url('chrome-extension://__MSG_@@extension_id__/images/ime-active.png') no-repeat left center;
cursor: pointer;
height: 15px;
margin: 1px 0 0;
Expand All @@ -15,7 +14,7 @@ div.imeselector {
z-index: 9999;
}

div.imeselector a {
.imeselector a {
text-decoration: none;
outline: none;
color: #222222;
Expand All @@ -24,11 +23,34 @@ div.imeselector a {
padding-bottom: 4px;
}

.ime-disable-link span {
.ime-setting-caret {
margin-left: 2px;
margin-top: 8px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #000000;
content: "";
display: inline-block;
height: 0;
vertical-align: top;
width: 0;
}

span.ime-disable-link {
color: #222222;
line-height: 1em;
padding-top: 4px;
padding-left: 20px;
padding-bottom: 4px;
white-space: nowrap;
}

span.ime-disable-shortcut {
text-align: right;
margin-left: 10px;
color: #888;
font-size: smaller;
padding-right: 4px;
}

.ime-disable-link:hover span {
Expand All @@ -41,62 +63,19 @@ div.imeselector a {
border-bottom: solid 1px #39d;
text-align: left;
font-size: larger;
font-weight: normal;
padding-bottom: 5px;
padding-left: 20px;
padding-top: 9px;
margin-bottom: 1px;
cursor: default;
margin: 0 0 1px;
}

.imeselector .caret {
margin-left: 2px;
margin-top: 8px;
}

.caret {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #000000;
content: "";
display: inline-block;
height: 0;
vertical-align: top;
width: 0;
}

.imeselector-menu .sub-menu {
left: 100%;
position: absolute;
top: 0;
visibility: hidden;
margin-top: -1px;
}

.imeselector-menu li:hover .sub-menu {
visibility: visible;
.ime-language-list-wrapper {
position: relative;
padding: 0;
display: block;
}

.imeselector-menu .checked a {
background: url(chrome-extension://__MSG_@@extension_id__/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: auto;
padding: 0 0;
}

.ime-language-list {
margin: 0;
}

.imeselector-menu {
Expand All @@ -106,9 +85,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;
Expand All @@ -123,6 +102,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;
Expand All @@ -146,31 +132,37 @@ div.ime-language-list {
top: -6px;
}

.imeselector-menu .checked {
/* @embed */
background: url(chrome-extension://__MSG_@@extension_id__/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;
outline: none;
white-space: nowrap;
}

.imeselector-menu li>a:hover {
.imeselector-menu li > a:hover {
text-decoration: none;
color: #ffffff;
background-color: #5089e8;
Expand Down
68 changes: 68 additions & 0 deletions jquery.ime.inputmethods.js
Expand Up @@ -58,10 +58,18 @@
name: 'Palochka',
source: 'rules/cyrl/cyrl-palochka.js'
},
'da-normforms': {
name: 'Normal forms',
source: 'rules/da/da-normforms.js'
},
'eo-transliteration': {
name: 'Transliteration',
source: 'rules/eo/eo-transliteration.js'
},
'fo-normforms': {
name: 'Føroyskt',
source: 'rules/fo/fo-normforms.js'
},
'fi-transliteration': {
name: 'translitterointi',
source: 'rules/fi/fi-transliteration.js'
Expand All @@ -74,6 +82,10 @@
name: 'इनस्क्रिप्ट',
source: 'rules/hi/hi-inscript.js'
},
'is-normforms': {
name: 'Normal forms',
source: 'rules/is/is-normforms.js'
},
'mai-inscript': {
name: 'इनस्क्रिप्ट',
source: 'rules/mai/mai-inscript.js',
Expand All @@ -91,6 +103,10 @@
name: 'ഇൻസ്ക്രിപ്റ്റ്',
source: 'rules/ml/ml-inscript.js'
},
'sv-normforms': {
name: 'Normal forms',
source: 'rules/sv/sv-normforms.js'
},
'ta-inscript': {
name: 'இன்ஸ்கிரிப்ட்',
source: 'rules/ta/ta-inscript.js'
Expand Down Expand Up @@ -171,6 +187,14 @@
name: 'Transliteration',
source: 'rules/ne/ne-transliteration.js'
},
'no-normforms': {
name: 'Normal transliterasjon',
source: 'rules/no/no-normforms.js'
},
'no-tildeforms': {
name: 'Tildemerket transliterasjon',
source: 'rules/no/no-tildeforms.js'
},
'or-transliteration': {
name: 'Transliteration',
source: 'rules/or/or-transliteration.js'
Expand All @@ -183,6 +207,10 @@
name: 'ଲେଖନୀ',
source: 'rules/or/or-lekhani.js'
},
'se-normforms': {
name: 'Normal forms',
source: 'rules/se/se-normforms.js'
},
'te-inscript': {
name: 'ఇన్‍స్క్రిప్ట్',
source: 'rules/te/te-inscript.js'
Expand Down Expand Up @@ -234,6 +262,10 @@
'ur-transliteration': {
name: 'Transliteration',
source: 'rules/ur/ur-transliteration.js'
},
'mn-cyrl': {
name: 'Cyrillc',
source: 'rules/mn/mn-cyrl.js'
}
} );

Expand Down Expand Up @@ -278,6 +310,10 @@
autonym: 'нохчийн',
inputmethods: [ 'cyrl-palochka' ]
},
'da': {
autonym: 'Dansk',
inputmethods: [ 'da-normforms' ]
},
'de': {
autonym: 'Deutsch',
inputmethods: [ 'de' ]
Expand All @@ -286,6 +322,10 @@
autonym: 'Esperanto',
inputmethods: [ 'eo-transliteration' ]
},
'fo': {
autonym: 'Føroyskt',
inputmethods: [ 'fo-normforms' ]
},
'fi': {
autonym: 'Suomi',
inputmethods: [ 'fi-transliteration' ]
Expand All @@ -310,6 +350,10 @@
autonym: 'छत्तीसगढ़ी',
inputmethods: [ 'hi-transliteration' ]
},
'is': {
autonym: 'Íslenska',
inputmethods: [ 'is-normforms' ]
},
'ka': {
autonym: 'ქართული ენა',
inputmethods: [ 'ka-transliteration' ]
Expand Down Expand Up @@ -342,6 +386,10 @@
autonym: 'മലയാളം',
inputmethods: [ 'ml-transliteration', 'ml-inscript' ]
},
'mn': {
autonym: 'Монгол',
inputmethods: [ 'mn-cyrl' ]
},
'mr': {
autonym: 'मराठी',
inputmethods: [ 'mr-transliteration', 'mr-inscript2', 'mr-inscript' ]
Expand All @@ -354,6 +402,18 @@
autonym: 'नेपाल भाषा',
inputmethods: [ 'hi-transliteration', 'hi-inscript' ]
},
'no': {
autonym: 'Norsk',
inputmethods: [ 'no-normforms', 'no-tildeforms' ]
},
'nb': {
autonym: 'Norsk (bokmål)',
inputmethods: [ 'no-normforms', 'no-tildeforms' ]
},
'nn': {
autonym: 'Norsk (nynorsk)',
inputmethods: [ 'no-normforms', 'no-tildeforms' ]
},
'or': {
autonym: 'ଓଡ଼ିଆ',
inputmethods: [ 'or-transliteration', 'or-lekhani', 'or-inscript' ]
Expand All @@ -378,6 +438,10 @@
autonym: 'संस्कृत',
inputmethods: [ 'sa-transliteration', 'sa-inscript2', 'sa-inscript' ]
},
'se': {
autonym: 'Davvisámegiella',
inputmethods: [ 'se-normforms' ]
},
'shi': {
autonym: 'ⵜⵉⴼⵉⵏⴰⵖ',
inputmethods: [ 'ber-tfng' ]
Expand All @@ -386,6 +450,10 @@
autonym: 'සිංහල',
inputmethods: [ 'si-singlish', 'si-wijesekara' ]
},
'sv': {
autonym: 'Svenska',
inputmethods: [ 'sv-normforms' ]
},
'ta': {
autonym: 'தமிழ்',
inputmethods: [ 'ta-transliteration', 'ta-99', 'ta-inscript', 'ta-bamini' ]
Expand Down
6 changes: 6 additions & 0 deletions jquery.ime.js
Expand Up @@ -212,6 +212,12 @@
data = $this.data( 'ime' ),
options = typeof option === 'object' && option;

if ( $this.prop( 'readonly' ) || $this.prop( 'disabled' ) ) {
return;
}
if ( $this.hasClass( 'noime' ) ) {
return;
}
if ( !data ) {
data = new IME( this, options );
$this.data( 'ime', data );
Expand Down
6 changes: 3 additions & 3 deletions jquery.ime.preferences.js
Expand Up @@ -31,15 +31,15 @@

// Set the given IM as the last used for the language
setIM: function ( inputMethod ) {
if( !this.registry.imes ){
this.registry.imes= {};
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 ){
if ( !this.registry.imes ) {
this.registry.imes= {};
}
return this.registry.imes[language] || $.ime.languages[language].inputmethods[0];
Expand Down

0 comments on commit 8b3f15e

Please sign in to comment.