r84154 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84153‎ | r84154 | r84155 >
Date:05:30, 17 March 2011
Author:neilk
Status:deferred
Tags:
Comment:
use .msg where possible
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUtil.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js
@@ -106,42 +106,36 @@
107107
108108 _this.$form = $j( '<form/>' );
109109
 110+ var $authorInput2 = $j( '<input>' ).attr( { name: "author2", type: "text" } ).addClass( 'mwe-upwiz-sign' );
110111 var $standardDiv = $j( '<div />' ).append(
111112 $j( '<label for="author2" generated="true" class="mwe-validator-error" style="display:block;"/>' ),
112 - $j( '<p>' )
113 - .html( gM( 'mwe-upwiz-source-ownwork-assert',
114 - uploadCount,
115 - '<span class="mwe-standard-author-input"></span>' )
116 - ),
117 - $j( '<p class="mwe-small-print" />' ).append( gM( 'mwe-upwiz-source-ownwork-assert-note' ) )
 113+ $j( '<p>' ).msg( 'mwe-upwiz-source-ownwork-assert',
 114+ uploadCount,
 115+ $authorInput2 ),
 116+ $j( '<p class="mwe-small-print" />' ).msg( 'mwe-upwiz-source-ownwork-assert-note' )
118117 );
119 - $standardDiv.find( '.mwe-standard-author-input' ).append( $j( '<input name="author2" type="text" class="mwe-upwiz-sign" />' ) );
120118
121119 var $customDiv = $j('<div/>').append(
122120 $j( '<label for="author" generated="true" class="mwe-validator-error" style="display:block;"/>' ),
123 - $j( '<p>' )
124 - .html( gM( 'mwe-upwiz-source-ownwork-assert-custom',
125 - uploadCount,
126 - '<span class="mwe-custom-author-input"></span>' ) ),
 121+ $j( '<p>' ).msg( 'mwe-upwiz-source-ownwork-assert-custom',
 122+ uploadCount,
 123+ _this.authorInput ),
127124 licenseInputDiv
128125 );
129 - // have to add the author input this way -- gM() will flatten it to a string and we'll lose it as a dom object
130 - $customDiv.find( '.mwe-custom-author-input' ).append( _this.authorInput );
131126
132 -
133127 var $crossfader = $j( '<div>' ).append( $standardDiv, $customDiv );
134128 var $toggler = $j( '<p class="mwe-more-options" style="text-align: right" />' )
135129 .append( $j( '<a />' )
136 - .append( gM( 'mwe-upwiz-license-show-all' ) )
 130+ .msg( 'mwe-upwiz-license-show-all' )
137131 .click( function() {
138132 _this.formValidator.resetForm();
139133 if ( $crossfader.data( 'crossfadeDisplay' ) === $customDiv ) {
140134 _this.licenseInput.setDefaultValues();
141135 $crossfader.morphCrossfade( $standardDiv );
142 - $j( this ).html( gM( 'mwe-upwiz-license-show-all' ) );
 136+ $j( this ).msg( 'mwe-upwiz-license-show-all' );
143137 } else {
144138 $crossfader.morphCrossfade( $customDiv );
145 - $j( this ).html( gM( 'mwe-upwiz-license-show-recommended' ) );
 139+ $j( this ).msg( 'mwe-upwiz-license-show-recommended' );
146140 }
147141 } ) );
148142
@@ -237,7 +231,7 @@
238232 var $formFields = $j( '<div class="mwe-upwiz-deed-form-internal"/>' );
239233
240234 if ( uploadCount > 1 ) {
241 - $formFields.append( $j( '<div />' ).append( gM( 'mwe-upwiz-source-thirdparty-custom-multiple-intro' ) ) );
 235+ $formFields.append( $j( '<div />' ).msg( 'mwe-upwiz-source-thirdparty-custom-multiple-intro' ) );
242236 }
243237
244238 $formFields.append (
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUtil.js
@@ -24,13 +24,11 @@
2525 if ( open ) {
2626 moreDiv.show(); // maskSafeShow();
2727 /* when open, show control to close */
28 - $toggleLink.html( gM( 'mwe-upwiz-fewer-options' ) );
29 - $toggleLink.addClass( "mwe-upwiz-toggler-open" );
 28+ $toggleLink.msg( 'mwe-upwiz-fewer-options' ).addClass( "mwe-upwiz-toggler-open" );
3029 } else {
3130 moreDiv.hide(); // maskSafeHide();
3231 /* when closed, show control to open */
33 - $toggleLink.html( gM( 'mwe-upwiz-more-options' ) );
34 - $toggleLink.removeClass( "mwe-upwiz-toggler-open" );
 32+ $toggleLink.msg( 'mwe-upwiz-more-options' ).removeClass( "mwe-upwiz-toggler-open" );
3533 }
3634 };
3735
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -510,12 +510,12 @@
511511
512512 $j( '<div>' )
513513 .insertBefore( _this.deedChooser.$selector.find( '.mwe-upwiz-deed-ownwork' ) )
514 - .html( gM( 'mwe-upwiz-deeds-macro-prompt', _this.uploads.length ) );
 514+ .msg( 'mwe-upwiz-deeds-macro-prompt', _this.uploads.length );
