r79141 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79140‎ | r79141 | r79142 >
Date:23:49, 28 December 2010
Author:dale
Status:deferred
Tags:
Comment:
fixed bug 25567 ( $1% Transcoded and $1% Uploaded )
* must sync with Add media extension to have changes reflected on translateWik
Modified paths:
  • /branches/MwEmbedStandAlone/modules/AddMedia/AddMedia.i18n.php (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.Firefogg.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.UploadInterface.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -484,6 +484,9 @@
485485 */
486486 cleanLoadRequest: function( loadRequest ){
487487 var cleanRequest = [];
 488+ if( ! loadRequest ){
 489+ return [];
 490+ }
488491 if( typeof loadRequest == 'string' )
489492 return loadRequest;
490493 for( var i =0;i < loadRequest.length; i++ ){
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.UploadInterface.js
@@ -13,10 +13,10 @@
1414 * Dispatches updates to an iframe target for upload proxy
1515 *
1616 */
17 -mw.addMessages( {
 17+mw.addMessages({
1818 "mwe-upload-in-progress" : "Upload in progress (do not close this window)",
19 - "mwe-uploaded-status" : "Uploaded",
20 - "mwe-transcoded-status" : "Transcoded",
 19+ "mwe-uploaded-status" : "$1% Uploaded",
 20+ "mwe-transcoded-status" : "$1% Transcoded",
2121 "mwe-uploaded-time-remaining" : "Time remaining: $1",
2222 "mwe-upload-done" : "Your upload <i>should be<\/i> accessible."
2323 } );
@@ -114,20 +114,15 @@
115115 .css( 'float', 'left' )
116116 .append(
117117 $j( '<span />' )
118 - .attr( 'id' , 'up-pstatus')
119 - .text( '0% -' ),
120 -
121 - $j( '<span />' )
122118 .attr( 'id', 'up-status-state' )
123119 )
124120 );
125121
126 - var $statusState = $progressContainer.find( '#up-status-state' );
127 - if( options.statusType == 'transcode' ){
128 - $statusState.text( gM( 'mwe-transcoded-status' ) );
129 - } else {
130 - $statusState.text( gM( 'mwe-uploaded-status' ) );
131 - }
 122+ this.statusKey = options.statusType;
 123+
 124+ var statusKey = ( this.statusType == 'transcode' ) ? 'mwe-transcoded-status' : 'mwe-uploaded-status';
 125+ $progressContainer.find( '#up-status-state' ).text( gM( statusKey, 0 ) );
 126+
132127
133128 // Add the estimated time remaining
134129 $progressContainer.append(
@@ -161,7 +156,9 @@
162157 var _this = this;
163158
164159 $j( '#up-progressbar' ).progressbar( 'value', parseInt( fraction * 100 ) );
165 - $j( '#up-pstatus' ).html( parseInt( fraction * 100 ) + '% - ' );
 160+
 161+ var statusKey = ( this.statusType == 'transcode' ) ? 'mwe-transcoded-status' : 'mwe-uploaded-status';
 162+ $j( '#up-status-state' ).html( gM( statusKey, parseInt( fraction * 100 ) ) );
166163
167164 if ( _this.uploadBeginTime) {
168165 var elapsedMilliseconds = ( new Date() ).getTime() - _this.uploadBeginTime;
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.Firefogg.js
@@ -4,7 +4,7 @@
55 */
66
77 mw.addMessages({
8 - "mwe-upload-transcoded-status" : "Transcoded",
 8+ "mwe-upload-transcoded-status" : "%1 Transcoded",
99 "mwe-upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)",
1010 "fogg-transcoding" : "Encoding video",
1111 "fogg-select_file" : "Select file",
@@ -1047,7 +1047,7 @@
10481048 },
10491049
10501050 /**
1051 - * Internal function called once the token and form data is avaliable
 1051+ * Internal function called once the token and form data is available
10521052 */
10531053 doUploadWithFormData: function() {
10541054 var _this = this;
@@ -1057,7 +1057,7 @@
10581058 } else if ( _this.upload_mode == 'post' ) {
10591059 // Encode and then do a post upload
10601060 _this.doEncode(
1061 - function /* onProgress */ ( progress ) {
 1061+ function /* onProgress */ ( progress ) {
10621062 _this.ui.updateProgress( progress );
10631063 },
10641064 function /* onDone */ () {
@@ -1222,7 +1222,9 @@
12231223 */
12241224 doUploadStatus: function() {
12251225 var _this = this;
1226 - $j( '#up-status-state' ).html( gM( 'mwe-uploaded-status' ) );
 1226+ $j( '#up-status-state' ).html(
 1227+ gM( 'mwe-uploaded-status', 0 )
 1228+ );
12271229
12281230 _this.oldResponseText = '';
12291231
Index: branches/MwEmbedStandAlone/modules/AddMedia/AddMedia.i18n.php
@@ -130,8 +130,8 @@
131131 'mwe-ie-inline-upload' => 'Inline uploading is currently disabled for Internet Explorer.
132132 You can $1, then $2',
133133 'mwe-upload-in-progress' => 'Upload in progress (do not close this window)',
134 - 'mwe-uploaded-status' => 'Uploaded',
135 - 'mwe-transcoded-status' => 'Transcoded',
 134+ 'mwe-uploaded-status' => '$1% Uploaded',
 135+ 'mwe-transcoded-status' => '$1% Transcoded',
136136 'mwe-uploaded-time-remaining' => 'Time remaining: $1',
137137 'mwe-upload-done' => 'Your upload <i>should be</i> accessible.',
138138 'mwe-add_media_wizard' => 'Add media wizard',

Status & tagging log