r57270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57269‎ | r57270 | r57271 >
Date:02:57, 2 October 2009
Author:dale
Status:deferred
Tags:
Comment:
* fixed wah-transcode-helpout msg display
* fixed wgJobTypeConfig query
* added js msgs to localization file and did some msg fixes
* added api error check
Modified paths:
  • /trunk/extensions/WikiAtHome/NonFreeVideoHandler.php (modified) (history)
  • /trunk/extensions/WikiAtHome/WahJobManager.php (modified) (history)
  • /trunk/extensions/WikiAtHome/WikiAtHome.i18n.php (modified) (history)
  • /trunk/extensions/WikiAtHome/WikiAtHome.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiAtHome/WikiAtHome.i18n.php
@@ -28,13 +28,41 @@
2929 'wah-long-error' => '(ffmpeg could not read this file: $1)',
3030
3131 'wah-transcode-working' => 'This video is being processed, please try again later',
32 - 'wah-transcode-helpout' => 'The clip is $1 percent done.
33 -You can help transcode this video by visiting [[Special:WikiAtHome|Wiki@Home]]',
 32+ 'wah-transcode-helpout' => 'You can help transcode this video by visiting [[Special:WikiAtHome|Wiki@Home]]',
3433
3534 'wah-transcode-fail' => 'This file failed to transcode.',
3635
3736 'wah-javascript-off' => 'You must have JavaScript enabled to participate in Wiki@Home',
38 - 'wah-loading' => 'loading Wiki@Home interface <blink>...</blink>'
 37+ 'wah-loading' => 'loading Wiki@Home interface <blink>...</blink>',
 38+
 39+ /* javascript msgs WikiAtHome.js */
 40+ "wah-menu-jobs" => "Jobs",
 41+ "wah-menu-stats" => "Stats",
 42+ "wah-menu-pref" => "Preferences",
 43+ "wah-loading" => "loading Wiki@Home interface <blink>...</blink>",
 44+
 45+ "wah-lookingforjob" => "Looking For a Job <blink>...</blink>",
 46+
 47+ "wah-start-on-visit" => "Start up Wiki@Home any time I visit this site",
 48+ "wah-jobs-while-away"=> "Only run jobs when I have been away from my browser for 20 minutes",
 49+
 50+ "wah-nojobfound" => "No Job Found, Will retry in $1",
 51+
 52+ "wah-notoken-login" => "Could not get a token. Are you logged in?",
 53+ "wah-apioff" => "The wiki@home api appears to be off. Please Contact your wiki admin",
 54+
 55+ "wah-doing-job" => "Job: <i>$1</i> on: <i>$2</i>",
 56+ "wah-downloading" => "Downloading File <i>$1%</i> done",
 57+ "wah-encoding" => "Encoding File <i>$1%</i> done",
 58+
 59+ "wah-encoding-fail" => "Encoding Failed. Please reload this page or try back latter.",
 60+
 61+ "wah-uploading" => "Uploading File <i>$1</i> done",
 62+ "wah-uploadfail" => "Uploading Failed",
 63+ "wah-doneuploading" => "Done Uploading. Thanks for your Contribution.",
 64+
 65+ "wah-needs-firefogg"=> "To participate in wiki@home you need to install <a href=\"http://firefogg.org\">firefogg</a>",
 66+ "wah-api-error" => "There has been an error with the api. Please try back later"
3967 );
4068
4169 /** Message documentation (Message documentation)
@@ -803,7 +831,7 @@
804832 'wah-long-general' => '(mediafil, längd $2, $3)',
805833 'wah-long-error' => '(ffmpeg kunde inte läsa filen: $1)',
806834 'wah-transcode-working' => 'Videon bearbetas just ju, vänligen försök igen senare',
807 - 'wah-transcode-helpout' => 'Filen är $1 procent klar.
 835+ 'wah-transcode-helpout' => 'Filen är $1 procent klar.
808836 Du kan hjälpa till att konvertera den här videon genom att besöka [[Special:WikiAtHome|Wiki@Home]]',
809837 'wah-transcode-fail' => 'Kunde inte konvertera den här filen.',
810838 'wah-javascript-off' => 'Du måste ha JavaScript aktiverat för att delta i Wiki@Home',
Index: trunk/extensions/WikiAtHome/NonFreeVideoHandler.php
@@ -308,10 +308,10 @@
309309 if( $this->percDone == -1){
310310 $waitHtml = wfMsgWikiHtml( 'wah-transcode-fail');
311311 }else{
312 - $waitHtml = wfMsgWikiHtml( 'wah-transcode-working' ) . '<br />';
 312+ $waitHtml = wfMsgWikiHtml( 'wah-transcode-working' );
313313 //check if we doing it ~at~ home then we know how far it is done:
314314 if( $wgJobTypeConfig['transcode'][ 'assignAtHome' ] ){
315 - $waitHtml .= wfMsgExt('wah-transcode-helpout', array('parsemag'), $this->percDone);
 315+ $waitHtml .= wfMsgWikiHtml('wah-transcode-helpout', $this->percDone);
316316 }
317317 }
318318
Index: trunk/extensions/WikiAtHome/WahJobManager.php
@@ -176,7 +176,7 @@
177177 $or = '';
178178 foreach($wgJobTypeConfig as $tKey=>$tSet){
179179 if( $tSet['assign' . $reqMode] ){
180 - $okyJobOrList = $or . ' ( set_job_type = ' . $dbr->addQuotes( $tKey ) . ' )';
 180+ $okyJobOrList .= $or . ' ( set_job_type = ' . $dbr->addQuotes( $tKey ) . ' )';
181181 $or = ' OR ';
182182 }
183183 }
Index: trunk/extensions/WikiAtHome/WikiAtHome.js
@@ -1,6 +1,5 @@
22 //the core javascript file of the wiki@home extension
33
4 -// FIXME: needs localisation support.
54 //load msgs:
65 loadGM({
76 "wah-menu-jobs" : "Jobs",
@@ -24,12 +23,14 @@
2524
2625 "wah-encoding-fail" : "Encoding failed. Please reload this page or try back latter.",
2726
28 - "wah-uploading" : "Uploading file <i>$i</i> done",
 27+ "wah-uploading" : "Uploading file <i>$1</i> done",
2928 "wah-uploadfail" : "Uploading failed",
3029 "wah-doneuploading" : "Upload complete. Thank you for your contribution.",
3130
32 - "wah-needs-firefogg": "To particate in Wiki@Home you need to install Firefogg."
 31+ "wah-needs-firefogg": "To participate in Wiki@Home you need to install Firefogg."
3332
 33+ "wah-api-error" : "There has been an error with the api. Please try back later"
 34+
3435 });
3536
3637
@@ -188,8 +189,10 @@
189190 do_api_req({
190191 'data' : reqObj
191192 },function(data){
192 - //if we have a job update status to proccessing
193 - if( data.wikiathome.nojobs ){
 193+ //if we have a job update status to processing
 194+ if( data.error){
 195+ $j('#tab-jobs .wah-gen-status').html( gM('wah-api-error') );
 196+ }else if( data.wikiathome.nojobs ){
194197 _this.delayLookForJob();
195198 }else{
196199 //we do have job proccess it
@@ -327,7 +330,7 @@
328331 }
329332
330333
331 - //congradulate the user and issue new job request
 334+ //congratulate the user and issue new job request
332335 $j('#tab-jobs .prograss-status').html(
333336 gM( 'wah-doneuploading' )
334337 );

Status & tagging log