Message.prototype.toString = function() {
if ( !this.map.exists( this.key ) ) {
// Return <key> if key does not exist
- return '<' + key + '>';
+ return '<' + this.key + '>';
}
var text = this.map.get( this.key );
var parameters = this.parameters;
* replacement
*/
this.msg = function( key, parameters ) {
- return mediaWiki.message.apply( mediaWiki.message, arguments );
+ return mediaWiki.message.apply( mediaWiki.message, arguments ).toString();
};
/**
if ( action == 'watch' || action == 'unwatch' ) {
// save the accesskey from the title
var keyCommand = $link.attr( 'title' ).match( /\[.*?\]$/ ) ? $link.attr( 'title' ).match( /\[.*?\]$/ )[0] : '';
- $link.attr( 'title', mediaWiki.message( 'tooltip-ca-' + action ) + ' ' + keyCommand );
+ $link.attr( 'title', mediaWiki.msg( 'tooltip-ca-' + action ) + ' ' + keyCommand );
}
if ( $link.data( 'icon' ) ) {
- $link.attr( 'alt', mediaWiki.message( action ) );
+ $link.attr( 'alt', mediaWiki.msg( action ) );
if ( action == 'watching' || action == 'unwatching' ) {
$link.addClass( 'loading' );
} else {
$link.removeClass( 'loading' );
}
} else {
- $link.html( mediaWiki.message( action ) );
+ $link.html( mediaWiki.msg( action ) );
}
};
if( $link.parents( 'li' ).attr( 'id' ) == 'ca-' + action ) {
$link.parents( 'li' ).attr( 'id', 'ca-' + otheraction );
// update the link text with the new message
- $link.text( mediaWiki.message( otheraction ) );
+ $link.text( mediaWiki.msg( otheraction ) );
}
};
return false;
toggleLink.href = '#';
addClickHandler( toggleLink, function( evt ) { toggleToc(); return killEvt( evt ); } );
- toggleLink.appendChild( document.createTextNode( mediaWiki.message( 'hidetoc' ) ) );
+ toggleLink.appendChild( document.createTextNode( mediaWiki.msg( 'hidetoc' ) ) );
outerSpan.appendChild( document.createTextNode( '[' ) );
outerSpan.appendChild( toggleLink );
var toggleLink = document.getElementById( 'togglelink' );
if ( toc && toggleLink && toc.style.display == 'none' ) {
- changeText( toggleLink, mediaWiki.message( 'hidetoc' ) );
+ changeText( toggleLink, mediaWiki.msg( 'hidetoc' ) );
toc.style.display = 'block';
document.cookie = "hidetoc=0";
tocmain.className = 'toc';
} else {
- changeText( toggleLink, mediaWiki.message( 'showtoc' ) );
+ changeText( toggleLink, mediaWiki.msg( 'showtoc' ) );
toc.style.display = 'none';
document.cookie = "hidetoc=1";
tocmain.className = 'toc tochidden';