Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js |
— | — | @@ -277,7 +277,9 @@ |
278 | 278 | */ |
279 | 279 | getRefElementsRecurse: function( $node, startOffset, callback ){ |
280 | 280 | var _this = this; |
281 | | - |
| 281 | + if( ! $node ){ |
| 282 | + $node = this.getDom(); |
| 283 | + } |
282 | 284 | // Make sure $node is wrapped in jQuery object |
283 | 285 | $node = $j( $node ); |
284 | 286 | |
Index: branches/MwEmbedStandAlone/modules/AddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | 'gsrlimit': this.provider.limit, |
144 | 144 | 'gsroffset': this.provider.offset, |
145 | 145 | 'prop':'imageinfo|revisions|categories', |
146 | | - 'iiprop':'url|mime|size', |
| 146 | + 'iiprop':'url|mime|size|metadata', |
147 | 147 | 'iiurlwidth': parseInt( this.rsd.thumb_width ), |
148 | 148 | 'rvprop':'content' |
149 | 149 | }; |
— | — | @@ -230,6 +230,7 @@ |
231 | 231 | 'categories':page.categories |
232 | 232 | } |
233 | 233 | }; |
| 234 | + |
234 | 235 | for( var i in page.imageinfo[0].metadata ){ |
235 | 236 | if( page.imageinfo[0].metadata[i].name == 'length' ){ |
236 | 237 | resource.duration = page.imageinfo[0].metadata[i].value; |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -2031,31 +2031,34 @@ |
2032 | 2032 | * On clip done action. Called once a clip is done playing |
2033 | 2033 | */ |
2034 | 2034 | onClipDone: function() { |
2035 | | - mw.log( 'EmbedPlayer::onClipDone:' + this.id + ' doneCount:' + this.donePlayingCount ); |
| 2035 | + mw.log( 'EmbedPlayer::onClipDone:' + this.id + ' doneCount:' + this.donePlayingCount + ' stop state:' +this.isStopped() ); |
2036 | 2036 | var _this = this; |
2037 | | - |
2038 | | - |
| 2037 | + |
2039 | 2038 | // Only run stopped once: |
2040 | 2039 | if( !this.isStopped() ){ |
2041 | 2040 | // Stop the monitor: |
2042 | 2041 | this.stopMonitor(); |
2043 | 2042 | |
| 2043 | + // Show the control bar: |
| 2044 | + this.controlBuilder.showControlBar(); |
| 2045 | + |
2044 | 2046 | // Update the clip done playing count: |
2045 | 2047 | this.donePlayingCount ++; |
2046 | 2048 | |
2047 | 2049 | // Fire the html5 ended binding |
2048 | | - mw.log( "ended" ); |
2049 | 2050 | var onDoneActionObject = { |
2050 | 2051 | 'runBaseControlDone' : true |
2051 | 2052 | } |
2052 | 2053 | |
2053 | | - // Run the ended trigger ( allow the ended object to prevent default actions ) |
| 2054 | + // Run the ended trigger ( allow the ended object to prevent default actions ) |
| 2055 | + mw.log("EmbedPlayer::onClipDone:Trigger ended"); |
2054 | 2056 | $j( this ).trigger( 'ended', onDoneActionObject ); |
2055 | 2057 | |
2056 | 2058 | if( onDoneActionObject.runBaseControlDone ){ |
2057 | 2059 | |
2058 | 2060 | // Check if we have the "loop" property set |
2059 | 2061 | if( this.loop ) { |
| 2062 | + this.stop(); |
2060 | 2063 | this.play(); |
2061 | 2064 | return; |
2062 | 2065 | } |
— | — | @@ -2754,6 +2757,7 @@ |
2755 | 2758 | var _this = this; |
2756 | 2759 | if( this.paused === false ){ |
2757 | 2760 | this.paused = true; |
| 2761 | + mw.log('EmbedPlayer:trigger pause'); |
2758 | 2762 | $j( this ).trigger('pause'); |
2759 | 2763 | } |
2760 | 2764 | mw.log('mwEmbed:embedPlayer::pause() '); |
— | — | @@ -2783,38 +2787,34 @@ |
2784 | 2788 | */ |
2785 | 2789 | stop: function() { |
2786 | 2790 | var _this = this; |
2787 | | - mw.log( 'mvEmbed:stop:' + this.id ); |
| 2791 | + mw.log( 'mvEmbed:stop:' + this.id ); |
| 2792 | + |
2788 | 2793 | // no longer seeking: |
2789 | 2794 | this.didSeekJump = false; |
2790 | 2795 | |
2791 | | - // reset current time and prev time and seek offset |
2792 | | - this.currentTime = this.previousTime = this.serverSeekTime = 0; |
| 2796 | + // Reset current time and prev time and seek offset |
| 2797 | + this.currentTime = this.previousTime = this.serverSeekTime = 0; |
2793 | 2798 | |
2794 | | - // Previous player set time |
| 2799 | + // Issue pause to update interface (only call this parent) |
| 2800 | + if( !this.paused ){ |
| 2801 | + this.paused = true; |
| 2802 | + // update the interface |
| 2803 | + if ( this['parent_pause'] ) { |
| 2804 | + this.parent_pause(); |
| 2805 | + } else { |
| 2806 | + this.pause(); |
| 2807 | + } |
| 2808 | + } |
2795 | 2809 | |
2796 | | - // First issue pause to update interface (only call this parent) |
2797 | | - if ( this['parent_pause'] ) { |
2798 | | - this.parent_pause(); |
2799 | | - } else { |
2800 | | - this.pause(); |
2801 | | - } |
| 2810 | + // Rewrite the html to thumbnail disp |
| 2811 | + this.showThumbnail(); |
| 2812 | + this.bufferedPercent = 0; // reset buffer state |
| 2813 | + this.controlBuilder.setStatus( this.getTimeRange() ); |
2802 | 2814 | |
2803 | | - // Reset the currentTime: |
2804 | | - this.currentTime = 0; |
| 2815 | + // Reset the playhead |
| 2816 | + mw.log("EmbedPlayer::Stop:: Reset play head") |
| 2817 | + this.updatePlayHead( 0 ); |
2805 | 2818 | |
2806 | | - // Check if thumbnail is being displayed in which case do nothing |
2807 | | - if ( this.thumbnail_disp ) { |
2808 | | - // already in stooped state |
2809 | | - mw.log( 'already in stopped state' ); |
2810 | | - this.controlBuilder.setStatus( this.getTimeRange() ); |
2811 | | - } else { |
2812 | | - // rewrite the html to thumbnail disp |
2813 | | - this.showThumbnail(); |
2814 | | - this.bufferedPercent = 0; // reset buffer state |
2815 | | - this.updatePlayHead( 0 ); |
2816 | | - this.controlBuilder.setStatus( this.getTimeRange() ); |
2817 | | - } |
2818 | | - |
2819 | 2819 | //Bind play-btn-large play |
2820 | 2820 | this.$interface.find( '.play-btn-large' ) |
2821 | 2821 | .unbind( 'click' ) |
— | — | @@ -3134,10 +3134,10 @@ |
3135 | 3135 | * @param {Float} perc Value between 0 and 1 for position of playhead |
3136 | 3136 | */ |
3137 | 3137 | updatePlayHead: function( perc ) { |
3138 | | - $play_head = this.$interface.find( '.play_head' ); |
3139 | | - if ( this.controls && $play_head.length != 0 ) { |
| 3138 | + $playHead = this.$interface.find( '.play_head' ); |
| 3139 | + if ( this.controls && $playHead.length != 0 ) { |
3140 | 3140 | var val = parseInt( perc * 1000 ); |
3141 | | - $play_head.slider( 'value', val ); |
| 3141 | + $playHead.slider( 'value', val ); |
3142 | 3142 | } |
3143 | 3143 | }, |
3144 | 3144 | |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js |
— | — | @@ -1309,7 +1309,7 @@ |
1310 | 1310 | var $textList = $j( '<ul />' ); |
1311 | 1311 | $j.each( embedPlayer.mediaElement.getSources(), function( index, source ) { |
1312 | 1312 | if( source.getSrc() ) { |
1313 | | - mw.log("add src: " + source.getTitle() ); |
| 1313 | + mw.log("showDownloadWithSources:: Add src: " + source.getTitle() ); |
1314 | 1314 | var $dl_line = $j( '<li />').append( |
1315 | 1315 | $j('<a />') |
1316 | 1316 | .attr( 'href', source.getSrc() ) |
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayerNative.js |
— | — | @@ -342,7 +342,7 @@ |
343 | 343 | pause: function() { |
344 | 344 | this.getPlayerElement(); |
345 | 345 | this.parent_pause(); // update interface |
346 | | - if ( this.playerElement ) { |
| 346 | + if ( this.playerElement ) { // update player |
347 | 347 | this.playerElement.pause(); |
348 | 348 | } |
349 | 349 | }, |
— | — | @@ -495,7 +495,7 @@ |
496 | 496 | * Handle the native paused event |
497 | 497 | */ |
498 | 498 | onPaused: function(){ |
499 | | - mw.log("native:paused"); |
| 499 | + mw.log( "embedPlayer:native:paused" ); |
500 | 500 | this.pause(); |
501 | 501 | }, |
502 | 502 | |
— | — | @@ -503,7 +503,7 @@ |
504 | 504 | * Handle the native play event |
505 | 505 | */ |
506 | 506 | onPlay: function(){ |
507 | | - mw.log("native::play"); |
| 507 | + mw.log("embedPlayer:native::play"); |
508 | 508 | if( !this.isPlaying () ){ |
509 | 509 | this.play(); |
510 | 510 | } |
— | — | @@ -556,11 +556,7 @@ |
557 | 557 | */ |
558 | 558 | onended: function() { |
559 | 559 | var _this = this; |
560 | | - //mw.log( 'native:onended:' + this.playerElement.currentTime + ' real dur:' + this.getDuration() ); |
561 | | - // run abstract player onEned if the abstract player still things we are playing |
562 | | - |
563 | | - if( this.isPlaying() ){ |
564 | | - this.onClipDone(); |
565 | | - } |
| 560 | + mw.log( 'EmbedPlayer:native:onended:' + this.playerElement.currentTime + ' real dur:' + this.getDuration() ); |
| 561 | + this.onClipDone(); |
566 | 562 | } |
567 | 563 | }; |
Index: branches/MwEmbedStandAlone/modules/Sequencer/Sequencer.i18n.php |
— | — | @@ -125,6 +125,8 @@ |
126 | 126 | 'mwe-sequencer-publishing-status' => 'Publish status:', |
127 | 127 | 'mwe-sequencer-publishing-error' => 'Publish error', |
128 | 128 | 'mwe-sequencer-publishing-error-upload-desc' => 'There was an error in uploading the published file', |
| 129 | + 'mwe-sequencer-publishing-uploading' => 'Uploading published file', |
| 130 | + 'mwe-sequencer-publishing-updatepage' => 'Updating sequence description', |
129 | 131 | |
130 | 132 | 'mwe-sequencer-publishing-success' => 'Publish success', |
131 | 133 | 'mwe-sequencer-publishing-success-desc' => 'Sequence has successfully been published. [$1 Published file]', |
Index: branches/MwEmbedStandAlone/modules/Sequencer/actions/mw.SequencerActionsSequence.js |
— | — | @@ -371,13 +371,14 @@ |
372 | 372 | foggRender.doRender(); |
373 | 373 | }); |
374 | 374 | }, |
| 375 | + |
375 | 376 | // Upload the video from a supplied fogg target |
376 | 377 | // note xx this might be better in the firefogg library since it has firefogg specific calls |
377 | 378 | // @param {jQuery Object } $dialog |
378 | 379 | // @param {firefogg Object} |
379 | 380 | uploadRenderedVideo: function( $dialog, fogg ){ |
380 | 381 | var _this = this; |
381 | | - $j( '#firefoggStatusTarget' ).text( 'uploading' ); |
| 382 | + $j( '#firefoggStatusTarget' ).text( gM('mwe-sequencer-publishing-uploading' ) ); |
382 | 383 | var updateUploadStatus = function(){ |
383 | 384 | if( fogg.status() == 'uploading' ){ |
384 | 385 | $j('#firefoggPercentDone').text( |
— | — | @@ -410,7 +411,17 @@ |
411 | 412 | var apiResult = null; |
412 | 413 | } |
413 | 414 | } |
414 | | - _this.uploadDone( $dialog, apiResult ); |
| 415 | + // Check the api response |
| 416 | + if ( !apiResult || apiResult.error || ( apiResult.upload && |
| 417 | + ( apiResult.upload.result == "Failure" || apiResult.upload.error ) ) ) { |
| 418 | + |
| 419 | + $dialog.dialog( 'option', 'title', gM('mwe-sequencer-publishing-error' ) ); |
| 420 | + // xxx improve error handling |
| 421 | + $dialog.empty().text( gM( 'mwe-sequencer-publishing-error-upload-desc' ) ) |
| 422 | + return ; |
| 423 | + } |
| 424 | + |
| 425 | + _this.uploadSuccess( $dialog ); |
415 | 426 | return ; |
416 | 427 | } |
417 | 428 | } |
— | — | @@ -419,18 +430,17 @@ |
420 | 431 | updateUploadStatus(); |
421 | 432 | }) |
422 | 433 | }, |
423 | | - uploadDone: function($dialog, apiResult){ |
424 | | - var _this = this; |
425 | | - // Check the api response |
426 | | - if ( !apiResult || apiResult.error || ( apiResult.upload && |
427 | | - ( apiResult.upload.result == "Failure" || apiResult.upload.error ) ) ) { |
| 434 | + uploadSuccess: function($dialog, apiResult){ |
| 435 | + var _this = this; |
| 436 | + // Update the description page: |
| 437 | + $dialog.html( gM('mwe-sequencer-publishing-updatepage' ) ); |
| 438 | + |
| 439 | + // Update the file description |
| 440 | + this.sequencer.getServer().updateSequenceFileDescription(function(){ |
428 | 441 | |
429 | | - $dialog.dialog( 'option', 'title', gM('mwe-sequencer-publishing-error' ) ); |
430 | | - // xxx improve error handling |
431 | | - $dialog.empty().text( gM( 'mwe-sequencer-publishing-error-upload-desc' ) ) |
432 | | - return ; |
433 | | - } |
434 | | - |
| 442 | + }); |
| 443 | + |
| 444 | + |
435 | 445 | // Success link to the sequence page / ok closes dialog |
436 | 446 | $dialog.dialog( 'option', 'title', gM('mwe-sequencer-publishing-success' ) ); |
437 | 447 | var button = {}; |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerAddMedia.js |
— | — | @@ -211,7 +211,6 @@ |
212 | 212 | // By default the imported resource is its entire duration |
213 | 213 | $smilRef.attr( 'dur', resource.duration ); |
214 | 214 | } |
215 | | - |
216 | 215 | // Set all available params |
217 | 216 | var resourceAttributeMap = { |
218 | 217 | 'type' : 'mime', |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerServer.js |
— | — | @@ -59,13 +59,19 @@ |
60 | 60 | this.pagePathUrl = serverConfig.pagePathUrl; |
61 | 61 | } |
62 | 62 | |
| 63 | + if( serverConfig.userName ){ |
| 64 | + this.userName = serverConfig.userName; |
| 65 | + } |
| 66 | + |
63 | 67 | } |
64 | 68 | if( this.isConfigured() ){ |
65 | 69 | mw.log("Error: Sequencer server needs a full serverConfig to be initialized") |
66 | 70 | return false; |
67 | 71 | } |
68 | 72 | }, |
69 | | - |
| 73 | + getUserName: function(){ |
| 74 | + return this.userName; |
| 75 | + }, |
70 | 76 | |
71 | 77 | // Check if the server exists / is configured |
72 | 78 | isConfigured: function( ){ |
— | — | @@ -216,6 +222,52 @@ |
217 | 223 | callback( false ); |
218 | 224 | }); |
219 | 225 | }, |
| 226 | + |
| 227 | + updateSequenceFileDescription: function(){ |
| 228 | + var _this = this; |
| 229 | + mw.getToken( apiUrl, title, function( token ){ |
| 230 | + var pageText = '' |
| 231 | + if( mw.parseUri( apiUrl ).host == 'commons.wikimedia.org' ){ |
| 232 | + pageText = _this.getCommonsDescriptionText() |
| 233 | + } else { |
| 234 | + pageText = _this.getBaseFileDescription() |
| 235 | + } |
| 236 | + var request = { |
| 237 | + 'action':'edit', |
| 238 | + 'token' : token, |
| 239 | + 'title' : 'File:' + _this.getVideoFileName(), |
| 240 | + 'summary' : 'Automated sequence description page for published sequence: ' + _this.getTitle(), |
| 241 | + 'text' : pageText |
| 242 | + } |
| 243 | + }) |
| 244 | + }, |
| 245 | + getBaseFileDescription: function(){ |
| 246 | + return 'Published sequence file for [[Sequence:' + _this.getTitle() + ']]'; |
| 247 | + }, |
| 248 | + getCommonsDescriptionText: function(){ |
| 249 | + var descText ="{{Information\n" + |
| 250 | + "|Description=" + _this.getSequenceFileBaseDescription() + "\n" + |
| 251 | + "|Source= Sequence Sources assets include:\n"; |
| 252 | + |
| 253 | + // loop over every asset: |
| 254 | + this.sequencer.getSmil().getBody().getRefElementsRecurse(null, 0, function( $node ){ |
| 255 | + var $apiKeyParam = $node.children("param[name='apiTitleKey']"); |
| 256 | + if( $apiKeyParam.length ){ |
| 257 | + descText+= "*[[" + $apiKeyParam.attr('value') + "]]\n"; |
| 258 | + } |
| 259 | + }); |
| 260 | + var dt = new Date(); |
| 261 | + descText+='|Date=' + dt.getFullYear() + '-' + |
| 262 | + pad2(dt.getMonth()+1) + '-' + |
| 263 | + pad2(dt.getDate()) + "\n" + |
| 264 | + "|Author=Last edit by [[User:" + _this.getUserName() + "\n" + |
| 265 | + "|Permission= {{Cc-by-nc-sa-2.0-dual}}" + "\n" + |
| 266 | + "}}"; |
| 267 | + |
| 268 | + // Add Published Sequence category ( for now ) |
| 269 | + descText += "\n[[Category:Published Sequence]]\n"; |
| 270 | + }, |
| 271 | + |
220 | 272 | /** |
221 | 273 | * Get the sequence description page url |
222 | 274 | * @param {String} Optional Sequence title key |
Index: branches/MwEmbedStandAlone/modules/Sequencer/mw.SequencerTimeline.js |
— | — | @@ -468,6 +468,7 @@ |
469 | 469 | }, |
470 | 470 | |
471 | 471 | handleReorder: function ( movedClip ){ |
| 472 | + mw.log("SequencerTimeline:: handleReorder"); |
472 | 473 | var _this = this; |
473 | 474 | var smil = this.sequencer.getSmil(); |
474 | 475 | var movedIndex = null; |
Index: branches/MwEmbedStandAlone/modules/Sequencer/remotes/mw.MediaWikiRemoteSequencer.js |
— | — | @@ -79,25 +79,21 @@ |
80 | 80 | if( mw.getConfig( 'Sequencer.KalturaPlayerEditOverlay' )){ |
81 | 81 | var embedPlayer = $j( '#' + embedPlayerId ).get(0); |
82 | 82 | |
83 | | - $j( embedPlayer ).bind( 'pause', function() { |
84 | | - // For now don't overlay smil players ( used in editor ) |
85 | | - // xxx in the future we should have an editor class |
86 | | - if( embedPlayer.supports['overlays'] && embedPlayer.instanceOf.toLowerCase() != 'smil' ){ |
87 | | - mw.remoteSequencerAddEditOverlay( embedPlayerId ) |
88 | | - // xxx should use getter setter |
89 | | - embedPlayer.controlBuilder.displayOptionsMenuFlag = true; |
90 | | - } |
| 83 | + $j( embedPlayer ).bind( 'pause', function() { |
| 84 | + mw.remoteSequencerAddEditOverlay( embedPlayerId ) |
| 85 | + // xxx should use getter setter |
| 86 | + embedPlayer.controlBuilder.displayOptionsMenuFlag = true; |
91 | 87 | return true; |
92 | 88 | }) |
93 | | - $j( embedPlayer ).bind( 'ended', function( onDoneAction ){ |
| 89 | + $j( embedPlayer ).bind( 'ended', function( onDoneAction ){ |
94 | 90 | // pause event should fire |
95 | | - //mw.remoteSequencerAddEditOverlay( embedPlayerId ) |
| 91 | + mw.remoteSequencerAddEditOverlay( embedPlayerId ); |
96 | 92 | |
97 | 93 | // show the credits screen after 3 seconds |
98 | | - setTimeout(function(){ |
| 94 | + setTimeout(function(){ |
99 | 95 | $j( embedPlayer ).siblings( '.kalturaEditOverlay' ).fadeOut( 'fast' ); |
100 | 96 | embedPlayer.$interface.find('.k-menu').fadeIn('fast'); |
101 | | - },3000) |
| 97 | + }, 3000) |
102 | 98 | |
103 | 99 | // On end runs before interface bindings (give the dom 10ms to build out the menu ) |
104 | 100 | setTimeout(function(){ |
— | — | @@ -113,6 +109,16 @@ |
114 | 110 | }); |
115 | 111 | mw.remoteSequencerAddEditOverlay = function( embedPlayerId ){ |
116 | 112 | var embedPlayer = $j( '#' + embedPlayerId ).get(0); |
| 113 | + |
| 114 | + // Check if we can do the overlay:: |
| 115 | + if( !embedPlayer.supports['overlays'] |
| 116 | + || embedPlayer.instanceOf.toLowerCase() == 'smil' |
| 117 | + || embedPlayer.getHeight() < 180 |
| 118 | + || embedPlayer.getWidth() < 240 |
| 119 | + ){ |
| 120 | + return ; |
| 121 | + } |
| 122 | + |
117 | 123 | if(! $j( '#' + embedPlayerId ).siblings( '.kalturaEditOverlay' ).length ){ |
118 | 124 | var editLink = '#'; |
119 | 125 | if( mw.isLocalDomain( mw.getApiProviderURL( embedPlayer.apiProvider ) ) |
— | — | @@ -509,7 +515,8 @@ |
510 | 516 | 'type' : 'mediaWiki', |
511 | 517 | 'url' : _this.getApiUrl(), |
512 | 518 | 'titleKey' : wgPageName, |
513 | | - 'pagePathUrl' : wgServer + wgArticlePath |
| 519 | + 'pagePathUrl' : wgServer + wgArticlePath, |
| 520 | + 'userName' : wgUserName |
514 | 521 | }, |
515 | 522 | // Set the add media wizard to only include commons: |
516 | 523 | addMedia : { |
Index: branches/MwEmbedStandAlone/libraries/jquery/plugins/jquery.menu/jquery.menu.js |
— | — | @@ -328,7 +328,7 @@ |
329 | 329 | } |
330 | 330 | }, |
331 | 331 | function() { |
332 | | - if( menuitem && !menuitem.hasClass('divider') && !menuitem.hasClass('disabled') ){ |
| 332 | + if( typeof menuitem != 'undefined' && !menuitem.hasClass('divider') && !menuitem.hasClass('disabled') ){ |
333 | 333 | $(this).removeClass(options.linkHover).blur().parent().removeClass('active-menuitem'); |
334 | 334 | } |
335 | 335 | } |
Index: branches/MwEmbedStandAlone/libraries/jquery/jquery-1.4.2.js |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | * |
15 | 15 | * Date: Sat Feb 13 22:33:48 2010 -0500 |
16 | 16 | */ |
| 17 | + |
17 | 18 | (function( window, undefined ) { |
18 | 19 | |
19 | 20 | // Define a local copy of jQuery |
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js |
— | — | @@ -526,14 +526,21 @@ |
527 | 527 | if( typeof classSet == 'function') { |
528 | 528 | callback = classSet; |
529 | 529 | } |
| 530 | + |
530 | 531 | // Inject mwEmbed if needed |
531 | 532 | if ( typeof MW_EMBED_VERSION == 'undefined' ) { |
532 | 533 | if ( mwUseScriptLoader ) { |
533 | 534 | var rurl = mwEmbedHostPath + '/ResourceLoader.php?class='; |
534 | 535 | |
535 | 536 | var coma = ''; |
| 537 | + |
| 538 | + |
536 | 539 | // Add jQuery too if we need it: |
537 | | - if ( typeof window.jQuery == 'undefined' ) { |
| 540 | + if ( typeof window.jQuery == 'undefined' |
| 541 | + || |
| 542 | + // force load jquery if version 1.3.2 ( issues ) |
| 543 | + jQuery.fn.jquery == '1.3.2') |
| 544 | + { |
538 | 545 | rurl += 'window.jQuery'; |
539 | 546 | coma = ','; |
540 | 547 | } |
— | — | @@ -555,17 +562,29 @@ |
556 | 563 | rurl += '&' + mwGetReqArgs(); |
557 | 564 | importScriptURI( rurl ); |
558 | 565 | } else { |
559 | | - // load mwEmbed js |
560 | | - importScriptURI( mwEmbedHostPath + '/mwEmbed.js?' + mwGetReqArgs() ); |
561 | 566 | |
562 | | - // Load the class set as part of mwReady callback |
563 | | - var instanceCallback = callback; |
564 | | - var callback = function(){ |
565 | | - mw.load( classSet, function(){ |
566 | | - instanceCallback(); |
567 | | - }) |
| 567 | + // force load jQuery ( issues with '1.3.2' .data handling |
| 568 | + if( jQuery && jQuery.fn.jquery== '1.3.2' ){ |
| 569 | + console.log('load: ' + mwEmbedHostPath + '/libraries/jquery/jquery-1.4.2.js' ); |
| 570 | + importScriptURI( mwEmbedHostPath + '/libraries/jquery/jquery-1.4.2.js?' + mwGetReqArgs() ); |
568 | 571 | } |
569 | | - |
| 572 | + waitForJQueryUpgrade = function(){ |
| 573 | + if( jQuery && jQuery.fn.jquery== '1.3.2' ){ |
| 574 | + setTimeout( waitForJQueryUpgrade, 20); |
| 575 | + } else { |
| 576 | + // load mwEmbed js |
| 577 | + importScriptURI( mwEmbedHostPath + '/mwEmbed.js?' + mwGetReqArgs() ); |
| 578 | + |
| 579 | + // Load the class set as part of mwReady callback |
| 580 | + var instanceCallback = callback; |
| 581 | + var callback = function(){ |
| 582 | + mw.load( classSet, function(){ |
| 583 | + instanceCallback(); |
| 584 | + }) |
| 585 | + } |
| 586 | + } |
| 587 | + } |
| 588 | + waitForJQueryUpgrade(); |
570 | 589 | } |
571 | 590 | } |
572 | 591 | waitMwEmbedReady( callback ); |