Index: branches/js2-work/phase3/js2/mwEmbed/libTimedText/mw.timedText.js |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | /** |
72 | 72 | * The list of enabled sources |
73 | 73 | */ |
74 | | - enabledSources: { }, |
| 74 | + enabledSources: [ ], |
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Text sources ( a set of textSource objects ) |
— | — | @@ -120,8 +120,8 @@ |
121 | 121 | embedPlayer.addHook( 'monitor', function(){ |
122 | 122 | _this.monitor(); |
123 | 123 | } ) |
124 | | - // Load cookie / page prefrences |
125 | | - // |
| 124 | + // @@TODO: Load cookie / page prefrences |
| 125 | + |
126 | 126 | // Load textSources |
127 | 127 | _this.loadTextSources( function(){ |
128 | 128 | |
— | — | @@ -153,7 +153,8 @@ |
154 | 154 | // make a new textSource: |
155 | 155 | var source = new textSource( inlineSources[i] ); |
156 | 156 | this.textSources.push( source ); |
157 | | - } |
| 157 | + } |
| 158 | + callback(); |
158 | 159 | }, |
159 | 160 | |
160 | 161 | /** |
— | — | @@ -178,7 +179,7 @@ |
179 | 180 | for(var i in this.enabledSources ){ |
180 | 181 | var enabledSource = this.enabledSources[ i ]; |
181 | 182 | if( ! enabledSource.loaded ) |
182 | | - this.loadAndParseSource( enabledSource ); |
| 183 | + enabledSource.load(); |
183 | 184 | } |
184 | 185 | }, |
185 | 186 | |
— | — | @@ -312,7 +313,7 @@ |
313 | 314 | */ |
314 | 315 | getLayoutMenu: function(){ |
315 | 316 | var _this = this; |
316 | | - var layoutOptions = [ 'ontop', 'off', 'below' ]; |
| 317 | + var layoutOptions = [ 'ontop', 'below', 'off' ]; |
317 | 318 | $ul = $j('<ul>'); |
318 | 319 | $j.each(layoutOptions, function( na, layoutMode ){ |
319 | 320 | var icon = ( _this.config.layout == layoutMode )? 'bullet' : 'radio-on'; |
— | — | @@ -415,11 +416,11 @@ |
416 | 417 | return ; |
417 | 418 | } |
418 | 419 | // Issue the load request ( if we can ) |
419 | | - if ( mw.parseUri( document.URL ).host != mw.parseUri( this.getSrc() ).host ){ |
420 | | - mw.log("Error can't load non-json src via jsonp:" + this.getSrc() ) |
421 | | - return ; |
422 | | - } |
423 | | - var XHR = $j.get( this.getSrc(), function(){ |
| 420 | + //if ( mw.parseUri( document.URL ).host != mw.parseUri( this.getSrc() ).host ){ |
| 421 | + // mw.log("Error can't load non-json src via jsonp:" + this.getSrc() ) |
| 422 | + // return ; |
| 423 | + //} |
| 424 | + $j.get( this.getSrc(), function(){ |
424 | 425 | // Parse and load captions: |
425 | 426 | _this.captions = handler( data ); |
426 | 427 | // Update the loaded state: |