From bb88f087b4c631e3115797ac7b0f1d308b8280a2 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Wed, 27 Oct 2010 00:16:32 +0000 Subject: [PATCH] Mostly reverted r75487, making use of a new version of mediaWiki.msg. --- modules/ext.wikiEditor.dialogs.js | 48 ++++++++++----------- modules/jquery.wikiEditor.dialogs.js | 4 +- modules/jquery.wikiEditor.js | 8 ++-- modules/jquery.wikiEditor.preview.js | 2 +- modules/jquery.wikiEditor.publish.js | 2 +- modules/jquery.wikiEditor.templateEditor.js | 2 +- modules/jquery.wikiEditor.toc.js | 4 +- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/modules/ext.wikiEditor.dialogs.js b/modules/ext.wikiEditor.dialogs.js index 12cba68a..253d9776 100644 --- a/modules/ext.wikiEditor.dialogs.js +++ b/modules/ext.wikiEditor.dialogs.js @@ -221,18 +221,18 @@ $( document ).ready( function() { }); // Set labels of tabs based on rel values $(this).find( '[rel]' ).each( function() { - $(this).text( mediaWiki.message( $(this).attr( 'rel' ) ) ); + $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) ); }); // Set tabindexes on form fields $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) ); // Setup the tooltips in the textboxes $( '#wikieditor-toolbar-link-int-target' ) - .data( 'tooltip', mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) ); + .data( 'tooltip', mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) ); $( '#wikieditor-toolbar-link-int-text' ) - .data( 'tooltip', mediaWiki.message( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) ); + .data( 'tooltip', mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) ); $( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' ) .each( function() { - var tooltip = mediaWiki.message( $( this ).attr( 'id' ) + '-tooltip' ); + var tooltip = mediaWiki.msg( $( this ).attr( 'id' ) + '-tooltip' ); if ( $( this ).val() == '' ) $( this ) .addClass( 'wikieditor-toolbar-dialog-hint' ) @@ -301,11 +301,11 @@ $( document ).ready( function() { }); // Add images to the page existence widget, which will be shown mutually exclusively to communicate if // the page exists, does not exist or the title is invalid (like if it contains a | character) - var existsMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-exists' ); - var notexistsMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-notexists' ); - var invalidMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-invalid' ); - var externalMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-external' ); - var loadingMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-loading' ); + var existsMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-exists' ); + var notexistsMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-notexists' ); + var invalidMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-invalid' ); + var externalMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-external' ); + var loadingMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-loading' ); $( '#wikieditor-toolbar-link-int-target-status' ) .append( $( '
' ) .attr( 'id', 'wikieditor-toolbar-link-int-target-status-exists' ) @@ -423,7 +423,7 @@ $( document ).ready( function() { if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip-mode' ) ) text = ""; if ( target == '' ) { - alert( mediaWiki.message( 'wikieditor-toolbar-tool-link-empty' ) ); + alert( mediaWiki.msg( 'wikieditor-toolbar-tool-link-empty' ) ); return; } if ( $.trim( text ) == '' ) { @@ -435,7 +435,7 @@ $( document ).ready( function() { // FIXME: Exactly how fragile is this? if ( $( '#wikieditor-toolbar-link-int-target-status-invalid' ).is( ':visible' ) ) { // Refuse to add links to invalid titles - alert( mediaWiki.message( 'wikieditor-toolbar-tool-link-int-invalid' ) ); + alert( mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-invalid' ) ); return; } @@ -453,12 +453,12 @@ $( document ).ready( function() { if ( match && !$(this).data( 'ignoreLooksInternal' ) ) { var buttons = { }; var that = this; - buttons[ mediaWiki.message( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] = + buttons[ mediaWiki.msg( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] = function() { $( '#wikieditor-toolbar-link-int-target' ).val( match[1] ).change(); $(this).dialog( 'close' ); }; - buttons[ mediaWiki.message( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] = + buttons[ mediaWiki.msg( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] = function() { $(that).data( 'ignoreLooksInternal', true ); $(that).closest( '.ui-dialog' ).find( 'button:first' ).click(); @@ -466,7 +466,7 @@ $( document ).ready( function() { $(this).dialog( 'close' ); }; $.wikiEditor.modules.dialogs.quickDialog( - mediaWiki.message( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ), + mediaWiki.msg( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ), { buttons: buttons } ); return; @@ -615,7 +615,7 @@ $( document ).ready( function() { init: function() { // Insert translated strings into labels $( this ).find( '[rel]' ).each( function() { - $( this ).text( mediaWiki.message( $( this ).attr( 'rel' ) ) ); + $( this ).text( mediaWiki.msg( $( this ).attr( 'rel' ) ) ); } ); }, @@ -759,7 +759,7 @@ $( document ).ready( function() {
', init: function() { $(this).find( '[rel]' ).each( function() { - $(this).text( mediaWiki.message( $(this).attr( 'rel' ) ) ); + $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) ); }); // Set tabindexes on form fields $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) ); @@ -820,19 +820,19 @@ $( document ).ready( function() { var cols = parseInt( colsVal, 10 ); var header = $( '#wikieditor-toolbar-table-dimensions-header' ).is( ':checked' ) ? 1 : 0; if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) { - alert( mediaWiki.message( 'wikieditor-toolbar-tool-table-invalidnumber' ) ); + alert( mediaWiki.msg( 'wikieditor-toolbar-tool-table-invalidnumber' ) ); return; } if ( rows + header == 0 || cols == 0 ) { - alert( mediaWiki.message( 'wikieditor-toolbar-tool-table-zero' ) ); + alert( mediaWiki.msg( 'wikieditor-toolbar-tool-table-zero' ) ); return; } if ( rows * cols > 1000 ) { - alert( mediaWiki.message( 'wikieditor-toolbar-tool-table-toomany', 1000 ) ); + alert( mediaWiki.msg( 'wikieditor-toolbar-tool-table-toomany', 1000 ) ); return; } - var headerText = mediaWiki.message( 'wikieditor-toolbar-tool-table-example-header' ); - var normalText = mediaWiki.message( 'wikieditor-toolbar-tool-table-example' ); + var headerText = mediaWiki.msg( 'wikieditor-toolbar-tool-table-example-header' ); + var normalText = mediaWiki.msg( 'wikieditor-toolbar-tool-table-example' ); var table = ""; for ( var r = 0; r < rows + header; r++ ) { table += "|-\n"; @@ -956,7 +956,7 @@ $( document ).ready( function() { ', init: function() { $(this).find( '[rel]' ).each( function() { - $(this).text( mediaWiki.message( $(this).attr( 'rel' ) ) ); + $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) ); }); // Set tabindexes on form fields $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) ); @@ -986,7 +986,7 @@ $( document ).ready( function() { var regex = new RegExp( searchStr, flags ); } catch( e ) { $( '#wikieditor-toolbar-replace-invalidregex' ) - .text( mediaWiki.message( 'wikieditor-toolbar-tool-replace-invalidregex', + .text( mediaWiki.msg( 'wikieditor-toolbar-tool-replace-invalidregex', e.message ) ) .show(); return; @@ -1040,7 +1040,7 @@ $( document ).ready( function() { offset = newEnd; } $( '#wikieditor-toolbar-replace-success' ) - .text( mediaWiki.message( 'wikieditor-toolbar-tool-replace-success', match.length ) ) + .text( mediaWiki.msg( 'wikieditor-toolbar-tool-replace-success', match.length ) ) .show(); $(this).data( 'offset', 0 ); } else { diff --git a/modules/jquery.wikiEditor.dialogs.js b/modules/jquery.wikiEditor.dialogs.js index 80818406..f0fcfb03 100644 --- a/modules/jquery.wikiEditor.dialogs.js +++ b/modules/jquery.wikiEditor.dialogs.js @@ -114,10 +114,10 @@ fn: { configuration.title = $.wikiEditor.autoMsg( module, 'title' ); // Transform messages in keys // Stupid JS won't let us do stuff like - // foo = { mediaWiki.message( 'bar' ): baz } + // foo = { mediaWiki.msg( 'bar' ): baz } configuration.newButtons = {}; for ( msg in configuration.buttons ) - configuration.newButtons[mediaWiki.message( msg )] = configuration.buttons[msg]; + configuration.newButtons[mediaWiki.msg( msg )] = configuration.buttons[msg]; configuration.buttons = configuration.newButtons; // Create the dialog
var dialogDiv = $( '
' ) diff --git a/modules/jquery.wikiEditor.js b/modules/jquery.wikiEditor.js index ce3c45df..4583486e 100644 --- a/modules/jquery.wikiEditor.js +++ b/modules/jquery.wikiEditor.js @@ -115,7 +115,7 @@ $.wikiEditor = { return false; }, /** - * Provides a way to extract messages from objects. Wraps the mediaWiki.message() function, which + * Provides a way to extract messages from objects. Wraps the mediaWiki.msg() function, which * may eventually become a wrapper for some kind of core MW functionality. * * @param object Object to extract messages from @@ -139,9 +139,9 @@ $.wikiEditor = { } else if ( property + 'Msg' in object ) { var p = object[property + 'Msg']; if ( $.isArray( p ) && p.length >= 2 ) { - return mediaWiki.message.apply( p ).toString(); + return mediaWiki.msg.apply( mediaWiki.msg, p ); } else { - return mediaWiki.message( p ).toString(); + return mediaWiki.msg( p ); } } else { return ''; @@ -542,7 +542,7 @@ if ( !context || typeof context == 'undefined' ) { /* Disabling our loading div for now var $loader = $( '
' ) .addClass( 'wikiEditor-ui-loading' ) - .append( $( '' + mediaWiki.message( 'wikieditor-loading' ) + '' ) + .append( $( '' + mediaWiki.msg( 'wikieditor-loading' ) + '' ) .css( 'marginTop', context.$textarea.height() / 2 ) ); */ // Encapsulate the textarea with some containers for layout diff --git a/modules/jquery.wikiEditor.preview.js b/modules/jquery.wikiEditor.preview.js index 1fc6db71..090355d8 100644 --- a/modules/jquery.wikiEditor.preview.js +++ b/modules/jquery.wikiEditor.preview.js @@ -134,7 +134,7 @@ fn: { } } ); - var loadingMsg = mediaWiki.message( 'wikieditor-preview-loading' ); + var loadingMsg = mediaWiki.msg( 'wikieditor-preview-loading' ); context.modules.preview.$preview .add( context.$changesTab ) .append( $( '
' ) diff --git a/modules/jquery.wikiEditor.publish.js b/modules/jquery.wikiEditor.publish.js index 47834dc7..a7f9b4a2 100644 --- a/modules/jquery.wikiEditor.publish.js +++ b/modules/jquery.wikiEditor.publish.js @@ -63,7 +63,7 @@ fn: {
', init: function() { $(this).find( '[rel]' ).each( function() { - $(this).text( mediaWiki.message( $(this).attr( 'rel' ) ) ); + $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) ); }); /* REALLY DIRTY HACK! */ diff --git a/modules/jquery.wikiEditor.templateEditor.js b/modules/jquery.wikiEditor.templateEditor.js index 4369a713..cbe460cf 100644 --- a/modules/jquery.wikiEditor.templateEditor.js +++ b/modules/jquery.wikiEditor.templateEditor.js @@ -316,7 +316,7 @@ fn: { ', init: function() { $(this).find( '[rel]' ).each( function() { - $(this).text( mediaWiki.message( $(this).attr( 'rel' ) ) ); + $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) ); } ); }, dialog: { diff --git a/modules/jquery.wikiEditor.toc.js b/modules/jquery.wikiEditor.toc.js index 25457e1a..b4d4d0de 100644 --- a/modules/jquery.wikiEditor.toc.js +++ b/modules/jquery.wikiEditor.toc.js @@ -510,7 +510,7 @@ fn: { return false; } ) .find( 'a' ) - .text( mediaWiki.message( 'wikieditor-toc-hide' ) ); + .text( mediaWiki.msg( 'wikieditor-toc-hide' ) ); $expandControl .addClass( 'wikiEditor-ui-toc-expandControl' ) .append( '' ) @@ -527,7 +527,7 @@ fn: { } ) .hide() .find( 'a' ) - .text( mediaWiki.message( 'wikieditor-toc-show' ) ); + .text( mediaWiki.msg( 'wikieditor-toc-show' ) ); $collapseControl.insertBefore( context.modules.toc.$toc ); context.$ui.find( '.wikiEditor-ui-left .wikiEditor-ui-top' ).append( $expandControl ); }