// Cached access key prefix for used browser
var cachedAccessKeyPrefix,
- // Wether to use 'test-' instead of correct prefix (used for testing)
+ // Whether to use 'test-' instead of correct prefix (used for testing)
useTestPrefix = false,
// tag names which can have a label tag
*/
function updateTooltipOnElement( element, titleElement ) {
var array = ( mw.msg( 'word-separator' ) + mw.msg( 'brackets' ) ).split( '$1' ),
- regexp = new RegExp( $.map( array, $.escapeRE ).join( '.*?' ) + '$' ),
+ regexp = new RegExp( $.map( array, mw.RegExp.escape ).join( '.*?' ) + '$' ),
oldTitle = titleElement.title,
rawTitle = oldTitle.replace( regexp, '' ),
newTitle = rawTitle,
if ( id ) {
$label = $( 'label[for="' + id + '"]' );
if ( $label.length === 1 ) {
- updateTooltipOnElement( element, $label[0] );
+ updateTooltipOnElement( element, $label[ 0 ] );
}
}
// Search it as parent, because the form control can also be inside the label element itself
$labelParent = $element.parents( 'label' );
if ( $labelParent.length === 1 ) {
- updateTooltipOnElement( element, $labelParent[0] );
+ updateTooltipOnElement( element, $labelParent[ 0 ] );
}
}
}