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
$(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( $( '<div />' )
.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() {
</div></div>',
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() {
</fieldset>',
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 {

View file

@ -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 <div>
var dialogDiv = $( '<div />' )

View file

@ -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 = $( '<div></div>' )
.addClass( 'wikiEditor-ui-loading' )
.append( $( '<span>' + mediaWiki.message( 'wikieditor-loading' ) + '</span>' )
.append( $( '<span>' + mediaWiki.msg( 'wikieditor-loading' ) + '</span>' )
.css( 'marginTop', context.$textarea.height() / 2 ) );
*/
// 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
.add( context.$changesTab )
.append( $( '<div />' )

View file

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

View file

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

View file

@ -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( '<a href="#" />' )
@ -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 );
}