diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js index e47fbc4d..953597a9 100644 --- a/lib/jquery.ime/jquery.ime.js +++ b/lib/jquery.ime/jquery.ime.js @@ -1,6 +1,6 @@ -/*! jquery.ime - v0.2.0+20190521 +/*! jquery.ime - v0.2.0+20200106 * 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 ( $ ) { 'use strict'; @@ -10,12 +10,6 @@ // rangy is defined in the rangy library /* global rangy */ - function arrayKeys( obj ) { - return $.map( obj, function ( element, index ) { - return index; - } ); - } - /** * private function for debugging * @param {jQuery} [$obj] @@ -67,7 +61,7 @@ this.$element = $( element ); this.textEntry = textEntry; // 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 ); if ( this.options.imePath ) { // Set the global IME path from the one specified to the instance @@ -186,7 +180,7 @@ .concat( patterns ); } - if ( $.isFunction( patterns ) ) { + if ( typeof patterns === 'function' ) { // For backwards compatibility, allow the rule functions to return plain // string. Determine noop by checking whether input is different from // 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' ) && !$element.prop( 'readonly' ) && !$element.prop( 'disabled' ) && + // eslint-disable-next-line no-jquery/no-class-state !$element.hasClass( 'noime' ); }; @@ -674,6 +669,7 @@ * @inheritdoc TextEntry */ ContentEditableEntry.static.canWrap = function ( $element ) { + // eslint-disable-next-line no-jquery/no-class-state return $element.is( '[contenteditable]' ) && !$element.hasClass( 'noime' ); }; @@ -918,13 +914,11 @@ } function toggleMenuItem() { - return $( '
' ).append( + return $( '
' ).addClass( 'ime-disable selectable-row' ).append( $( '' ) - .attr( { - 'class': 'ime-disable-link', - 'data-i18n': 'jquery-ime-disable-text' - } ) + .addClass( 'ime-disable-link' ) .addClass( 'ime-checked' ) + .attr( 'data-i18n', 'jquery-ime-disable-text' ) .text( 'System input method' ), $( '' ) .addClass( 'ime-disable-shortcut' ) @@ -956,7 +950,7 @@ // 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 = $( '