Update jquery.ime library
Changes:
1. build: Update eslint
2. telugu jna gunintham fixes
Updating to 6d591016d2
Change-Id: I092ae22f51bb18ef5dd23f8b1552ca7ced17face
This commit is contained in:
committed by
jenkins-bot
parent
f39d684103
commit
6f1ccbd3b7
@@ -1,6 +1,6 @@
|
|||||||
/*! jquery.ime - v0.2.0+20190521
|
/*! jquery.ime - v0.2.0+20200106
|
||||||
* https://github.com/wikimedia/jquery.ime
|
* https://github.com/wikimedia/jquery.ime
|
||||||
* Copyright (c) 2019 Santhosh Thottingal; License: (GPL-2.0+ OR MIT) */
|
* Copyright (c) 2020 Santhosh Thottingal; License: (GPL-2.0+ OR MIT) */
|
||||||
( function ( $ ) {
|
( function ( $ ) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@@ -10,12 +10,6 @@
|
|||||||
// rangy is defined in the rangy library
|
// rangy is defined in the rangy library
|
||||||
/* global rangy */
|
/* global rangy */
|
||||||
|
|
||||||
function arrayKeys( obj ) {
|
|
||||||
return $.map( obj, function ( element, index ) {
|
|
||||||
return index;
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* private function for debugging
|
* private function for debugging
|
||||||
* @param {jQuery} [$obj]
|
* @param {jQuery} [$obj]
|
||||||
@@ -67,7 +61,7 @@
|
|||||||
this.$element = $( element );
|
this.$element = $( element );
|
||||||
this.textEntry = textEntry;
|
this.textEntry = textEntry;
|
||||||
// This needs to be delayed here since extending language list happens at DOM ready
|
// This needs to be delayed here since extending language list happens at DOM ready
|
||||||
$.ime.defaults.languages = arrayKeys( $.ime.languages );
|
$.ime.defaults.languages = Object.keys( $.ime.languages );
|
||||||
this.options = $.extend( {}, $.ime.defaults, options );
|
this.options = $.extend( {}, $.ime.defaults, options );
|
||||||
if ( this.options.imePath ) {
|
if ( this.options.imePath ) {
|
||||||
// Set the global IME path from the one specified to the instance
|
// Set the global IME path from the one specified to the instance
|
||||||
@@ -186,7 +180,7 @@
|
|||||||
.concat( patterns );
|
.concat( patterns );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $.isFunction( patterns ) ) {
|
if ( typeof patterns === 'function' ) {
|
||||||
// For backwards compatibility, allow the rule functions to return plain
|
// For backwards compatibility, allow the rule functions to return plain
|
||||||
// string. Determine noop by checking whether input is different from
|
// string. Determine noop by checking whether input is different from
|
||||||
// output. If the rule function returns object, just return it as-is.
|
// output. If the rule function returns object, just return it as-is.
|
||||||
@@ -523,6 +517,7 @@
|
|||||||
return $element.is( 'input:not([type]), input[type=text], input[type=search], textarea' ) &&
|
return $element.is( 'input:not([type]), input[type=text], input[type=search], textarea' ) &&
|
||||||
!$element.prop( 'readonly' ) &&
|
!$element.prop( 'readonly' ) &&
|
||||||
!$element.prop( 'disabled' ) &&
|
!$element.prop( 'disabled' ) &&
|
||||||
|
// eslint-disable-next-line no-jquery/no-class-state
|
||||||
!$element.hasClass( 'noime' );
|
!$element.hasClass( 'noime' );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -674,6 +669,7 @@
|
|||||||
* @inheritdoc TextEntry
|
* @inheritdoc TextEntry
|
||||||
*/
|
*/
|
||||||
ContentEditableEntry.static.canWrap = function ( $element ) {
|
ContentEditableEntry.static.canWrap = function ( $element ) {
|
||||||
|
// eslint-disable-next-line no-jquery/no-class-state
|
||||||
return $element.is( '[contenteditable]' ) && !$element.hasClass( 'noime' );
|
return $element.is( '[contenteditable]' ) && !$element.hasClass( 'noime' );
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -918,13 +914,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggleMenuItem() {
|
function toggleMenuItem() {
|
||||||
return $( '<div class="ime-disable selectable-row">' ).append(
|
return $( '<div>' ).addClass( 'ime-disable selectable-row' ).append(
|
||||||
$( '<span>' )
|
$( '<span>' )
|
||||||
.attr( {
|
.addClass( 'ime-disable-link' )
|
||||||
'class': 'ime-disable-link',
|
|
||||||
'data-i18n': 'jquery-ime-disable-text'
|
|
||||||
} )
|
|
||||||
.addClass( 'ime-checked' )
|
.addClass( 'ime-checked' )
|
||||||
|
.attr( 'data-i18n', 'jquery-ime-disable-text' )
|
||||||
.text( 'System input method' ),
|
.text( 'System input method' ),
|
||||||
$( '<span>' )
|
$( '<span>' )
|
||||||
.addClass( 'ime-disable-shortcut' )
|
.addClass( 'ime-disable-shortcut' )
|
||||||
@@ -956,7 +950,7 @@
|
|||||||
// TODO: In this approach there is a menu for each editable area.
|
// TODO: In this approach there is a menu for each editable area.
|
||||||
// With correct event mapping we can probably reduce it to one menu.
|
// With correct event mapping we can probably reduce it to one menu.
|
||||||
this.$imeSetting = $( selectorTemplate );
|
this.$imeSetting = $( selectorTemplate );
|
||||||
this.$menu = $( '<div class="imeselector-menu" role="menu">' );
|
this.$menu = $( '<div>' ).addClass( 'imeselector-menu' ).attr( 'role', 'menu' );
|
||||||
this.$menu.append(
|
this.$menu.append(
|
||||||
imeListTitle(),
|
imeListTitle(),
|
||||||
imeList(),
|
imeList(),
|
||||||
@@ -991,6 +985,8 @@
|
|||||||
|
|
||||||
this.timer = setTimeout(
|
this.timer = setTimeout(
|
||||||
function () {
|
function () {
|
||||||
|
// TODO: Use CSS transitions
|
||||||
|
// eslint-disable-next-line no-jquery/no-animate
|
||||||
imeselector.$imeSetting.animate( {
|
imeselector.$imeSetting.animate( {
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
marginTop: '-20px'
|
marginTop: '-20px'
|
||||||
@@ -1006,7 +1002,9 @@
|
|||||||
|
|
||||||
focus: function () {
|
focus: function () {
|
||||||
// Hide all other IME settings and collapse open menus
|
// Hide all other IME settings and collapse open menus
|
||||||
|
// eslint-disable-next-line no-jquery/no-global-selector
|
||||||
$( 'div.imeselector' ).hide();
|
$( 'div.imeselector' ).hide();
|
||||||
|
// eslint-disable-next-line no-jquery/no-global-selector
|
||||||
$( 'div.imeselector-menu' ).removeClass( 'ime-open' );
|
$( 'div.imeselector-menu' ).removeClass( 'ime-open' );
|
||||||
this.afterKeydown();
|
this.afterKeydown();
|
||||||
},
|
},
|
||||||
@@ -1032,6 +1030,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
toggle: function () {
|
toggle: function () {
|
||||||
|
// eslint-disable-next-line no-jquery/no-class-state
|
||||||
if ( this.$menu.hasClass( 'ime-open' ) ) {
|
if ( this.$menu.hasClass( 'ime-open' ) ) {
|
||||||
this.hide();
|
this.hide();
|
||||||
} else {
|
} else {
|
||||||
@@ -1046,9 +1045,10 @@
|
|||||||
var imeselector = this;
|
var imeselector = this;
|
||||||
|
|
||||||
imeselector.$imeSetting.on( 'click.ime', function ( e ) {
|
imeselector.$imeSetting.on( 'click.ime', function ( e ) {
|
||||||
var t = $( e.target );
|
var $t = $( e.target );
|
||||||
|
|
||||||
if ( t.hasClass( 'imeselector-toggle' ) ) {
|
// eslint-disable-next-line no-jquery/no-class-state
|
||||||
|
if ( $t.hasClass( 'imeselector-toggle' ) ) {
|
||||||
imeselector.toggle();
|
imeselector.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1056,6 +1056,7 @@
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
imeselector.$element.on( 'blur.ime', function () {
|
imeselector.$element.on( 'blur.ime', function () {
|
||||||
|
// eslint-disable-next-line no-jquery/no-class-state
|
||||||
if ( !imeselector.$imeSetting.hasClass( 'ime-onfocus' ) ) {
|
if ( !imeselector.$imeSetting.hasClass( 'ime-onfocus' ) ) {
|
||||||
imeselector.$imeSetting.hide();
|
imeselector.$imeSetting.hide();
|
||||||
imeselector.hide();
|
imeselector.hide();
|
||||||
@@ -1063,7 +1064,7 @@
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
// Hide the menu when clicked outside
|
// Hide the menu when clicked outside
|
||||||
$( 'html' ).click( function () {
|
$( document.body ).on( 'click', function () {
|
||||||
imeselector.hide();
|
imeselector.hide();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@@ -1072,18 +1073,18 @@
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
imeselector.$imeSetting.mouseenter( function () {
|
imeselector.$imeSetting.on( 'mouseenter', function () {
|
||||||
// We don't want the selector to disappear
|
// We don't want the selector to disappear
|
||||||
// while the user is trying to click it
|
// while the user is trying to click it
|
||||||
imeselector.stopTimer();
|
imeselector.stopTimer();
|
||||||
imeselector.$imeSetting.addClass( 'ime-onfocus' );
|
imeselector.$imeSetting.addClass( 'ime-onfocus' );
|
||||||
} ).mouseleave( function () {
|
} ).on( 'mouseleave', function () {
|
||||||
imeselector.resetTimer();
|
imeselector.resetTimer();
|
||||||
imeselector.$imeSetting.removeClass( 'ime-onfocus' );
|
imeselector.$imeSetting.removeClass( 'ime-onfocus' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
imeselector.$menu.on( 'click.ime', 'li', function () {
|
imeselector.$menu.on( 'click.ime', 'li', function () {
|
||||||
imeselector.$element.focus();
|
imeselector.$element.trigger( 'focus' );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
@@ -1121,6 +1122,7 @@
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
imeselector.$element.attrchange( function () {
|
imeselector.$element.attrchange( function () {
|
||||||
|
// eslint-disable-next-line no-jquery/no-sizzle
|
||||||
if ( imeselector.$element.is( ':hidden' ) ) {
|
if ( imeselector.$element.is( ':hidden' ) ) {
|
||||||
imeselector.$imeSetting.hide();
|
imeselector.$imeSetting.hide();
|
||||||
}
|
}
|
||||||
@@ -1134,7 +1136,7 @@
|
|||||||
|
|
||||||
// Update IM selector position when the window is resized
|
// Update IM selector position when the window is resized
|
||||||
// or the browser window is zoomed in or zoomed out
|
// or the browser window is zoomed in or zoomed out
|
||||||
$( window ).resize( function () {
|
$( window ).on( 'resize', function () {
|
||||||
imeselector.position();
|
imeselector.position();
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
@@ -1429,10 +1431,10 @@
|
|||||||
|
|
||||||
// Language list can be very long, so we use a container with
|
// Language list can be very long, so we use a container with
|
||||||
// overflow auto
|
// overflow auto
|
||||||
$languageListWrapper = $( '<div class="ime-language-list-wrapper">' );
|
$languageListWrapper = $( '<div>' ).addClass( 'ime-language-list-wrapper' );
|
||||||
$languageList = $( '<ul class="ime-language-list">' );
|
$languageList = $( '<ul>' ).addClass( 'ime-language-list' );
|
||||||
|
|
||||||
if ( $.isFunction( this.options.languages ) ) {
|
if ( typeof this.options.languages === 'function' ) {
|
||||||
languageList = this.options.languages();
|
languageList = this.options.languages();
|
||||||
} else {
|
} else {
|
||||||
languageList = this.options.languages;
|
languageList = this.options.languages;
|
||||||
@@ -1450,7 +1452,7 @@
|
|||||||
.attr( 'href', '#' )
|
.attr( 'href', '#' )
|
||||||
.text( this.getAutonym( languageCode ) )
|
.text( this.getAutonym( languageCode ) )
|
||||||
.addClass( 'selectable-row-item autonym' );
|
.addClass( 'selectable-row-item autonym' );
|
||||||
$language = $( '<li class="ime-lang selectable-row">' ).attr( 'lang', languageCode );
|
$language = $( '<li>' ).addClass( 'ime-lang selectable-row' ).attr( 'lang', languageCode );
|
||||||
$language.append( $languageItem );
|
$language.append( $languageItem );
|
||||||
$languageList.append( $language );
|
$languageList.append( $language );
|
||||||
}
|
}
|
||||||
@@ -1475,7 +1477,7 @@
|
|||||||
|
|
||||||
$imeList.empty();
|
$imeList.empty();
|
||||||
|
|
||||||
$.each( language.inputmethods, function ( index, inputmethod ) {
|
language.inputmethods.forEach( function ( inputmethod ) {
|
||||||
var $imeItem, $inputMethod, source, name;
|
var $imeItem, $inputMethod, source, name;
|
||||||
|
|
||||||
source = $.ime.sources[ inputmethod ];
|
source = $.ime.sources[ inputmethod ];
|
||||||
@@ -1492,7 +1494,10 @@
|
|||||||
$inputMethod = $( '<li>' )
|
$inputMethod = $( '<li>' )
|
||||||
.attr( 'data-ime-inputmethod', inputmethod )
|
.attr( 'data-ime-inputmethod', inputmethod )
|
||||||
.addClass( 'ime-im selectable-row' )
|
.addClass( 'ime-im selectable-row' )
|
||||||
.append( '<span class="ime-im-check"></span>', $imeItem );
|
.append(
|
||||||
|
$( '<span>' ).addClass( 'ime-im-check' ),
|
||||||
|
$imeItem
|
||||||
|
);
|
||||||
|
|
||||||
if ( imeSelector.options.helpHandler ) {
|
if ( imeSelector.options.helpHandler ) {
|
||||||
$inputMethod.append( imeSelector.options.helpHandler.call( imeSelector, inputmethod ) );
|
$inputMethod.append( imeSelector.options.helpHandler.call( imeSelector, inputmethod ) );
|
||||||
@@ -1508,7 +1513,7 @@
|
|||||||
* @return {jQuery}
|
* @return {jQuery}
|
||||||
*/
|
*/
|
||||||
helpLink: function () {
|
helpLink: function () {
|
||||||
return $( '<div class="ime-help-link selectable-row">' )
|
return $( '<div>' ).addClass( 'ime-help-link selectable-row' )
|
||||||
.append( $( '<a>' ).text( 'Help' )
|
.append( $( '<a>' ).text( 'Help' )
|
||||||
.addClass( 'selectable-row-item' )
|
.addClass( 'selectable-row-item' )
|
||||||
.attr( {
|
.attr( {
|
||||||
@@ -1630,7 +1635,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add to the previous languages, but avoid duplicates.
|
// Add to the previous languages, but avoid duplicates.
|
||||||
if ( $.inArray( language, this.registry.previousLanguages ) === -1 ) {
|
if ( this.registry.previousLanguages.indexOf( language ) === -1 ) {
|
||||||
this.registry.previousLanguages.unshift( language );
|
this.registry.previousLanguages.unshift( language );
|
||||||
this.registry.previousLanguages = this.registry.previousLanguages.slice( 0, 5 );
|
this.registry.previousLanguages = this.registry.previousLanguages.slice( 0, 5 );
|
||||||
}
|
}
|
||||||
@@ -2259,10 +2264,6 @@
|
|||||||
name: 'ट्रांस्लितेरेशन',
|
name: 'ट्रांस्लितेरेशन',
|
||||||
source: 'rules/ne/ne-transliteration.js'
|
source: 'rules/ne/ne-transliteration.js'
|
||||||
},
|
},
|
||||||
'nn-tildeforms': {
|
|
||||||
name: 'Tildemerkt transliterasjon',
|
|
||||||
source: 'rules/nb/nb-tildeforms.js'
|
|
||||||
},
|
|
||||||
'nqo-standard-qwerty': {
|
'nqo-standard-qwerty': {
|
||||||
name: "N'Ko standard QWERTY",
|
name: "N'Ko standard QWERTY",
|
||||||
source: 'rules/nqo/nqo-standard-qwerty.js'
|
source: 'rules/nqo/nqo-standard-qwerty.js'
|
||||||
@@ -2885,7 +2886,7 @@
|
|||||||
},
|
},
|
||||||
nn: {
|
nn: {
|
||||||
autonym: 'Norsk (nynorsk)',
|
autonym: 'Norsk (nynorsk)',
|
||||||
inputmethods: [ 'nb-normforms', 'nn-tildeforms' ]
|
inputmethods: [ 'nb-normforms', 'nb-tildeforms' ]
|
||||||
},
|
},
|
||||||
nqo: {
|
nqo: {
|
||||||
autonym: 'ߒߞߏ',
|
autonym: 'ߒߞߏ',
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
u: 'ŭ'
|
u: 'ŭ'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-jquery/no-each-util
|
||||||
$.each( chars, function ( ascii, accented ) {
|
$.each( chars, function ( ascii, accented ) {
|
||||||
rules.push( [ ascii + '[Xx]', ascii, accented ] );
|
rules.push( [ ascii + '[Xx]', ascii, accented ] );
|
||||||
rules.push( [ accented + '([Xx])', '[Xx]', ascii + '$1' ] );
|
rules.push( [ accented + '([Xx])', '[Xx]', ascii + '$1' ] );
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ksKbd = {
|
var ksKbd = {
|
||||||
id: 'ks-Kbd',
|
id: 'ks-kbd',
|
||||||
name: 'Kbd',
|
name: 'Kashmiri kbd',
|
||||||
description: 'Kbd keyboard for Kashmiri language using Arabic script',
|
description: 'Kbd keyboard for Kashmiri language using Arabic script',
|
||||||
date: '2013-02-09',
|
date: '2013-02-09',
|
||||||
author: 'Parag Nemade',
|
author: 'Parag Nemade',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
description: 'Telugu Transliteration based on RTS',
|
description: 'Telugu Transliteration based on RTS',
|
||||||
date: '2012-10-16',
|
date: '2012-10-16',
|
||||||
URL: 'http://github.com/wikimedia/jquery.ime',
|
URL: 'http://github.com/wikimedia/jquery.ime',
|
||||||
author: 'Veeven and Junaid P V',
|
author: 'Veeven, Junaid P V, Rahimanuddin Shaik',
|
||||||
license: 'GPLv3',
|
license: 'GPLv3',
|
||||||
version: '1.0',
|
version: '1.0',
|
||||||
contextLength: 1,
|
contextLength: 1,
|
||||||
@@ -160,9 +160,9 @@
|
|||||||
[ '~l', 'ఌ' ],
|
[ '~l', 'ఌ' ],
|
||||||
[ 'l', 'ల్' ],
|
[ 'l', 'ల్' ],
|
||||||
[ '@m', 'ఁ' ],
|
[ '@m', 'ఁ' ],
|
||||||
[ '~m', 'ఙ' ],
|
[ '~m', 'ఙ్' ],
|
||||||
[ 'm', 'మ్' ],
|
[ 'm', 'మ్' ],
|
||||||
[ '~n', 'ఞ' ],
|
[ '~n', 'ఞ్' ],
|
||||||
[ 'n', 'న్' ],
|
[ 'n', 'న్' ],
|
||||||
[ 'o', 'ఒ' ],
|
[ 'o', 'ఒ' ],
|
||||||
[ 'p', 'ప్' ],
|
[ 'p', 'ప్' ],
|
||||||
|
|||||||
Reference in New Issue
Block a user