X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.accessKeyLabel.js;h=cdc5808ca7756c7574637cc0ed2fa9d9c3ade1e0;hp=91b70359554da9e7841caa8aa2d4e5f7dd2e8ff0;hb=1de7117197761961736ea43b237599569eee93a2;hpb=0e9194405a736b6e2e9b03297f02ca1aa75a7bc1 diff --git a/resources/src/jquery/jquery.accessKeyLabel.js b/resources/src/jquery/jquery.accessKeyLabel.js index 91b7035955..cdc5808ca7 100644 --- a/resources/src/jquery/jquery.accessKeyLabel.js +++ b/resources/src/jquery/jquery.accessKeyLabel.js @@ -3,7 +3,7 @@ * * @class jQuery.plugin.accessKeyLabel */ -( function ( $, mw ) { +( function () { // Cached access key modifiers for used browser var cachedAccessKeyModifiers, @@ -128,7 +128,8 @@ * @param {HTMLElement} titleElement Element with the title to update (may be the same as `element`) */ function updateTooltipOnElement( element, titleElement ) { - var oldTitle, parts, regexp, newTitle, accessKeyLabel; + var oldTitle, parts, regexp, newTitle, accessKeyLabel, + separatorMsg = mw.message( 'word-separator' ).plain(); oldTitle = titleElement.title; if ( !oldTitle ) { @@ -136,14 +137,14 @@ return; } - parts = ( mw.msg( 'word-separator' ) + mw.msg( 'brackets' ) ).split( '$1' ); + parts = ( separatorMsg + mw.message( 'brackets' ).plain() ).split( '$1' ); regexp = new RegExp( parts.map( mw.RegExp.escape ).join( '.*?' ) + '$' ); newTitle = oldTitle.replace( regexp, '' ); accessKeyLabel = getAccessKeyLabel( element ); if ( accessKeyLabel ) { // Should be build the same as in Linker::titleAttrib - newTitle += mw.msg( 'word-separator' ) + mw.msg( 'brackets', accessKeyLabel ); + newTitle += separatorMsg + mw.message( 'brackets', accessKeyLabel ).plain(); } if ( oldTitle !== newTitle ) { titleElement.title = newTitle; @@ -235,4 +236,4 @@ * @mixins jQuery.plugin.accessKeyLabel */ -}( jQuery, mediaWiki ) ); +}() );