http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60815

Revision: 60815
Author:   dale
Date:     2010-01-08 00:02:17 +0000 (Fri, 08 Jan 2010)

Log Message:
-----------
* 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
    branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js
    branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
    branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js
    branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html

Modified: 
branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.simpleUploadForm.js
===================================================================
--- 
branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.simpleUploadForm.js 
    2010-01-07 23:36:08 UTC (rev 60814)
+++ 
branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/jquery.simpleUploadForm.js 
    2010-01-08 00:02:17 UTC (rev 60815)
@@ -1,4 +1,4 @@
-/*
+/**
  * simple form output jquery binding
  * enables dynamic form output to a given target
  *

Modified: 
branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js
===================================================================
--- branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js  
2010-01-07 23:36:08 UTC (rev 60814)
+++ branches/js2-work/phase3/js/mwEmbed/modules/Sequencer/mw.FirefoggRender.js  
2010-01-08 00:02:17 UTC (rev 60815)
@@ -52,18 +52,19 @@
                        'only_fogg':true
                });
                
-               // check for firefogg:
+               // Check for firefogg:
                if ( this.myFogg.getFirefogg() ) {
                        this.enabled = true;
                } else {
                        this.enabled = false;
+                       mw.log('Error firefogg not installed');
                        return this;
                }
                
-               // set up local fogg pointer: 
+               // Setup local fogg pointer: 
                this.fogg = this.myFogg.fogg;
                
-               // setup player instance                
+               // Setup player instance                
                this.player_target = options.player_target;             
                
                // Extend the render options with any provided details
@@ -93,6 +94,7 @@
                        } )
                        this.target_startRender = options.target_startRender;
                }
+               // Bind stopRender target button
                if ( options.target_stopRender ) {
                        $j( options.target_stopRender ).click( function() {
                                _this.stopRender();
@@ -136,6 +138,7 @@
                        _this.doNextFrame();
                });
        },
+       // Do the next frame in the render target
        doNextFrame: function(){
                var _this = this;
                // internal function to handle updates:                         
                
@@ -146,22 +149,24 @@
                        //mw.log(       'addFrame:' + $j( _this.player_target 
).attr( 'id' ) );         
                        _this.fogg.addFrame( $j( _this.player_target ).attr( 
'id' ) );
                        _this.render_time += _this.interval;                    
        
-                       if ( _this.render_time >= _this.player.getDuration() ) {
+                       if ( _this.render_time >= _this.player.getDuration() && 
_this.continue_rendering) {
                                _this.doFinalRender();
-                       } else {
-                               if ( _this.continue_rendering ) {
-                                       _this.doNextFrame();
-                               } else {
-                                       mw.log('render stoped');
-                                       // else quit:
-                                       _this.doFinalRender();
-                               }
+                       } else {                        
+                               _this.doNextFrame();                    
                        }
                } );
        },
+       
+       /**     
+       * Stop the current render proccess on the next frame
+       */
        stopRender:function() {
                this.continue_rendering = false;
        },
+       
+       /**
+       * Issue the call to firefogg to render out the ogg video
+       */ 
        doFinalRender: function() {
                var _this = this;
                mw.log( " do final render: " );
@@ -169,19 +174,20 @@
                this.fogg.render();
                this.updateStatus();
        },
-       updateStatus:function() {
+       
+       /**
+       * Update the render status
+       */
+       updateStatus: function() {
                var _this = this;
-               var doUpdateStatus = function() {
-                       var rstatus = _this.fogg.renderstatus()
-                   $j( _this.target_timeStatus ).val( rstatus );
-                   if ( rstatus != 'done' && rstatus != 'rendering failed' ) {
-                       setTimeout( doUpdateStatus, 100 );
-                   } else {
-                       $j( _this.target_startRender ).attr( "disabled", false 
);
-                   }
-               }
-               doUpdateStatus();
+               var rstatus = _this.fogg.renderstatus()
+           $j( _this.target_timeStatus ).val( rstatus );
+           if ( rstatus != 'done' && rstatus != 'rendering failed' ) {
+               setTimeout( function(){
+                       _this.updateStatus();
+               }, 100 );
+           } else {
+               $j( _this.target_startRender ).attr( "disabled", false );
+           }
        }
-
-       
 }
\ No newline at end of file

Modified: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
===================================================================
--- branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js       
2010-01-07 23:36:08 UTC (rev 60814)
+++ branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js       
2010-01-08 00:02:17 UTC (rev 60815)
@@ -476,7 +476,7 @@
                /**
                 * Shows the timed text edit ui
                 * 
-                * @param {String} mode Mode or page to display ( to 
diffrenciate between edit vs new transcript) 
+                * @param {String} mode Mode or page to display ( to 
differentiate between edit vs new transcript) 
                 */             
                showTimedTextEditUI: function( mode ){
                        var _this = this;

Modified: 
branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js
===================================================================
--- branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js   
2010-01-07 23:36:08 UTC (rev 60814)
+++ branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedTextEdit.js   
2010-01-08 00:02:17 UTC (rev 60815)
@@ -290,14 +290,14 @@
                
        },
        /**
-        * Uploads the text conntent
+        * Uploads the text content
         */
        uploadTextFile: function(){
                //put a dialog ontop
                mw.addLoaderDialog( gM( 'mwe-uploading-text') );
                
-               //Get timed text target title
-               // NOTE: this should be cleanned up with accessors
+               // Get timed text target title
+               // NOTE: this should be cleaned up with accessors
                var targetTitleKey = 
this.parentTimedText.embedPlayer.wikiTitleKey;
                
                // Add TimedText NS and language key and ".srt"
@@ -376,7 +376,7 @@
        },
        getLangMenuItem: function( langKey , source_icon){ 
                return this.parentTimedText.getLi(
-                       unescape( mw.languages[ langKey ] ),
+                       langKey + ' - ' + unescape( mw.languages[ langKey ] ),
                        source_icon,
                        function(){
                                mw.log( "Selected: " + langKey );

Modified: branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html
===================================================================
--- branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html      
2010-01-07 23:36:08 UTC (rev 60814)
+++ branches/js2-work/phase3/js/mwEmbed/tests/Sequence_Editor.html      
2010-01-08 00:02:17 UTC (rev 60815)
@@ -11,7 +11,7 @@
                                'mv_pl_src':'media/sample_smil.xml',
                                //set the add media wizard to only include 
commons:   
                                'amw_conf':{
-                                        'enabled_cps':['wiki_commons']
+                                        'enabled_providers':['wiki_commons']
                                }               
                        });
                });



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to