r60815 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60814‎ | r60815 | r60816 >
Date:00:02, 8 January 2010
Author:dale
Status:deferred
Tags:
Comment:
* added language-key to language list in timed text upload
* minor comment cleanup
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.simpleUploadForm.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
@@ -476,7 +476,7 @@
477477 /**
478478 * Shows the timed text edit ui
479479 *
480 - * @param {String} mode Mode or page to display ( to diffrenciate between edit vs new transcript)
 480+ * @param {String} mode Mode or page to display ( to differentiate between edit vs new transcript)
481481 */
482482 showTimedTextEditUI: function( mode ){
483483 var _this = this;
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js
@@ -290,14 +290,14 @@
291291
292292 },
293293 /**
294 - * Uploads the text conntent
 294+ * Uploads the text content
295295 */
296296 uploadTextFile: function(){
297297 //put a dialog ontop
298298 mw.addLoaderDialog( gM( 'mwe-uploading-text') );
299299
300 - //Get timed text target title
301 - // NOTE: this should be cleanned up with accessors
 300+ // Get timed text target title
 301+ // NOTE: this should be cleaned up with accessors
302302 var targetTitleKey = this.parentTimedText.embedPlayer.wikiTitleKey;
303303
304304 // Add TimedText NS and language key and ".srt"
@@ -376,7 +376,7 @@
377377 },
378378 getLangMenuItem: function( langKey , source_icon){
379379 return this.parentTimedText.getLi(
380 - unescape( mw.languages[ langKey ] ),
 380+ langKey + ' - ' + unescape( mw.languages[ langKey ] ),
381381 source_icon,
382382 function(){
383383 mw.log( "Selected: " + langKey );
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.simpleUploadForm.js
@@ -1,4 +1,4 @@
2 -/*
 2+/**
33 * simple form output jquery binding
44 * enables dynamic form output to a given target
55 *
Index: branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js
@@ -52,18 +52,19 @@
5353 'only_fogg':true
5454 });
5555
56 - // check for firefogg:
 56+ // Check for firefogg:
5757 if ( this.myFogg.getFirefogg() ) {
5858 this.enabled = true;
5959 } else {
6060 this.enabled = false;
 61+ mw.log('Error firefogg not installed');
6162 return this;
6263 }
6364
64 - // set up local fogg pointer:
 65+ // Setup local fogg pointer:
6566 this.fogg = this.myFogg.fogg;
6667
67 - // setup player instance
 68+ // Setup player instance
6869 this.player_target = options.player_target;
6970
7071 // Extend the render options with any provided details
@@ -93,6 +94,7 @@
9495 } )
9596 this.target_startRender = options.target_startRender;
9697 }
 98+ // Bind stopRender target button
9799 if ( options.target_stopRender ) {
98100 $j( options.target_stopRender ).click( function() {
99101 _this.stopRender();
@@ -136,6 +138,7 @@
137139 _this.doNextFrame();
138140 });
139141 },
 142+ // Do the next frame in the render target
140143 doNextFrame: function(){
141144 var _this = this;
142145 // internal function to handle updates:
@@ -146,22 +149,24 @@
147150 //mw.log( 'addFrame:' + $j( _this.player_target ).attr( 'id' ) );
148151 _this.fogg.addFrame( $j( _this.player_target ).attr( 'id' ) );
149152 _this.render_time += _this.interval;
150 - if ( _this.render_time >= _this.player.getDuration() ) {
 153+ if ( _this.render_time >= _this.player.getDuration() && _this.continue_rendering) {
151154 _this.doFinalRender();
152 - } else {
153 - if ( _this.continue_rendering ) {
154 - _this.doNextFrame();
155 - } else {
156 - mw.log('render stoped');
157 - // else quit:
158 - _this.doFinalRender();
159 - }
 155+ } else {
 156+ _this.doNextFrame();
160157 }
161158 } );
162159 },
 160+
 161+ /**
 162+ * Stop the current render proccess on the next frame
 163+ */
163164 stopRender:function() {
164165 this.continue_rendering = false;
165166 },
 167+
 168+ /**
 169+ * Issue the call to firefogg to render out the ogg video
 170+ */
166171 doFinalRender: function() {
167172 var _this = this;
168173 mw.log( " do final render: " );
@@ -169,19 +174,20 @@
170175 this.fogg.render();
171176 this.updateStatus();
172177 },
173 - updateStatus:function() {
 178+
 179+ /**
 180+ * Update the render status
 181+ */
 182+ updateStatus: function() {
174183 var _this = this;
175 - var doUpdateStatus = function() {
176 - var rstatus = _this.fogg.renderstatus()
177 - $j( _this.target_timeStatus ).val( rstatus );
178 - if ( rstatus != 'done' && rstatus != 'rendering failed' ) {
179 - setTimeout( doUpdateStatus, 100 );
180 - } else {
181 - $j( _this.target_startRender ).attr( "disabled", false );
182 - }
183 - }
184 - doUpdateStatus();
 184+ var rstatus = _this.fogg.renderstatus()
 185+ $j( _this.target_timeStatus ).val( rstatus );
 186+ if ( rstatus != 'done' && rstatus != 'rendering failed' ) {
 187+ setTimeout( function(){
 188+ _this.updateStatus();
 189+ }, 100 );
 190+ } else {
 191+ $j( _this.target_startRender ).attr( "disabled", false );
 192+ }
185193 }
186 -
187 -
188194 }
\ No newline at end of file
Index: branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html
@@ -11,7 +11,7 @@
1212 'mv_pl_src':'media/sample_smil.xml',
1313 //set the add media wizard to only include commons:
1414 'amw_conf':{
15 - 'enabled_cps':['wiki_commons']
 15+ 'enabled_providers':['wiki_commons']
1616 }
1717 });
1818 });

Status & tagging log