Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/73749
Change subject: Update jquery.ime from upstream ...................................................................... Update jquery.ime from upstream Change-Id: I1eabfcda79be85c8c28c11472ddc17b2e90c061d --- M lib/jquery.ime/css/jquery.ime.css M lib/jquery.ime/jquery.ime.js R lib/jquery.ime/rules/de/de-transliteration.js M lib/jquery.ime/rules/he/he-standard-2012-extonly.js M lib/jquery.ime/rules/he/he-standard-2012.js M lib/jquery.ime/rules/kn/kn-inscript2.js M lib/jquery.ime/rules/mr/mr-phonetic.js M lib/jquery.ime/rules/or/or-lekhani.js M lib/jquery.ime/rules/or/or-transliteration.js M lib/jquery.ime/rules/sk/sk-kbd.js M lib/jquery.ime/rules/ta/ta-inscript2.js 11 files changed, 154 insertions(+), 155 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/49/73749/1 diff --git a/lib/jquery.ime/css/jquery.ime.css b/lib/jquery.ime/css/jquery.ime.css index ac63106..c2b3632 100644 --- a/lib/jquery.ime/css/jquery.ime.css +++ b/lib/jquery.ime/css/jquery.ime.css @@ -7,7 +7,6 @@ background-image: linear-gradient(transparent, transparent), url('../images/ime-active.svg'); background-color: rgba(255,255,255,0.75); background-position: left 3px center; - cursor: pointer; height: 15px; font-size: small; padding: 2px 2px 1px 20px; @@ -19,13 +18,15 @@ z-index: 9999; } -div.imeselector:hover { +.imeselector:hover { box-shadow: 0 1px 3px 0 #565656; border-top: none; background-color: rgba(255,255,255,0.85); } -.imeselector a { +.imeselector a, +.ime-disable { + cursor: pointer; text-decoration: none; outline: none; color: #222222; @@ -49,11 +50,7 @@ } span.ime-disable-link { - color: #222222; - line-height: 1em; - padding-top: 4px; padding-left: 20px; - padding-bottom: 4px; white-space: nowrap; } @@ -110,7 +107,7 @@ text-align: left; } -.imeselector-menu.right { +.imeselector-menu.ime-right { right: auto; } @@ -133,7 +130,7 @@ top: -7px; } -.imeselector-menu.right:before { +.imeselector-menu.ime-right:before { right: auto; left: 9px; } @@ -150,26 +147,26 @@ } -.imeselector-menu.right:after { +.imeselector-menu.ime-right:after { right: auto; left: 10px; } -.imeselector-menu.position-top:before { +.imeselector-menu.ime-position-top:before { border-bottom: 0 none; border-top: 7px solid #888; top: auto; bottom: -7px; } -.imeselector-menu.position-top:after { +.imeselector-menu.ime-position-top:after { border-bottom: 0 none; border-top: 6px solid #FFFFFF; top: auto; bottom: -6px; } -.imeselector-menu .checked { +.imeselector-menu .ime-checked { /* @embed */ background: url(../images/tick.png) left 4px center no-repeat; background-image: -webkit-linear-gradient(transparent, transparent), url('../images/tick.svg'); @@ -191,24 +188,26 @@ color: #000; } -.imeselector-menu a { +.imeselector-menu .selectable-row-item { display: block; padding-left: 20px; padding-right: 20px; - clear: both; font-weight: normal; color: #333333; outline: none; white-space: nowrap; + position: relative; } -.imeselector-menu li > a:hover { - text-decoration: none; - color: #ffffff; - background-color: #5089e8; +.imeselector-menu .selectable-row { + cursor: pointer; } -.open { +.imeselector-menu .selectable-row:hover { + background-color: #f0f0f0; +} + +.ime-open { *z-index: 1000; display: block; } diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js index 9bf7cc8..51feb39 100644 --- a/lib/jquery.ime/jquery.ime.js +++ b/lib/jquery.ime/jquery.ime.js @@ -1,9 +1,15 @@ -/*! jquery.ime - v0.1.0+20130708 +/*! jquery.ime - v0.1.0+20130715 * https://github.com/wikimedia/jquery.ime * Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */ ( function ( $ ) { 'use strict'; + /** + * @TODO: document + * @param {Function} [options.helpHandler] Called for each input method row in the selector + * @param {Object} options.helpHandler.imeSelector + * @param {String} options.helpHandler.ime Id of the input method + */ function IME( element, options ) { this.$element = $( element ); // This needs to be delayed here since extending language list happens at DOM ready @@ -99,9 +105,9 @@ altGr = true; } - // Don't process ASCII control characters (except linefeed), - // as well as anything involving - // Alt (except for extended keymaps), Ctrl and Meta + // Don't process ASCII control characters except linefeed, + // as well as anything involving Ctrl, Meta and Alt, + // but do process extended keymaps if ( ( e.which < 32 && e.which !== 13 && !altGr ) || e.ctrlKey || e.metaKey ) { // Blank the context this.context = ''; @@ -121,9 +127,11 @@ // Get the last few characters before the one the user just typed, // to provide context for the transliteration regexes. // We need to append c because it hasn't been added to $this.val() yet - input = this.lastNChars( this.$element.val() || this.$element.text(), startPos, - this.inputmethod.maxKeyLength ) - + c; + input = this.lastNChars( + this.$element.val() || this.$element.text(), + startPos, + this.inputmethod.maxKeyLength + ) + c; replacement = this.transliterate( input, this.context, altGr ); @@ -132,8 +140,9 @@ if ( this.context.length > this.inputmethod.contextLength ) { // The buffer is longer than needed, truncate it at the front - this.context = this.context.substring( this.context.length - - this.inputmethod.contextLength ); + this.context = this.context.substring( + this.context.length - this.inputmethod.contextLength + ); } // If replacement equals to input, no replacement is made, because @@ -310,7 +319,8 @@ // default options $.ime.defaults = { imePath: '../', // Relative/Absolute path for the rules folder of jquery.ime - languages: [] // Languages to be used- by default all languages + languages: [], // Languages to be used- by default all languages + helpHandler: null // Called for each ime option in the menu }; // private function for debugging @@ -472,7 +482,7 @@ } } - function arrayKeys ( obj ) { + function arrayKeys( obj ) { var rv = []; $.each( obj, function ( key ) { rv.push( key ); @@ -562,13 +572,13 @@ focus: function () { // Hide all other IME settings and collapse open menus $( 'div.imeselector' ).hide(); - $( 'div.imeselector-menu' ).removeClass( 'open' ); + $( 'div.imeselector-menu' ).removeClass( 'ime-open' ); this.$imeSetting.show(); this.resetTimer(); }, show: function () { - this.$menu.addClass( 'open' ); + this.$menu.addClass( 'ime-open' ); this.stopTimer(); this.$imeSetting.show(); @@ -576,14 +586,14 @@ }, hide: function () { - this.$menu.removeClass( 'open' ); + this.$menu.removeClass( 'ime-open' ); this.resetTimer(); return false; }, toggle: function () { - if ( this.$menu.hasClass( 'open' ) ) { + if ( this.$menu.hasClass( 'ime-open' ) ) { this.hide(); } else { this.show(); @@ -607,7 +617,7 @@ } ); imeselector.$element.on( 'blur.ime', function () { - if ( !imeselector.$imeSetting.hasClass( 'onfocus' ) ) { + if ( !imeselector.$imeSetting.hasClass( 'ime-onfocus' ) ) { imeselector.$imeSetting.hide(); imeselector.hide(); } @@ -617,10 +627,10 @@ // We don't want the selector to disappear // while the user is trying to click it imeselector.stopTimer(); - imeselector.$imeSetting.addClass( 'onfocus' ); + imeselector.$imeSetting.addClass( 'ime-onfocus' ); } ).mouseleave( function () { imeselector.resetTimer(); - imeselector.$imeSetting.removeClass( 'onfocus' ); + imeselector.$imeSetting.removeClass( 'ime-onfocus' ); } ); imeselector.$menu.on( 'click.ime', 'li', function() { @@ -757,7 +767,7 @@ // Flip the menu to the top only if it can fit in the space there if ( menutop < top ) { this.$menu - .addClass( 'position-top' ) + .addClass( 'ime-position-top' ) .css( 'top', -menutop ); } } @@ -780,11 +790,11 @@ if ( this.$element.css( 'direction' ) === 'rtl' ) { this.$menu .css( 'left', 0 ) - .addClass( 'left' ); + .addClass( 'ime-left' ); } else { this.$menu .css( 'left', position.left ) - .addClass( 'right' ); + .addClass( 'ime-right' ); } } }, @@ -861,10 +871,10 @@ return; } - this.$menu.find( '.checked' ).removeClass( 'checked' ); - this.$menu.find( 'li.ime-disable' ).removeClass( 'checked' ); + this.$menu.find( '.ime-checked' ).removeClass( 'ime-checked' ); + this.$menu.find( 'li.ime-disable' ).removeClass( 'ime-checked' ); this.$menu.find( 'li[data-ime-inputmethod=' + inputmethodId + ']' ) - .addClass( 'checked' ); + .addClass( 'ime-checked' ); ime = this.$element.data( 'ime' ); if ( inputmethodId === 'system' ) { @@ -893,8 +903,8 @@ * Disable the inputmethods (Use the system input method) */ disableIM: function () { - this.$menu.find( '.checked' ).removeClass( 'checked' ); - this.$menu.find( 'div.ime-disable' ).addClass( 'checked' ); + this.$menu.find( '.ime-checked' ).removeClass( 'ime-checked' ); + this.$menu.find( 'div.ime-disable' ).addClass( 'ime-checked' ); this.$element.data( 'ime' ).disable(); this.$imeSetting.find( 'a.ime-name' ).text( '' ); this.hide(); @@ -936,8 +946,11 @@ continue; } - $languageItem = $( '<a>' ).attr( 'href', '#' ).text( language.autonym ); - $language = $( '<li class="ime-lang">' ).attr( 'lang', languageCode ); + $languageItem = $( '<a>' ) + .attr( 'href', '#' ) + .text( language.autonym ) + .addClass( 'selectable-row-item' ); + $language = $( '<li class="ime-lang selectable-row">' ).attr( 'lang', languageCode ); $language.append( $languageItem ); $languageList.append( $language ); } @@ -953,32 +966,41 @@ /** * Prepare input methods in menu for the given language code * - * @param languageCode + * @param {String} languageCode */ prepareInputMethods: function ( languageCode ) { var language = $.ime.languages[languageCode], - $imeList = this.$menu.find( '.ime-list' ); + $imeList = this.$menu.find( '.ime-list' ), + imeSelector = this; $imeList.empty(); $.each( language.inputmethods, function ( index, inputmethod ) { - var name = $.ime.sources[inputmethod].name, - $imeItem = $( '<a>' ).attr( 'href', '#' ).text( name ), - $inputMethod = $( '<li data-ime-inputmethod=' + inputmethod + '>' ); + var $imeItem, $inputMethod, + name = $.ime.sources[inputmethod].name; - $inputMethod - .append( - '<span class="ime-im-check">', - $imeItem - ) - .addClass( 'ime-im' ); + $imeItem = $( '<a>' ) + .attr( 'href', '#' ) + .text( name ) + .addClass( 'selectable-row-item' ); + + $inputMethod = $( '<li>' ) + .attr( 'data-ime-inputmethod', inputmethod ) + .addClass( 'ime-im selectable-row' ) + .append( '<span class="ime-im-check"></span>', $imeItem ); + + if ( imeSelector.options.helpHandler ) { + $inputMethod.append( imeSelector.options.helpHandler.call( imeSelector, inputmethod ) ); + } + $imeList.append( $inputMethod ); } ); }, helpLink: function () { - return $( '<div class="ime-help-link">' ) + return $( '<div class="ime-help-link selectable-row">' ) .append( $( '<a>' ).text( 'Help' ) + .addClass( 'selectable-row-item' ) .attr( { 'href': 'http://github.com/wikimedia/jquery.ime', 'target': '_blank', @@ -1029,7 +1051,7 @@ } function toggleMenuItem() { - return $( '<div class="ime-disable">' ).append( + return $( '<div class="ime-disable selectable-row">' ).append( $( '<span>' ) .attr( { 'class': 'ime-disable-link', @@ -1424,9 +1446,9 @@ name: 'ปัตตะโชติ', source: 'rules/th/th-pattachote.js' }, - 'de': { + 'de-transliteration': { name: 'Deutsch', - source: 'rules/de/de.js' + source: 'rules/de/de-transliteration.js' }, 'el-kbd': { name: 'Τυπική πληκτρολόγιο', @@ -1785,7 +1807,7 @@ }, 'de': { autonym: 'Deutsch', - inputmethods: [ 'de' ] + inputmethods: [ 'de-transliteration' ] }, 'doi': { autonym: 'डोगरी', diff --git a/lib/jquery.ime/rules/de/de.js b/lib/jquery.ime/rules/de/de-transliteration.js similarity index 94% rename from lib/jquery.ime/rules/de/de.js rename to lib/jquery.ime/rules/de/de-transliteration.js index 31262da..bf074b8 100644 --- a/lib/jquery.ime/rules/de/de.js +++ b/lib/jquery.ime/rules/de/de-transliteration.js @@ -2,7 +2,7 @@ 'use strict'; var de = { - id: 'de', + id: 'de-transliteration', name: 'Deutsch', description: 'German input method', date: '2012-11-20', diff --git a/lib/jquery.ime/rules/he/he-standard-2012-extonly.js b/lib/jquery.ime/rules/he/he-standard-2012-extonly.js index 6c23127..3c368f6 100644 --- a/lib/jquery.ime/rules/he/he-standard-2012-extonly.js +++ b/lib/jquery.ime/rules/he/he-standard-2012-extonly.js @@ -43,6 +43,8 @@ ['5', '°'], // Degree ['6', '֫'], // Ole ['8', '×'], // Multiplication + ['9', '\u200e'], // LRM + ['0', '\u200f'], // RLM ['\\.', '÷'], // Division ['\u05D8', 'װ'], // Double vav, ט diff --git a/lib/jquery.ime/rules/he/he-standard-2012.js b/lib/jquery.ime/rules/he/he-standard-2012.js index c7cef13..5ee1659 100644 --- a/lib/jquery.ime/rules/he/he-standard-2012.js +++ b/lib/jquery.ime/rules/he/he-standard-2012.js @@ -94,6 +94,8 @@ [ '5', '°' ], // Degree [ '6', '֫' ], // Ole [ '8', '×' ], // Multiplication + [ '9', '\u200e' ], // LRM + [ '0', '\u200f' ], // RLM [ '/', '÷' ], // Division [ 'y', 'װ' ], // Double vav diff --git a/lib/jquery.ime/rules/kn/kn-inscript2.js b/lib/jquery.ime/rules/kn/kn-inscript2.js index 915a2fe..364f3f7 100644 --- a/lib/jquery.ime/rules/kn/kn-inscript2.js +++ b/lib/jquery.ime/rules/kn/kn-inscript2.js @@ -111,7 +111,7 @@ ['H', 'ೞ'], ['j', 'ೲ'], ['\\>', 'ಽ'], - ['.', '॥'] + ['\\.', '॥'] ] }; diff --git a/lib/jquery.ime/rules/mr/mr-phonetic.js b/lib/jquery.ime/rules/mr/mr-phonetic.js index 6dcfeed..c009d46 100644 --- a/lib/jquery.ime/rules/mr/mr-phonetic.js +++ b/lib/jquery.ime/rules/mr/mr-phonetic.js @@ -97,13 +97,13 @@ ['\\<', 'ऩ'], [',', ','], ['\\>', '़'], - ['.', '।'], ['\\?', 'ऐ'], ['/', 'ए'], ['\\^', 'ज्ञ'], ['X', 'क्ष'], ['\\*', 'श्र'], - ['ff', '्']] + ['ff', '्'] + ] }; $.ime.register( mrPhonetic ); diff --git a/lib/jquery.ime/rules/or/or-lekhani.js b/lib/jquery.ime/rules/or/or-lekhani.js index 0ec6fe0..dbdc3f7 100644 --- a/lib/jquery.ime/rules/or/or-lekhani.js +++ b/lib/jquery.ime/rules/or/or-lekhani.js @@ -3,7 +3,7 @@ var orLekhani = { id: 'or-lekhani', - name: 'Odia Lekhani', + name: 'ଫୋନେଟିକ', description: 'Odia Lekhani phonetic input method', date: '2012-10-14', URL: 'http://github.com/wikimedia/jquery.ime', diff --git a/lib/jquery.ime/rules/or/or-transliteration.js b/lib/jquery.ime/rules/or/or-transliteration.js index 19bbd0a..541535f 100644 --- a/lib/jquery.ime/rules/or/or-transliteration.js +++ b/lib/jquery.ime/rules/or/or-transliteration.js @@ -3,8 +3,8 @@ var orTransliteration = { id: 'or-transliteration', - name: 'Odia Transliteration', - description: 'ଟ୍ରାନ୍ସଲି ଟରେସନ', + name: 'ଟ୍ରାନ୍ସଲିଟରେସନ', + description: 'Odia Transliteration', date: '2012-10-14', URL: 'http://github.com/wikimedia/jquery.ime', author: 'Junaid P V and Subhashish Panigrahi', diff --git a/lib/jquery.ime/rules/sk/sk-kbd.js b/lib/jquery.ime/rules/sk/sk-kbd.js index 8117bd3..3eef7c2 100644 --- a/lib/jquery.ime/rules/sk/sk-kbd.js +++ b/lib/jquery.ime/rules/sk/sk-kbd.js @@ -5,83 +5,12 @@ id: 'sk-kbd', name: 'Slovak kbd', description: 'Slovak kbd keyboard layout', - date: '2013-02-12', + date: '2013-06-26', URL: 'http://github.com/wikimedia/jquery.ime', author: 'Parag Nemade', license: 'GPLv3', - version: '1.0', + version: '1.1', patterns: [ - ['+\'a', 'ä'], - ['+\'o', 'ö'], - ['+\'u', 'ü'], - ['+\'A', 'Ä'], - ['+\'O', 'Ö'], - ['+\'U', 'Ü'], - - ['\'a', 'á'], - ['+a', 'ä'], - ['+c', 'č'], - ['+d', 'ď'], - ['\'e', 'é'], - ['+e', 'ě'], - ['\'i', 'í'], - ['\'l', 'ĺ'], - ['+l', 'ľ'], - ['+n', 'ň'], - ['\'o', 'ó'], - ['+o', 'ô'], - ['^o', 'ô'], - ['\'r', 'ŕ'], - ['+r', 'ř'], - ['\'s', 'ß'], - ['+s', 'š'], - ['+t', 'ť'], - ['\'u', 'ú'], - ['+u', 'ů'], - ['\'z', 'ý'], - ['+y', 'ž'], - ['\'A', 'Á'], - ['+A', 'Ä'], - ['+C', 'Č'], - ['+D', 'Ď'], - ['\'E', 'É'], - ['+E', 'Ě'], - ['\'I', 'Í'], - ['\'L', 'Ĺ'], - ['+L', 'Ľ'], - ['+N', 'Ň'], - ['\'O', 'Ó'], - ['+O', 'Ô'], - ['~O', 'Ô'], - ['\'R', 'Ŕ'], - ['+R', 'Ř'], - ['\'S', 'ß'], - ['+S', 'Š'], - ['+T', 'Ť'], - ['\'U', 'Ú'], - ['+U', 'Ů'], - ['\'Z', 'Ý'], - ['+Y', 'Ž'], - ['\'q', '`'], - ['\'2', '@'], - ['\'3', '#'], - ['\'4', '$'], - ['\'5', '%'], - ['\'6', '^'], - ['\'7', '&'], - ['\'8', '*'], - ['\'9', '('], - ['\'0', ')'], - ['+1', '!'], - ['+2', '@'], - ['+3', '#'], - ['+4', '$'], - ['+5', '%'], - ['+6', '^'], - ['+7', '&'], - ['+8', '*'], - ['+9', '('], - ['+0', ')'], ['1', '+'], ['2', 'ľ'], ['3', 'š'], @@ -92,19 +21,20 @@ ['8', 'á'], ['9', 'í'], ['0', 'é'], - ['\\!', '1'], - ['\\@', '2'], - ['\\#', '3'], + ['!', '1'], + ['@', '2'], + ['#', '3'], ['\\$', '4'], - ['\\%', '5'], + ['%', '5'], ['\\^', '6'], - ['\\&', '7'], + ['&', '7'], ['\\*', '8'], ['\\(', '9'], ['\\)', '0'], - ['\\-', '='], - ['\\_', '%'], - ['\\=', '\''], + ['-', '='], + ['_', '%'], + ['=', '´'], + ['\\+', 'ˇ'], ['\\[', 'ú'], ['\\{', '/'], ['\\]', 'ä'], @@ -120,11 +50,55 @@ ['/', '-'], ['\\?', '_'], ['`', ';'], - ['\\~', '^'], + ['~', '°'], + + ['´a', 'á'], + ['´A', 'Á'], + ['´e', 'é'], + ['´E', 'É'], + ['´i', 'í'], + ['´I', 'Í'], + ['´l', 'ĺ'], + ['´L', 'Ĺ'], + ['´o', 'ó'], + ['´O', 'Ó'], + ['´r', 'ŕ'], + ['´R', 'Ŕ'], + ['´u', 'ú'], + ['´U', 'Ú'], + ['´y', 'ý'], + ['´Y', 'Ý'], + + ['¨a', 'ä'], + ['¨A', 'Ä'], + ['\\^o', 'ô'], + ['\\^O', 'Ô'], + + ['ˇc', 'č'], + ['ˇC', 'Č'], + ['ˇd', 'ď'], + ['ˇD', 'Ď'], + ['ˇl', 'ľ'], + ['ˇL', 'Ľ'], + ['ˇn', 'ň'], + ['ˇN', 'Ň'], + ['ˇs', 'š'], + ['ˇS', 'Š'], + ['ˇt', 'ť'], + ['ˇT', 'Ť'], + ['ˇz', 'ž'], + ['ˇZ', 'Ž'], + + // It's QWERTZ ['y', 'z'], ['z', 'y'], ['Y', 'Z'], - ['Z', 'Y']] + ['Z', 'Y'] + ], + patterns_x: [ + ['3', '^'], + ['=', '¨'] + ] }; $.ime.register( skKbd ); diff --git a/lib/jquery.ime/rules/ta/ta-inscript2.js b/lib/jquery.ime/rules/ta/ta-inscript2.js index 7d5452b..64279a9 100644 --- a/lib/jquery.ime/rules/ta/ta-inscript2.js +++ b/lib/jquery.ime/rules/ta/ta-inscript2.js @@ -99,7 +99,7 @@ ['v', '௳'], ['b', '௵'], [',', '௹'], - ['.', '॥'] + ['\\.', '॥'] ] }; -- To view, visit https://gerrit.wikimedia.org/r/73749 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1eabfcda79be85c8c28c11472ddc17b2e90c061d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits