Mostly reverted r75487, making use of a new version of mediaWiki.msg.

This commit is contained in:
Trevor Parscal 2010-10-27 00:16:32 +00:00
parent 55a8f66322
commit bb88f087b4
7 changed files with 35 additions and 35 deletions

View file

@ -221,18 +221,18 @@ $( document ).ready( function() {
}); });
// Set labels of tabs based on rel values // Set labels of tabs based on rel values
$(this).find( '[rel]' ).each( 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 // Set tabindexes on form fields
$.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) ); $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) );
// Setup the tooltips in the textboxes // Setup the tooltips in the textboxes
$( '#wikieditor-toolbar-link-int-target' ) $( '#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' ) $( '#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' ) $( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' )
.each( function() { .each( function() {
var tooltip = mediaWiki.message( $( this ).attr( 'id' ) + '-tooltip' ); var tooltip = mediaWiki.msg( $( this ).attr( 'id' ) + '-tooltip' );
if ( $( this ).val() == '' ) if ( $( this ).val() == '' )
$( this ) $( this )
.addClass( 'wikieditor-toolbar-dialog-hint' ) .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 // 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) // 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 existsMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-exists' );
var notexistsMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-notexists' ); var notexistsMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-notexists' );
var invalidMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-invalid' ); var invalidMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-invalid' );
var externalMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-external' ); var externalMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-external' );
var loadingMsg = mediaWiki.message( 'wikieditor-toolbar-tool-link-int-target-status-loading' ); var loadingMsg = mediaWiki.msg( 'wikieditor-toolbar-tool-link-int-target-status-loading' );
$( '#wikieditor-toolbar-link-int-target-status' ) $( '#wikieditor-toolbar-link-int-target-status' )
.append( $( '<div />' ) .append( $( '<div />' )
.attr( 'id', 'wikieditor-toolbar-link-int-target-status-exists' ) .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' ) ) if ( $( '#wikieditor-toolbar-link-int-text' ).data( 'tooltip-mode' ) )
text = ""; text = "";
if ( target == '' ) { if ( target == '' ) {
alert( mediaWiki.message( 'wikieditor-toolbar-tool-link-empty' ) ); alert( mediaWiki.msg( 'wikieditor-toolbar-tool-link-empty' ) );
return; return;
} }
if ( $.trim( text ) == '' ) { if ( $.trim( text ) == '' ) {
@ -435,7 +435,7 @@ $( document ).ready( function() {
// FIXME: Exactly how fragile is this? // FIXME: Exactly how fragile is this?
if ( $( '#wikieditor-toolbar-link-int-target-status-invalid' ).is( ':visible' ) ) { if ( $( '#wikieditor-toolbar-link-int-target-status-invalid' ).is( ':visible' ) ) {
// Refuse to add links to invalid titles // 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; return;
} }
@ -453,12 +453,12 @@ $( document ).ready( function() {
if ( match && !$(this).data( 'ignoreLooksInternal' ) ) { if ( match && !$(this).data( 'ignoreLooksInternal' ) ) {
var buttons = { }; var buttons = { };
var that = this; var that = this;
buttons[ mediaWiki.message( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] = buttons[ mediaWiki.msg( 'wikieditor-toolbar-tool-link-lookslikeinternal-int' ) ] =
function() { function() {
$( '#wikieditor-toolbar-link-int-target' ).val( match[1] ).change(); $( '#wikieditor-toolbar-link-int-target' ).val( match[1] ).change();
$(this).dialog( 'close' ); $(this).dialog( 'close' );
}; };
buttons[ mediaWiki.message( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] = buttons[ mediaWiki.msg( 'wikieditor-toolbar-tool-link-lookslikeinternal-ext' ) ] =
function() { function() {
$(that).data( 'ignoreLooksInternal', true ); $(that).data( 'ignoreLooksInternal', true );
$(that).closest( '.ui-dialog' ).find( 'button:first' ).click(); $(that).closest( '.ui-dialog' ).find( 'button:first' ).click();
@ -466,7 +466,7 @@ $( document ).ready( function() {
$(this).dialog( 'close' ); $(this).dialog( 'close' );
}; };
$.wikiEditor.modules.dialogs.quickDialog( $.wikiEditor.modules.dialogs.quickDialog(
mediaWiki.message( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ), mediaWiki.msg( 'wikieditor-toolbar-tool-link-lookslikeinternal', match[1] ),
{ buttons: buttons } { buttons: buttons }
); );
return; return;
@ -615,7 +615,7 @@ $( document ).ready( function() {
init: function() { init: function() {
// Insert translated strings into labels // Insert translated strings into labels
$( this ).find( '[rel]' ).each( function() { $( 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() {
</div></div>', </div></div>',
init: function() { init: function() {
$(this).find( '[rel]' ).each( 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 // Set tabindexes on form fields
$.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) ); $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) );
@ -820,19 +820,19 @@ $( document ).ready( function() {
var cols = parseInt( colsVal, 10 ); var cols = parseInt( colsVal, 10 );
var header = $( '#wikieditor-toolbar-table-dimensions-header' ).is( ':checked' ) ? 1 : 0; var header = $( '#wikieditor-toolbar-table-dimensions-header' ).is( ':checked' ) ? 1 : 0;
if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) { 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; return;
} }
if ( rows + header == 0 || cols == 0 ) { if ( rows + header == 0 || cols == 0 ) {
alert( mediaWiki.message( 'wikieditor-toolbar-tool-table-zero' ) ); alert( mediaWiki.msg( 'wikieditor-toolbar-tool-table-zero' ) );
return; return;
} }
if ( rows * cols > 1000 ) { if ( rows * cols > 1000 ) {
alert( mediaWiki.message( 'wikieditor-toolbar-tool-table-toomany', 1000 ) ); alert( mediaWiki.msg( 'wikieditor-toolbar-tool-table-toomany', 1000 ) );
return; return;
} }
var headerText = mediaWiki.message( 'wikieditor-toolbar-tool-table-example-header' ); var headerText = mediaWiki.msg( 'wikieditor-toolbar-tool-table-example-header' );
var normalText = mediaWiki.message( 'wikieditor-toolbar-tool-table-example' ); var normalText = mediaWiki.msg( 'wikieditor-toolbar-tool-table-example' );
var table = ""; var table = "";
for ( var r = 0; r < rows + header; r++ ) { for ( var r = 0; r < rows + header; r++ ) {
table += "|-\n"; table += "|-\n";
@ -956,7 +956,7 @@ $( document ).ready( function() {
</fieldset>', </fieldset>',
init: function() { init: function() {
$(this).find( '[rel]' ).each( 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 // Set tabindexes on form fields
$.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) ); $.wikiEditor.modules.dialogs.fn.setTabindexes( $(this).find( 'input' ).not( '[tabindex]' ) );
@ -986,7 +986,7 @@ $( document ).ready( function() {
var regex = new RegExp( searchStr, flags ); var regex = new RegExp( searchStr, flags );
} catch( e ) { } catch( e ) {
$( '#wikieditor-toolbar-replace-invalidregex' ) $( '#wikieditor-toolbar-replace-invalidregex' )
.text( mediaWiki.message( 'wikieditor-toolbar-tool-replace-invalidregex', .text( mediaWiki.msg( 'wikieditor-toolbar-tool-replace-invalidregex',
e.message ) ) e.message ) )
.show(); .show();
return; return;
@ -1040,7 +1040,7 @@ $( document ).ready( function() {
offset = newEnd; offset = newEnd;
} }
$( '#wikieditor-toolbar-replace-success' ) $( '#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(); .show();
$(this).data( 'offset', 0 ); $(this).data( 'offset', 0 );
} else { } else {

View file

@ -114,10 +114,10 @@ fn: {
configuration.title = $.wikiEditor.autoMsg( module, 'title' ); configuration.title = $.wikiEditor.autoMsg( module, 'title' );
// Transform messages in keys // Transform messages in keys
// Stupid JS won't let us do stuff like // Stupid JS won't let us do stuff like
// foo = { mediaWiki.message( 'bar' ): baz } // foo = { mediaWiki.msg( 'bar' ): baz }
configuration.newButtons = {}; configuration.newButtons = {};
for ( msg in configuration.buttons ) 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; configuration.buttons = configuration.newButtons;
// Create the dialog <div> // Create the dialog <div>
var dialogDiv = $( '<div />' ) var dialogDiv = $( '<div />' )

View file

@ -115,7 +115,7 @@ $.wikiEditor = {
return false; 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. * may eventually become a wrapper for some kind of core MW functionality.
* *
* @param object Object to extract messages from * @param object Object to extract messages from
@ -139,9 +139,9 @@ $.wikiEditor = {
} else if ( property + 'Msg' in object ) { } else if ( property + 'Msg' in object ) {
var p = object[property + 'Msg']; var p = object[property + 'Msg'];
if ( $.isArray( p ) && p.length >= 2 ) { if ( $.isArray( p ) && p.length >= 2 ) {
return mediaWiki.message.apply( p ).toString(); return mediaWiki.msg.apply( mediaWiki.msg, p );
} else { } else {
return mediaWiki.message( p ).toString(); return mediaWiki.msg( p );
} }
} else { } else {
return ''; return '';
@ -542,7 +542,7 @@ if ( !context || typeof context == 'undefined' ) {
/* Disabling our loading div for now /* Disabling our loading div for now
var $loader = $( '<div></div>' ) var $loader = $( '<div></div>' )
.addClass( 'wikiEditor-ui-loading' ) .addClass( 'wikiEditor-ui-loading' )
.append( $( '<span>' + mediaWiki.message( 'wikieditor-loading' ) + '</span>' ) .append( $( '<span>' + mediaWiki.msg( 'wikieditor-loading' ) + '</span>' )
.css( 'marginTop', context.$textarea.height() / 2 ) ); .css( 'marginTop', context.$textarea.height() / 2 ) );
*/ */
// Encapsulate the textarea with some containers for layout // Encapsulate the textarea with some containers for layout

View file

@ -134,7 +134,7 @@ fn: {
} }
} ); } );
var loadingMsg = mediaWiki.message( 'wikieditor-preview-loading' ); var loadingMsg = mediaWiki.msg( 'wikieditor-preview-loading' );
context.modules.preview.$preview context.modules.preview.$preview
.add( context.$changesTab ) .add( context.$changesTab )
.append( $( '<div />' ) .append( $( '<div />' )

View file

@ -63,7 +63,7 @@ fn: {
</div>', </div>',
init: function() { init: function() {
$(this).find( '[rel]' ).each( function() { $(this).find( '[rel]' ).each( function() {
$(this).text( mediaWiki.message( $(this).attr( 'rel' ) ) ); $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) );
}); });
/* REALLY DIRTY HACK! */ /* REALLY DIRTY HACK! */

View file

@ -316,7 +316,7 @@ fn: {
</fieldset>', </fieldset>',
init: function() { init: function() {
$(this).find( '[rel]' ).each( function() { $(this).find( '[rel]' ).each( function() {
$(this).text( mediaWiki.message( $(this).attr( 'rel' ) ) ); $(this).text( mediaWiki.msg( $(this).attr( 'rel' ) ) );
} ); } );
}, },
dialog: { dialog: {

View file

@ -510,7 +510,7 @@ fn: {
return false; return false;
} ) } )
.find( 'a' ) .find( 'a' )
.text( mediaWiki.message( 'wikieditor-toc-hide' ) ); .text( mediaWiki.msg( 'wikieditor-toc-hide' ) );
$expandControl $expandControl
.addClass( 'wikiEditor-ui-toc-expandControl' ) .addClass( 'wikiEditor-ui-toc-expandControl' )
.append( '<a href="#" />' ) .append( '<a href="#" />' )
@ -527,7 +527,7 @@ fn: {
} ) } )
.hide() .hide()
.find( 'a' ) .find( 'a' )
.text( mediaWiki.message( 'wikieditor-toc-show' ) ); .text( mediaWiki.msg( 'wikieditor-toc-show' ) );
$collapseControl.insertBefore( context.modules.toc.$toc ); $collapseControl.insertBefore( context.modules.toc.$toc );
context.$ui.find( '.wikiEditor-ui-left .wikiEditor-ui-top' ).append( $expandControl ); context.$ui.find( '.wikiEditor-ui-left .wikiEditor-ui-top' ).append( $expandControl );
} }