Index: branches/MwEmbedStandAlone/components/mw.Parser.js |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | paramSet.splice( 0, 1 ); |
136 | 136 | if ( paramSet.length ) { |
137 | 137 | templateObject.param = new Array(); |
138 | | - for ( var pInx in paramSet ) { |
| 138 | + for ( var pInx =0; pInx < paramSet.length; pInx++ ) { |
139 | 139 | var paramString = paramSet[ pInx ]; |
140 | 140 | // check for empty param |
141 | 141 | if ( paramString == '' ) { |
Index: branches/MwEmbedStandAlone/mwEmbed.js |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | var mwConfig = { }; |
62 | 62 | } |
63 | 63 | |
64 | | - // Local scope mwUserConfig var. Stores user configuration |
| 64 | + // mw scope mwUserConfig var. Stores user configuration |
65 | 65 | var mwUserConfig = { }; |
66 | 66 | |
67 | 67 | /** |
— | — | @@ -1957,66 +1957,68 @@ |
1958 | 1958 | if ( ! window[ '$j' ] ) { |
1959 | 1959 | window[ '$j' ] = jQuery.noConflict(); |
1960 | 1960 | } |
1961 | | - |
1962 | | - // Get module loader.js, and language files |
1963 | | - // ( will hit callback directly if set via resource loader ) |
1964 | | - mw.checkModuleLoaderFiles( function() { |
1965 | | - |
1966 | | - // Set the User language |
1967 | | - if( typeof wgUserLanguage != 'undefined' && mw.isValidLang( wgUserLanguage) ) { |
1968 | | - mw.setConfig( 'userLanguage', wgUserLanguage ); |
1969 | | - }else{ |
1970 | | - // Grab it from the included url |
1971 | | - var langKey = mw.parseUri( mw.getMwEmbedSrc() ).queryKey['uselang']; |
1972 | | - if ( langKey && mw.isValidLang( langKey ) ) { |
1973 | | - mw.setConfig( 'userLanguage', langKey); |
1974 | | - } |
1975 | | - } |
1976 | | - |
1977 | | - // Update the image path |
1978 | | - mw.setConfig( 'imagesPath', mw.getMwEmbedPath() + 'skins/common/images/' ); |
1979 | | - |
1980 | | - // Set up AJAX to not send dynamic URLs for loading scripts |
1981 | | - $j.ajaxSetup( { |
1982 | | - cache: true |
1983 | | - } ); |
1984 | | - |
1985 | | - // Update the magic keywords |
1986 | | - mw.Language.magicSetup(); |
1987 | | - |
1988 | | - // Set up mvEmbed utility jQuery bindings |
1989 | | - mw.dojQueryBindings(); |
1990 | | - |
1991 | | - |
1992 | | - // Special Hack for conditional jquery ui inclusion ( once |
1993 | | - // Usability extension |
1994 | | - // registers the jquery.ui skin in mw.style |
1995 | | - if( mw.hasJQueryUiCss() ){ |
1996 | | - mw.style[ 'ui_' + mw.getConfig( 'jQueryUISkin' ) ] = true; |
1997 | | - } |
1998 | | - |
1999 | | - |
2000 | | - // Make sure style sheets are loaded: |
2001 | | - mw.load( ['mw.style.mwCommon'] , function(){ |
2002 | | - // Run all the setup function hooks |
2003 | | - // NOTE: setup functions are added via addSetupHook |
2004 | | - // calls |
2005 | | - // and must include a callback. |
2006 | | - // |
2007 | | - // Once complete we can run .ready() queued functions |
2008 | | - function runSetupFunctions() { |
2009 | | - if( mwSetupFunctions.length ) { |
2010 | | - mwSetupFunctions.shift()( function() { |
2011 | | - runSetupFunctions(); |
2012 | | - } ); |
2013 | | - }else{ |
2014 | | - mw.runReadyFunctions(); |
| 1961 | + // Setup user config: |
| 1962 | + mw.setupUserConfig( function(){ |
| 1963 | + // Get module loader.js, and language files |
| 1964 | + // ( will hit callback directly if set via resource loader ) |
| 1965 | + mw.checkModuleLoaderFiles( function() { |
| 1966 | + |
| 1967 | + // Set the User language |
| 1968 | + if( typeof wgUserLanguage != 'undefined' && mw.isValidLang( wgUserLanguage) ) { |
| 1969 | + mw.setConfig( 'userLanguage', wgUserLanguage ); |
| 1970 | + }else{ |
| 1971 | + // Grab it from the included url |
| 1972 | + var langKey = mw.parseUri( mw.getMwEmbedSrc() ).queryKey['uselang']; |
| 1973 | + if ( langKey && mw.isValidLang( langKey ) ) { |
| 1974 | + mw.setConfig( 'userLanguage', langKey); |
2015 | 1975 | } |
2016 | | - } |
2017 | | - runSetupFunctions(); |
2018 | | - } ); |
2019 | | - |
2020 | | - } ); |
| 1976 | + } |
| 1977 | + |
| 1978 | + // Update the image path |
| 1979 | + mw.setConfig( 'imagesPath', mw.getMwEmbedPath() + 'skins/common/images/' ); |
| 1980 | + |
| 1981 | + // Set up AJAX to not send dynamic URLs for loading scripts |
| 1982 | + $j.ajaxSetup( { |
| 1983 | + cache: true |
| 1984 | + } ); |
| 1985 | + |
| 1986 | + // Update the magic keywords |
| 1987 | + mw.Language.magicSetup(); |
| 1988 | + |
| 1989 | + // Set up mvEmbed utility jQuery bindings |
| 1990 | + mw.dojQueryBindings(); |
| 1991 | + |
| 1992 | + |
| 1993 | + // Special Hack for conditional jquery ui inclusion ( once |
| 1994 | + // Usability extension |
| 1995 | + // registers the jquery.ui skin in mw.style |
| 1996 | + if( mw.hasJQueryUiCss() ){ |
| 1997 | + mw.style[ 'ui_' + mw.getConfig( 'jQueryUISkin' ) ] = true; |
| 1998 | + } |
| 1999 | + |
| 2000 | + |
| 2001 | + // Make sure style sheets are loaded: |
| 2002 | + mw.load( ['mw.style.mwCommon'] , function(){ |
| 2003 | + // Run all the setup function hooks |
| 2004 | + // NOTE: setup functions are added via addSetupHook |
| 2005 | + // calls |
| 2006 | + // and must include a callback. |
| 2007 | + // |
| 2008 | + // Once complete we can run .ready() queued functions |
| 2009 | + function runSetupFunctions() { |
| 2010 | + if( mwSetupFunctions.length ) { |
| 2011 | + mwSetupFunctions.shift()( function() { |
| 2012 | + runSetupFunctions(); |
| 2013 | + } ); |
| 2014 | + }else{ |
| 2015 | + mw.runReadyFunctions(); |
| 2016 | + } |
| 2017 | + } |
| 2018 | + runSetupFunctions(); |
| 2019 | + } ); |
| 2020 | + |
| 2021 | + } ); |
| 2022 | + }); |
2021 | 2023 | }); |
2022 | 2024 | }); |
2023 | 2025 | }; |
Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js |
— | — | @@ -22,7 +22,12 @@ |
23 | 23 | if( typeof window['swarmTransport'] != 'undefined' ){ |
24 | 24 | // Add the swarm source |
25 | 25 | mw.log(" SwarmTransport :: checkPlayerSourcesEvent " + swapedPlayerId); |
26 | | - _this.addSwarmSource( embedPlayer, callback ); |
| 26 | + _this.addSwarmSource( embedPlayer, function(){ |
| 27 | + // Update the source if paused |
| 28 | + if( embedPlayer.paused ) { |
| 29 | + embedPlayer.mediaElement.autoSelectSource(); |
| 30 | + } |
| 31 | + }); |
27 | 32 | } |
28 | 33 | // Don't block on swarm request, directly do the callback |
29 | 34 | callback(); |
— | — | @@ -87,13 +92,14 @@ |
88 | 93 | return ; |
89 | 94 | } |
90 | 95 | mw.log( 'SwarmTransport: addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + data.torrent ); |
91 | | - // XXX need to update prefrence |
| 96 | + // XXX need to update preference |
92 | 97 | embedPlayer.mediaElement.tryAddSource( |
93 | 98 | $j('<source />') |
94 | 99 | .attr( { |
95 | 100 | 'type' : 'video/swarmTransport', |
96 | 101 | 'title': gM('mwe-swarmtransport-stream-ogg'), |
97 | | - 'src': 'tribe://' + data.torrent |
| 102 | + 'src': 'tribe://' + data.torrent, |
| 103 | + 'default' : true |
98 | 104 | } ) |
99 | 105 | .get( 0 ) |
100 | 106 | ); |
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | */ |
24 | 24 | mw.TimedText = function( embedPlayer, options ) { |
25 | 25 | return this.init( embedPlayer, options); |
26 | | - } |
| 26 | + }; |
27 | 27 | mw.TimedText.prototype = { |
28 | 28 | |
29 | 29 | /** |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | */ |
104 | 104 | init: function( embedPlayer, options ) { |
105 | 105 | var _this = this; |
106 | | - mw.log("TimedText: init() ") |
| 106 | + mw.log("TimedText: init() "); |
107 | 107 | this.embedPlayer = embedPlayer; |
108 | 108 | this.options = options; |
109 | 109 | |
— | — | @@ -463,7 +463,7 @@ |
464 | 464 | // Close the loader: |
465 | 465 | mw.closeLoaderDialog(); |
466 | 466 | _this.editText.showUI(); |
467 | | - }) |
| 467 | + }); |
468 | 468 | }, |
469 | 469 | |
470 | 470 | /** |
— | — | @@ -480,7 +480,7 @@ |
481 | 481 | var _this = this; |
482 | 482 | return $j.getLineItem( gM( 'mwe-timedtext-add-timed-text'), 'script', function() { |
483 | 483 | _this.showTimedTextEditUI( 'add' ); |
484 | | - } ) |
| 484 | + } ); |
485 | 485 | }, |
486 | 486 | |
487 | 487 | /** |
— | — | @@ -521,7 +521,7 @@ |
522 | 522 | if( mw.Language.names[ lang_key ]) { |
523 | 523 | return mw.Language.names[ lang_key ]; |
524 | 524 | } |
525 | | - return false |
| 525 | + return false; |
526 | 526 | }, |
527 | 527 | |
528 | 528 | /** |
— | — | @@ -551,7 +551,7 @@ |
552 | 552 | function() { |
553 | 553 | _this.selectLayout( layoutMode ); |
554 | 554 | } ) |
555 | | - ) |
| 555 | + ); |
556 | 556 | }); |
557 | 557 | return $ul; |
558 | 558 | }, |
— | — | @@ -614,7 +614,7 @@ |
615 | 615 | source.load( function() { |
616 | 616 | // Refresh the interface: |
617 | 617 | _this.refreshDisplay(); |
618 | | - }) |
| 618 | + }); |
619 | 619 | }, |
620 | 620 | |
621 | 621 | /** |
— | — | @@ -626,7 +626,7 @@ |
627 | 627 | // Refresh the Menu (if it has a target to refresh) |
628 | 628 | if( this.menuTarget ) { |
629 | 629 | mw.log('bind menu refresh display'); |
630 | | - this.bindMenu( this.menuTarget, false ) |
| 630 | + this.bindMenu( this.menuTarget, false ); |
631 | 631 | } |
632 | 632 | // Issues a "monitor" command to update the timed text for the new layout |
633 | 633 | this.monitor(); |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js |
— | — | @@ -613,6 +613,8 @@ |
614 | 614 | */ |
615 | 615 | showControlBar: function(){ |
616 | 616 | var animateDuration = 'slow'; |
| 617 | + if(! this.embedPlayer ) |
| 618 | + return ; |
617 | 619 | $j( this.embedPlayer.getPlayerElement() ).css( 'z-index', '1' ) |
618 | 620 | mw.log( 'showControlBar' ); |
619 | 621 | // Move up text track if present |
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js |
— | — | @@ -7,7 +7,6 @@ |
8 | 8 | |
9 | 9 | // Wrap in mw to not pollute global namespace |
10 | 10 | ( function( mw ) { |
11 | | - |
12 | 11 | |
13 | 12 | mw.addMessageKeys( [ |
14 | 13 | "mwe-sequencer-no-sequence-create", |