515515
516516 if ( _this.uploads.length > 1 ) {
517517 $j( '<div style="margin-top: 1em">' )
518518 .insertBefore( _this.deedChooser.$selector.find( '.mwe-upwiz-deed-custom' ) )
519 - .html( gM( 'mwe-upwiz-deeds-custom-prompt' ) );
 519+ .msg( 'mwe-upwiz-deeds-custom-prompt' );
520520 }
521521
522522 _this.moveToStep( 'deeds' );
@@ -862,7 +862,7 @@
863863 $j( '#mwe-upwiz-upload-ctrl-container' ).show();
864864
865865 // changes the "click here to add files" to "add another file"
866 - $j( '#mwe-upwiz-add-file span' ).html( gM( 'mwe-upwiz-add-file-n' ) );
 866+ $j( '#mwe-upwiz-add-file span' ).msg( 'mwe-upwiz-add-file-n' );
867867 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-0');
868868 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-n');
869869
@@ -889,7 +889,7 @@
890890 $j( '#mwe-upwiz-stepdiv-file .mwe-upwiz-buttons' ).hide();
891891
892892 // change "add another file" into "click here to add a file"
893 - $j( '#mwe-upwiz-add-file' ).html( gM( 'mwe-upwiz-add-file-0' ) );
 893+ $j( '#mwe-upwiz-add-file' ).msg( 'mwe-upwiz-add-file-0' );
894894 $j( '#mwe-upwiz-add-file-container' ).addClass('mwe-upwiz-add-files-0');
895895 $j( '#mwe-upwiz-add-file-container' ).removeClass('mwe-upwiz-add-files-n');
896896 }
@@ -977,9 +977,9 @@
978978 var _this = this;
979979
980980 $j( '#mwe-upwiz-thanks' )
981 - .append( $j( '<h3 style="text-align: center;">' ).append( gM( 'mwe-upwiz-thanks-intro' ) ),
 981+ .append( $j( '<h3 style="text-align: center;">' ).msg( 'mwe-upwiz-thanks-intro' ),
982982 $j( '<p style="margin-bottom: 2em; text-align: center;">' )
983 - .append( gM( 'mwe-upwiz-thanks-explain', _this.uploads.length ) ) );
 983+ .msg( 'mwe-upwiz-thanks-explain', _this.uploads.length ) );
984984
985985 $j.each( _this.uploads, function(i, upload) {
986986 var thanksDiv = $j( '<div class="mwe-upwiz-thanks ui-helper-clearfix" />' );

Status & tagging log