diff options
Diffstat (limited to 'MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js')
-rw-r--r-- | MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js index f6043623..9004b4d5 100644 --- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js +++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js @@ -79,7 +79,7 @@ }; } $.extend( displaySettingsOptions, uls.position() ); - $displaySettings.languagesettings( displaySettingsOptions ).click(); + $displaySettings.languagesettings( displaySettingsOptions ).trigger( 'click' ); } ); } @@ -104,7 +104,7 @@ }, top: position.top, left: position.left - } ).click(); + } ).trigger( 'click' ); } ); } @@ -140,15 +140,15 @@ // if the mouse is over the tooltip, do not hide $( '.uls-tipsy' ).on( 'mouseover', function () { - window.clearTimeout( tipsyTimer ); + clearTimeout( tipsyTimer ); } ).on( 'mouseout', function () { - tipsyTimer = window.setTimeout( hideTipsy, timeout ); + tipsyTimer = setTimeout( hideTipsy, timeout ); } ); // hide the tooltip when clicked on it $( '.uls-tipsy' ).on( 'click', hideTipsy ); - tipsyTimer = window.setTimeout( hideTipsy, timeout ); + tipsyTimer = setTimeout( hideTipsy, timeout ); } // remove any existing popups @@ -162,7 +162,7 @@ ulsPopupPosition = 'after'; } // Reverse for RTL - if ( $( 'html' ).prop( 'dir' ) === 'rtl' ) { + if ( $( document.documentElement ).prop( 'dir' ) === 'rtl' ) { ulsPopupPosition = ( ulsPopupPosition === 'after' ) ? 'before' : 'after'; } } else { @@ -182,7 +182,7 @@ .text( previousAutonym ) .prop( { href: '', - 'class': 'uls-prevlang-link', + class: 'uls-prevlang-link', lang: previousLang, // We could get dir from uls.data, // but we are trying to avoid loading it @@ -201,7 +201,7 @@ mw.hook( 'mw.uls.language.revert' ).fire( deferred ); // Delay is zero if event logging is not enabled - window.setTimeout( function () { + setTimeout( function () { deferred.resolve(); }, mw.config.get( 'wgULSEventLogging' ) * 500 ); } ); @@ -212,14 +212,16 @@ messageKey = 'ext-uls-undo-language-tooltip-text'; } + // Message keys listed above + // eslint-disable-next-line mediawiki/msg-doc return $( '<p>' ).append( mw.message( messageKey, $link ).parseDom() ); }() ) } ); - ulsPopup.$element.appendTo( 'body' ); + ulsPopup.$element.appendTo( document.body ); // The interlanguage position needs some time to settle down - window.setTimeout( function () { + setTimeout( function () { // Show the tipsy tooltip on page load. showTipsy( 6000 ); }, 700 ); @@ -227,6 +229,7 @@ // manually show the tooltip $ulsTrigger.on( 'mouseover', function () { // show only if the ULS panel is not shown + // eslint-disable-next-line no-jquery/no-sizzle if ( !$( '.uls-menu:visible' ).length ) { showTipsy( 3000 ); } @@ -293,7 +296,6 @@ if ( ulsTriggerOffset.left > $( window ).width() / 2 ) { this.left = ulsTriggerOffset.left - this.$window.width() - caretRadius; this.$window.removeClass( 'selector-left' ).addClass( 'selector-right' ); - } else { this.left = ulsTriggerOffset.left + ulsTriggerWidth + caretRadius; this.$window.removeClass( 'selector-right' ).addClass( 'selector-left' ); @@ -311,7 +313,7 @@ }; mw.loader.using( mw.uls.languageSettingsModules, function () { - $ulsTrigger.languagesettings( languageSettingsOptions ).click(); + $ulsTrigger.languagesettings( languageSettingsOptions ).trigger( 'click' ); } ); e.stopPropagation(); @@ -372,7 +374,7 @@ // Allow styles to apply first and position to work by // delaying the activation after them. - window.setTimeout( function () { + setTimeout( function () { $ulsTrigger.trigger( 'click', eventParams ); }, 0 ); } ); @@ -432,9 +434,9 @@ function initIme() { var imeSelector = mw.config.get( 'wgULSImeSelectors' ).join( ', ' ); - $( 'body' ).on( 'focus.imeinit', imeSelector, function () { + $( document.body ).on( 'focus.imeinit', imeSelector, function () { var $input = $( this ); - $( 'body' ).off( '.imeinit' ); + $( document.body ).off( '.imeinit' ); mw.loader.using( 'ext.uls.ime', function () { mw.ime.setup(); mw.ime.handleFocus( $input ); |