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

Revision: 73675
Author:   dale
Date:     2010-09-24 19:17:33 +0000 (Fri, 24 Sep 2010)

Log Message:
-----------
* fixed player preference cookie
* use swam transport by default if no preference exists and add-on is installed
* fixed a for( var {var} in {array} ) loop that was missed in the mw.Parser ( 
thanks neilk )

Modified Paths:
--------------
    branches/MwEmbedStandAlone/components/mw.Parser.js
    
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
    
branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
    branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js
    branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js
    branches/MwEmbedStandAlone/mwEmbed.js

Modified: branches/MwEmbedStandAlone/components/mw.Parser.js
===================================================================
--- branches/MwEmbedStandAlone/components/mw.Parser.js  2010-09-24 19:11:57 UTC 
(rev 73674)
+++ branches/MwEmbedStandAlone/components/mw.Parser.js  2010-09-24 19:17:33 UTC 
(rev 73675)
@@ -134,7 +134,7 @@
                                paramSet.splice( 0, 1 );
                                if ( paramSet.length ) {
                                        templateObject.param = new Array();
-                                       for ( var pInx in paramSet ) {
+                                       for ( var pInx =0; pInx < 
paramSet.length; pInx++ ) {
                                                var paramString = paramSet[ 
pInx ];
                                                // check for empty param
                                                if ( paramString == '' ) {

Modified: 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
===================================================================
--- 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js 
    2010-09-24 19:11:57 UTC (rev 73674)
+++ 
branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js 
    2010-09-24 19:17:33 UTC (rev 73675)
@@ -613,6 +613,8 @@
        */
        showControlBar: function(){
                var animateDuration = 'slow';   
+               if(! this.embedPlayer )
+                       return ;
                $j( this.embedPlayer.getPlayerElement() ).css( 'z-index', '1' ) 
                mw.log( 'showControlBar' );
                // Move up text track if present

Modified: 
branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
===================================================================
--- 
branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
 2010-09-24 19:11:57 UTC (rev 73674)
+++ 
branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js
 2010-09-24 19:17:33 UTC (rev 73675)
@@ -7,7 +7,6 @@
 
 // Wrap in mw to not pollute global namespace
 ( function( mw ) {
-       
 
 mw.addMessageKeys( [
        "mwe-sequencer-no-sequence-create",

Modified: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js
===================================================================
--- branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js      
2010-09-24 19:11:57 UTC (rev 73674)
+++ branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js      
2010-09-24 19:17:33 UTC (rev 73675)
@@ -22,7 +22,12 @@
                                if( typeof window['swarmTransport'] != 
'undefined' ){                                   
                                        // Add the swarm source
                                        mw.log(" SwarmTransport :: 
checkPlayerSourcesEvent " + swapedPlayerId);
-                                       _this.addSwarmSource( embedPlayer, 
callback );
+                                       _this.addSwarmSource( embedPlayer, 
function(){
+                                               // Update the source if paused  
                                
+                                               if( embedPlayer.paused ) {
+                                                       
embedPlayer.mediaElement.autoSelectSource();
+                                               }
+                                       });                                     
                                
                                }                                               
                
                                // Don't block on swarm request, directly do 
the callback
                                callback();     
@@ -87,13 +92,14 @@
                                        return ;
                                }                                       
                                mw.log( 'SwarmTransport: addSwarmSource for: ' 
+ source.getSrc()  + "\n\nGot:" + data.torrent );        
-                               // XXX need to update prefrence
+                               // XXX need to update preference
                                embedPlayer.mediaElement.tryAddSource( 
                                        $j('<source />')
                                        .attr( {
                                                'type' : 'video/swarmTransport',
                                                'title': 
gM('mwe-swarmtransport-stream-ogg'), 
-                                               'src': 'tribe://' + 
data.torrent                                                
+                                               'src': 'tribe://' + 
data.torrent,
+                                               'default' : true
                                        } )
                                        .get( 0 )
                                );                              

Modified: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js
===================================================================
--- branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js        
2010-09-24 19:11:57 UTC (rev 73674)
+++ branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js        
2010-09-24 19:17:33 UTC (rev 73675)
@@ -22,7 +22,7 @@
         */
        mw.TimedText = function( embedPlayer, options ) {
                return this.init( embedPlayer, options);
-       }
+       };
        mw.TimedText.prototype = {
                
                /** 
@@ -102,7 +102,7 @@
                 */
                init: function( embedPlayer, options ) {
                        var _this = this;
-                       mw.log("TimedText: init() ")
+                       mw.log("TimedText: init() ");
                        this.embedPlayer = embedPlayer; 
                        this.options = options;
                        
@@ -463,7 +463,7 @@
                                // Close the loader:
                                mw.closeLoaderDialog();
                                _this.editText.showUI();
-                       })
+                       });
                },
                
                /**
@@ -480,7 +480,7 @@
                        var _this = this;
                        return $j.getLineItem( gM( 
'mwe-timedtext-add-timed-text'), 'script', function() {
                                _this.showTimedTextEditUI( 'add' );
-                       } )
+                       } );
                },
                
                /**
@@ -521,7 +521,7 @@
                        if( mw.Language.names[ lang_key ]) {
                                return mw.Language.names[ lang_key ];
                        }
-                       return false
+                       return false;
                },
                
                /** 
@@ -551,7 +551,7 @@
                                                function() {
                                                        _this.selectLayout( 
layoutMode );
                                                } ) 
-                                       )
+                                       );
                        });
                        return $ul;
                },
@@ -614,7 +614,7 @@
                        source.load( function() {
                                // Refresh the interface: 
                                _this.refreshDisplay();
-                       })
+                       });
                },
                
                /**
@@ -626,7 +626,7 @@
                        // Refresh the Menu (if it has a target to refresh) 
                        if( this.menuTarget ) {
                                mw.log('bind menu refresh display');
-                               this.bindMenu(  this.menuTarget, false )
+                               this.bindMenu(  this.menuTarget, false );
                        }
                        // Issues a "monitor" command to update the timed text 
for the new layout
                        this.monitor();

Modified: branches/MwEmbedStandAlone/mwEmbed.js
===================================================================
--- branches/MwEmbedStandAlone/mwEmbed.js       2010-09-24 19:11:57 UTC (rev 
73674)
+++ branches/MwEmbedStandAlone/mwEmbed.js       2010-09-24 19:17:33 UTC (rev 
73675)
@@ -60,7 +60,7 @@
                var mwConfig = { };
        }
        
-       // Local scope mwUserConfig var. Stores user configuration
+       // mw scope mwUserConfig var. Stores user configuration
        var mwUserConfig = { };
        
        /**
@@ -1957,66 +1957,68 @@
                                if ( ! window[ '$j' ] ) {
                                        window[ '$j' ] = jQuery.noConflict();   
                        
                                }
-                               
-                               // Get module loader.js, and language files
-                               // ( will hit callback directly if set via 
resource loader )
-                               mw.checkModuleLoaderFiles( function() {
-                                                                               
                        
-                                       // Set the User language
-                                       if( typeof wgUserLanguage != 
'undefined' && mw.isValidLang( wgUserLanguage) ) {                         
-                                               mw.setConfig( 'userLanguage', 
wgUserLanguage );
-                                       }else{
-                                               // Grab it from the included url
-                                               var langKey = mw.parseUri( 
mw.getMwEmbedSrc() ).queryKey['uselang'];
-                                               if ( langKey && mw.isValidLang( 
langKey ) ) {   
-                                                       mw.setConfig( 
'userLanguage', langKey);
-                                               }
-                                       }                                       
-                                       
-                                       // Update the image path
-                                       mw.setConfig( 'imagesPath', 
mw.getMwEmbedPath() + 'skins/common/images/' );     
-                                       
-                                       // Set up AJAX to not send dynamic URLs 
for loading scripts
-                                       $j.ajaxSetup( {
-                                               cache: true
-                                       } );
-                                       
-                                       // Update the magic keywords
-                                       mw.Language.magicSetup();
-                                       
-                                       // Set up mvEmbed utility jQuery 
bindings
-                                       mw.dojQueryBindings();                  
                
-                                       
-                                       
-                                       // Special Hack for conditional jquery 
ui inclusion ( once
-                                       // Usability extension
-                                       // registers the jquery.ui skin in 
mw.style             
-                                       if( mw.hasJQueryUiCss() ){
-                                               mw.style[ 'ui_' + mw.getConfig( 
'jQueryUISkin' ) ] = true;                                              
-                                       }               
-                                       
-                                       
-                                       // Make sure style sheets are loaded:
-                                       mw.load( ['mw.style.mwCommon'] , 
function(){                                                                     
               
-                                               // Run all the setup function 
hooks
-                                               // NOTE: setup functions are 
added via addSetupHook
-                                               // calls
-                                               // and must include a callback.
-                                               //
-                                               // Once complete we can run 
.ready() queued functions
-                                               function runSetupFunctions() {  
                                                
-                                                       if( 
mwSetupFunctions.length ) {
-                                                               
mwSetupFunctions.shift()( function() {
-                                                                       
runSetupFunctions();
-                                                               } );
-                                                       }else{
-                                                               
mw.runReadyFunctions();
+                               // Setup user config: 
+                               mw.setupUserConfig( function(){
+                                       // Get module loader.js, and language 
files
+                                       // ( will hit callback directly if set 
via resource loader )
+                                       mw.checkModuleLoaderFiles( function() {
+                                                                               
                                
+                                               // Set the User language
+                                               if( typeof wgUserLanguage != 
'undefined' && mw.isValidLang( wgUserLanguage) ) {                         
+                                                       mw.setConfig( 
'userLanguage', wgUserLanguage );
+                                               }else{
+                                                       // Grab it from the 
included url
+                                                       var langKey = 
mw.parseUri( mw.getMwEmbedSrc() ).queryKey['uselang'];
+                                                       if ( langKey && 
mw.isValidLang( langKey ) ) {   
+                                                               mw.setConfig( 
'userLanguage', langKey);
                                                        }
-                                               }
-                                               runSetupFunctions();            
-                                       } );
-                                       
-                               } );                                            
                        
+                                               }                               
        
+                                               
+                                               // Update the image path
+                                               mw.setConfig( 'imagesPath', 
mw.getMwEmbedPath() + 'skins/common/images/' );     
+                                               
+                                               // Set up AJAX to not send 
dynamic URLs for loading scripts
+                                               $j.ajaxSetup( {
+                                                       cache: true
+                                               } );
+                                               
+                                               // Update the magic keywords
+                                               mw.Language.magicSetup();
+                                               
+                                               // Set up mvEmbed utility 
jQuery bindings
+                                               mw.dojQueryBindings();          
                        
+                                               
+                                               
+                                               // Special Hack for conditional 
jquery ui inclusion ( once
+                                               // Usability extension
+                                               // registers the jquery.ui skin 
in mw.style             
+                                               if( mw.hasJQueryUiCss() ){
+                                                       mw.style[ 'ui_' + 
mw.getConfig( 'jQueryUISkin' ) ] = true;                                        
      
+                                               }               
+                                               
+                                               
+                                               // Make sure style sheets are 
loaded:
+                                               mw.load( ['mw.style.mwCommon'] 
, function(){                                                                   
                 
+                                                       // Run all the setup 
function hooks
+                                                       // NOTE: setup 
functions are added via addSetupHook
+                                                       // calls
+                                                       // and must include a 
callback.
+                                                       //
+                                                       // Once complete we can 
run .ready() queued functions
+                                                       function 
runSetupFunctions() {                                                  
+                                                               if( 
mwSetupFunctions.length ) {
+                                                                       
mwSetupFunctions.shift()( function() {
+                                                                               
runSetupFunctions();
+                                                                       } );
+                                                               }else{
+                                                                       
mw.runReadyFunctions();
+                                                               }
+                                                       }
+                                                       runSetupFunctions();    
        
+                                               } );
+                                               
+                                       } );                                    
                                
+                               });
                        });
                });
        };



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to