Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js |
— | — | @@ -23,15 +23,14 @@ |
24 | 24 | // Add the swarm source |
25 | 25 | mw.log(" SwarmTransport :: checkPlayerSourcesEvent " + swapedPlayerId); |
26 | 26 | _this.addSwarmSource( embedPlayer, callback ); |
27 | | - } else { |
28 | | - // No swarm support just directly issue the callback |
29 | | - callback(); |
30 | | - } |
| 27 | + } |
| 28 | + // Don't block on swarm request, directly do the callback |
| 29 | + callback(); |
31 | 30 | } ); |
32 | 31 | |
33 | 32 | // Check if we have a "recommend" binding and provide an xpi install link |
34 | 33 | mw.log('SwarmTransport::bind:addControlBindingsEvent'); |
35 | | - $j( embedPlayer ).bind( 'addControlBindingsEvent', function(){ |
| 34 | + $j( embedPlayer ).bind( 'addControlBindingsEvent', function(){ |
36 | 35 | if( mw.getConfig( 'SwarmTransport.Recommend' ) && |
37 | 36 | typeof window['swarmTransport'] == 'undefined' && |
38 | 37 | $j.browser.mozilla ) |
— | — | @@ -87,14 +86,14 @@ |
88 | 87 | callback(); |
89 | 88 | return ; |
90 | 89 | } |
91 | | - mw.log( 'SwarmTransport: addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + data.torrent ); |
| 90 | + mw.log( 'SwarmTransport: addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + data.torrent ); |
| 91 | + // XXX need to update prefrence |
92 | 92 | embedPlayer.mediaElement.tryAddSource( |
93 | 93 | $j('<source />') |
94 | 94 | .attr( { |
95 | 95 | 'type' : 'video/swarmTransport', |
96 | 96 | 'title': gM('mwe-swarmtransport-stream-ogg'), |
97 | | - 'src': 'tribe://' + data.torrent, |
98 | | - 'default' : true // Mark as default source |
| 97 | + 'src': 'tribe://' + data.torrent |
99 | 98 | } ) |
100 | 99 | .get( 0 ) |
101 | 100 | ); |
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedTextEdit.js |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | $j('#timed-text-file-preview') |
187 | 187 | .css({ |
188 | 188 | 'width':'100%', |
189 | | - 'height': ( $target.find( '.rightcolumn' ).height() - $j('#timed-text-rightcolum-desc').height() ) + 'px' |
| 189 | + 'height': '300px' |
190 | 190 | }); |
191 | 191 | |
192 | 192 | // Add Select file: |
— | — | @@ -215,9 +215,9 @@ |
216 | 216 | } ) |
217 | 217 | .change(function() { |
218 | 218 | var langKey = $j(this).val(); |
219 | | - if( mw.languages[ langKey ] ) { |
| 219 | + if( mw.Language.names[ langKey ] ) { |
220 | 220 | $buttonTarget.find('.btnText').text( |
221 | | - unescape( mw.languages[ langKey ] ) |
| 221 | + unescape( mw.Language.names[ langKey ] ) |
222 | 222 | ); |
223 | 223 | } |
224 | 224 | }), |
— | — | @@ -233,6 +233,7 @@ |
234 | 234 | |
235 | 235 | |
236 | 236 | var $buttonTarget = $target.find('.language-select-btn'); |
| 237 | + |
237 | 238 | // Add menu container: |
238 | 239 | var loc = $buttonTarget.position(); |
239 | 240 | $target.append( |
— | — | @@ -241,10 +242,8 @@ |
242 | 243 | .attr( 'id', 'upload-language-select' ) |
243 | 244 | .loadingSpinner() |
244 | 245 | .css( { |
245 | | - 'position' : 'absolute', |
246 | | - 'z-index' : 10, |
247 | | - 'top' : ( loc.top + 40 ) + 'px', |
248 | | - 'left' : parseInt( loc.left ) + 'px', |
| 246 | + 'position' : 'relative', |
| 247 | + 'z-index' : 10, |
249 | 248 | 'height' : '180px', |
250 | 249 | 'width' : '180px', |
251 | 250 | 'overflow' : 'auto', |
— | — | @@ -254,11 +253,16 @@ |
255 | 254 | .hide() |
256 | 255 | ); |
257 | 256 | // Add menu binding to button target |
258 | | - $buttonTarget.menu( { |
259 | | - 'content' : _this.getLanguageList(), |
260 | | - 'backLinkText' : gM( 'mwe-timedtext-back-btn' ), |
261 | | - 'targetMenuContainer': '#upload-language-select' |
262 | | - } ); |
| 257 | + setTimeout(function(){ |
| 258 | + $buttonTarget.menu( { |
| 259 | + 'content' : _this.getLanguageList(), |
| 260 | + 'backLinkText' : gM( 'mwe-timedtext-back-btn' ), |
| 261 | + 'targetMenuContainer': '#upload-language-select', |
| 262 | + 'keepPosition' : true |
| 263 | + } ); |
| 264 | + // force the layout ( menu binding does strange things ) |
| 265 | + $j('#upload-language-select').css( {'left': '315px', 'top' : '87px', 'position' : 'absolute'}); |
| 266 | + },10); |
263 | 267 | |
264 | 268 | |
265 | 269 | //Add upload input bindings: |
— | — | @@ -279,9 +283,9 @@ |
280 | 284 | var langKey = $j(this).val().split( '.' ); |
281 | 285 | var extension = langKey.pop(); |
282 | 286 | langKey = langKey.pop(); |
283 | | - if( mw.languages[ langKey ] ) { |
| 287 | + if( mw.Language.names[ langKey ] ) { |
284 | 288 | $buttonTarget.find('.btnText').text( |
285 | | - unescape( mw.languages[ langKey ] ) |
| 289 | + unescape( mw.Language.names[ langKey ] ) |
286 | 290 | ); |
287 | 291 | // Update the key code |
288 | 292 | $j('#timed-text-langKey-input').val( langKey ); |
— | — | @@ -338,22 +342,29 @@ |
339 | 343 | buttons[ gM("mwe-timedtext-upload-text-another")] = function() { |
340 | 344 | // just close the current dialog: |
341 | 345 | $j( this ).dialog('close'); |
342 | | - } |
| 346 | + }; |
343 | 347 | buttons[ gM( "mwe-timedtext-upload-text-done-uploading" ) ] = function() { |
344 | 348 | window.location.reload(); |
345 | | - } |
| 349 | + }; |
346 | 350 | //Edit success |
347 | | - mw.addDialog( { |
348 | | - 'title' : gM( "mwe-timedtext-upload-text-done"), |
349 | | - 'content' : gM("mwe-timedtext-upload-text-success"), |
350 | | - 'buttons' : buttons |
351 | | - }) |
| 351 | + setTimeout(function(){ |
| 352 | + mw.addDialog( { |
| 353 | + 'width' : '400px', |
| 354 | + 'title' : gM( "mwe-timedtext-upload-text-done"), |
| 355 | + 'content' : gM("mwe-timedtext-upload-text-success"), |
| 356 | + 'buttons' : buttons |
| 357 | + }); |
| 358 | + },10 ); |
352 | 359 | }else{ |
353 | | - mw.addDialog({ |
354 | | - 'title' : gM( "mwe-timedtext-upload-text-fail-title"), |
355 | | - 'content' :gM( "mwe-timedtext-upload-text-fail-desc"), |
356 | | - 'buttons' : gM( 'mwe-ok' ) |
357 | | - }) |
| 360 | + //Edit fail |
| 361 | + setTimeout(function(){ |
| 362 | + mw.addDialog({ |
| 363 | + 'width' : '400px', |
| 364 | + 'title' : gM( "mwe-timedtext-upload-text-fail-title"), |
| 365 | + 'content' :gM( "mwe-timedtext-upload-text-fail-desc"), |
| 366 | + 'buttons' : gM( 'mwe-ok' ) |
| 367 | + }); |
| 368 | + },10 ); |
358 | 369 | } |
359 | 370 | }); |
360 | 371 | }) |
— | — | @@ -374,8 +385,8 @@ |
375 | 386 | var _this = this; |
376 | 387 | var $langMenu = $j( '<ul>' ); |
377 | 388 | // Loop through all supported languages: |
378 | | - for ( var langKey in mw.languages ) { |
379 | | - var language = mw.languages [ langKey ]; |
| 389 | + for ( var langKey in mw.Language.names ) { |
| 390 | + var language = mw.Language.names [ langKey ]; |
380 | 391 | var source_icon = 'radio-on'; |
381 | 392 | //check if the key is in the _this.parentTimedText source array |
382 | 393 | for( var i in _this.parentTimedText.textSources ) { |
— | — | @@ -393,15 +404,16 @@ |
394 | 405 | }, |
395 | 406 | getLangMenuItem: function( langKey , source_icon) { |
396 | 407 | return $j.getLineItem( |
397 | | - langKey + ' - ' + unescape( mw.languages[ langKey ] ), |
| 408 | + langKey + ' - ' + unescape( mw.Language.names[ langKey ] ), |
398 | 409 | source_icon, |
399 | | - function() { |
| 410 | + function() { |
400 | 411 | mw.log( "Selected: " + langKey ); |
401 | 412 | // Update the input box text |
402 | 413 | $j('#timed-text-langKey-input').val( langKey ); |
403 | | - // Update the menu item: |
404 | | - $j( '#language-select' ).val( unescape( mw.languages[ langKey ] ) ) |
405 | | - } ); |
| 414 | + // Update the menu item: |
| 415 | + $j('#language-select').find('.btnText').text( unescape( mw.Language.names[ langKey ] ) ) |
| 416 | + } |
| 417 | + ); |
406 | 418 | }, |
407 | 419 | /** |
408 | 420 | * Creates the interface dialog container |
— | — | @@ -430,18 +442,23 @@ |
431 | 443 | $j( _this.target_container ).dialog( { |
432 | 444 | bgiframe: true, |
433 | 445 | autoOpen: true, |
| 446 | + width: $j(window).width()-50, |
| 447 | + height: $j(window).height()-50, |
| 448 | + position : 'center', |
434 | 449 | modal: true, |
435 | 450 | draggable: false, |
436 | 451 | resizable: false, |
437 | 452 | buttons: cancelButton, |
438 | 453 | close: function() { |
439 | | - // if we are 'editing' we should confirm they want to exist: |
| 454 | + // @@TODO if we are 'editing' we should confirm they want to exist: |
440 | 455 | $j( this ).parents( '.ui-dialog' ).fadeOut( 'slow' ); |
441 | 456 | } |
442 | 457 | } ); |
| 458 | + // set a non-blocking fit window request |
| 459 | + setTimeout(function(){ |
| 460 | + $j( _this.target_container ).dialogFitWindow(); |
| 461 | + },10); |
443 | 462 | |
444 | | - $j( _this.target_container ).dialogFitWindow(); |
445 | | - |
446 | 463 | // Add the window resize hook to keep dialog layout |
447 | 464 | $j( window ).resize( function() { |
448 | 465 | $j( _this.target_container ).dialogFitWindow(); |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | |
75 | 75 | } |
76 | 76 | if( this.isConfigured() ){ |
77 | | - mw.log("Error: Sequencer server needs a full serverConfig to be initialized") |
| 77 | + mw.log("Error: Sequencer server needs a full serverConfig to be initialized"); |
78 | 78 | return false; |
79 | 79 | } |
80 | 80 | }, |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | var _this = this; |
109 | 109 | mw.getTitleText( this.getApiUrl(), this.getTitleKey(), function( smilPage ){ |
110 | 110 | // Check for remote payload wrapper |
111 | | - // XXX need to support multipe pages in single context |
| 111 | + // XXX need to support multiple pages in single context |
112 | 112 | _this.currentSequencePage = _this.parseSequencerPage( smilPage ); |
113 | 113 | // Cache the latest serverSmil ( for local change checks ) |
114 | 114 | // ( save requests automatically respond with warnings on other user updates ) |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | 'pageEnd' : $j.trim( |
166 | 166 | pageText.substring( pageText.indexOf(endKey) + endKey.length ) |
167 | 167 | ) |
168 | | - } |
| 168 | + }; |
169 | 169 | }, |
170 | 170 | |
171 | 171 | |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | }, |
187 | 187 | // Check if the sequence was saved in this edit session |
188 | 188 | hasSequenceBeenSavedOrPublished: function(){ |
189 | | - return this.sequenceSaved || this.sequencePublished |
| 189 | + return ( this.sequenceSaved || this.sequencePublished ); |
190 | 190 | }, |
191 | 191 | // Get a save token, if unable to do so return false |
192 | 192 | getSaveToken: function( callback ){ |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | } |
198 | 198 | mw.getToken( this.getApiUrl(), this.getTitleKey(), function( saveToken ){ |
199 | 199 | _this.saveToken = saveToken; |
200 | | - callback ( _this.saveToken ) |
| 200 | + callback ( _this.saveToken ); |
201 | 201 | }); |
202 | 202 | }, |
203 | 203 | |
Index: branches/MwEmbedStandAlone/libraries/jquery/plugins/jquery.menu/jquery.menu.js |
— | — | @@ -166,8 +166,12 @@ |
167 | 167 | if (options.flyOutOnState) { container.find('li a').removeClass(options.flyOutOnState); }; |
168 | 168 | if (options.callerOnState) { caller.removeClass(options.callerOnState); }; |
169 | 169 | if (container.is('.fg-menu-ipod')) { menu.resetDrilldownMenu(); }; |
170 | | - if (container.is('.fg-menu-flyout')) { menu.resetFlyoutMenu(); }; |
171 | | - container.parent().hide(); |
| 170 | + if (container.is('.fg-menu-flyout')) { menu.resetFlyoutMenu(); }; |
| 171 | + if( ! options.keepPosition ){ |
| 172 | + container.parent().hide(); |
| 173 | + } else { |
| 174 | + container.hide(); |
| 175 | + } |
172 | 176 | menu.menuOpen = false; |
173 | 177 | $(document).unbind('click', killAllMenus); |
174 | 178 | $(document).unbind('keydown'); |
— | — | @@ -283,14 +287,18 @@ |
284 | 288 | |
285 | 289 | this.create = function() { |
286 | 290 | mw.log( "jquery.menu.create "); |
| 291 | + |
287 | 292 | container.css({ |
288 | 293 | 'width' : options.width |
289 | 294 | }) |
290 | | - .appendTo('body') |
291 | 295 | .find( 'ul:first' ) |
292 | 296 | .not( '.fg-menu-breadcrumb' ) |
293 | 297 | .addClass('fg-menu'); |
294 | 298 | |
| 299 | + if(!options.keepPosition){ |
| 300 | + container.appendTo('body') |
| 301 | + } |
| 302 | + |
295 | 303 | |
296 | 304 | container.find('ul, li a').addClass('ui-corner-all'); |
297 | 305 | |
— | — | @@ -345,8 +353,9 @@ |
346 | 354 | function() { $(this).removeClass(options.linkHoverSecondary); } |
347 | 355 | ); |
348 | 356 | }; |
349 | | - |
350 | | - menu.setPosition(container, caller, options); |
| 357 | + if( !options.keepPosition ){ |
| 358 | + menu.setPosition(container, caller, options); |
| 359 | + } |
351 | 360 | menu.menuExists = true; |
352 | 361 | |
353 | 362 | if( typeof options.createMenuCallback == 'function' ){ |