"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "resources/src/jquery/jquery.accessKeyLabel.js" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

jquery.accessKeyLabel.js  (mediawiki-1.31.1):jquery.accessKeyLabel.js  (mediawiki-1.32.0)
/** /**
* jQuery plugin to update the tooltip to show the correct access key * jQuery plugin to update the tooltip to show the correct access key
* *
* @class jQuery.plugin.accessKeyLabel * @class jQuery.plugin.accessKeyLabel
*/ */
( function ( $, mw ) { ( function () {
// Cached access key modifiers for used browser // Cached access key modifiers for used browser
var cachedAccessKeyModifiers, var cachedAccessKeyModifiers,
// Whether to use 'test-' instead of correct prefix (used for tes ting) // Whether to use 'test-' instead of correct prefix (used for tes ting)
useTestPrefix = false, useTestPrefix = false,
// tag names which can have a label tag // tag names which can have a label tag
// https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Conten t_categories#Form-associated_content // https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Conten t_categories#Form-associated_content
labelable = 'button, input, textarea, keygen, meter, output, prog ress, select'; labelable = 'button, input, textarea, keygen, meter, output, prog ress, select';
skipping to change at line 131 skipping to change at line 131
/** /**
* Update the title for an element (on the element with the access key or it's label) to show * Update the title for an element (on the element with the access key or it's label) to show
* the correct access key label. * the correct access key label.
* *
* @private * @private
* @param {HTMLElement} element Element with the accesskey * @param {HTMLElement} element Element with the accesskey
* @param {HTMLElement} titleElement Element with the title to update (ma y be the same as `element`) * @param {HTMLElement} titleElement Element with the title to update (ma y be the same as `element`)
*/ */
function updateTooltipOnElement( element, titleElement ) { 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; oldTitle = titleElement.title;
if ( !oldTitle ) { if ( !oldTitle ) {
// don't add a title if the element didn't have one befor e // don't add a title if the element didn't have one befor e
return; return;
} }
parts = ( mw.msg( 'word-separator' ) + mw.msg( 'brackets' ) ).spl it( '$1' ); parts = ( separatorMsg + mw.message( 'brackets' ).plain() ).split ( '$1' );
regexp = new RegExp( parts.map( mw.RegExp.escape ).join( '.*?' ) + '$' ); regexp = new RegExp( parts.map( mw.RegExp.escape ).join( '.*?' ) + '$' );
newTitle = oldTitle.replace( regexp, '' ); newTitle = oldTitle.replace( regexp, '' );
accessKeyLabel = getAccessKeyLabel( element ); accessKeyLabel = getAccessKeyLabel( element );
if ( accessKeyLabel ) { if ( accessKeyLabel ) {
// Should be build the same as in Linker::titleAttrib // Should be build the same as in Linker::titleAttrib
newTitle += mw.msg( 'word-separator' ) + mw.msg( 'bracket s', accessKeyLabel ); newTitle += separatorMsg + mw.message( 'brackets', access KeyLabel ).plain();
} }
if ( oldTitle !== newTitle ) { if ( oldTitle !== newTitle ) {
titleElement.title = newTitle; titleElement.title = newTitle;
} }
} }
/** /**
* Update the title for an element to show the correct access key label. * Update the title for an element to show the correct access key label.
* *
* @private * @private
skipping to change at line 238 skipping to change at line 239
*/ */
$.fn.updateTooltipAccessKeys.setTestMode = function ( mode ) { $.fn.updateTooltipAccessKeys.setTestMode = function ( mode ) {
useTestPrefix = mode; useTestPrefix = mode;
}; };
/** /**
* @class jQuery * @class jQuery
* @mixins jQuery.plugin.accessKeyLabel * @mixins jQuery.plugin.accessKeyLabel
*/ */
}( jQuery, mediaWiki ) ); }() );
 End of changes. 5 change blocks. 
4 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)