Mostly reverted r75487, making use of a new version of mediaWiki.msg.
authorTrevor Parscal <tparscal@users.mediawiki.org>
Wed, 27 Oct 2010 00:16:32 +0000 (00:16 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Wed, 27 Oct 2010 00:16:32 +0000 (00:16 +0000)
resources/mediawiki/mediawiki.js
skins/common/ajaxwatch.js
skins/common/wikibits.js

index b52a3eb..5903541 100644 (file)
@@ -142,7 +142,7 @@ window.mediaWiki = new ( function( $ ) {
        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;
@@ -246,7 +246,7 @@ window.mediaWiki = new ( function( $ ) {
         * replacement
         */
        this.msg = function( key, parameters ) {
-               return mediaWiki.message.apply( mediaWiki.message, arguments );
+               return mediaWiki.message.apply( mediaWiki.message, arguments ).toString();
        };
        
        /**
index e051229..a1682f0 100644 (file)
@@ -12,17 +12,17 @@ wgAjaxWatch.setLinkText = function( $link, action ) {
        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 ) );
        }
 };
 
@@ -110,7 +110,7 @@ $( document ).ready( function() {
                        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;
index 1ae7f62..b01f309 100644 (file)
@@ -156,7 +156,7 @@ window.showTocToggle = function() {
                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 );
@@ -198,12 +198,12 @@ window.toggleToc = function() {
        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';