Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -465,15 +465,16 @@ |
466 | 466 | } |
467 | 467 | } |
468 | 468 | |
| 469 | + // Remove the targetElement |
| 470 | + $j( targetElement ).replaceWith( swapPlayerElement ); |
| 471 | + |
469 | 472 | // Now Swap out the video element for the embed_video obj: |
470 | | - $j( targetElement ) |
| 473 | + //$j( targetElement ) |
471 | 474 | // Put the swapPlayerElement after the targetElement |
472 | | - .after( swapPlayerElement ) |
473 | | - // Remove the targetElement |
474 | | - .remove(); |
| 475 | + //.after( swapPlayerElement ); |
475 | 476 | |
476 | 477 | |
477 | | - // Set swapPlayerElement has height / width set: |
| 478 | + // Set swapPlayerElement has height / width set and set to loading: |
478 | 479 | $j( swapPlayerElement ).css( { |
479 | 480 | 'width' : playerInterface.width + 'px', |
480 | 481 | 'height' : playerInterface.height + 'px' |
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js |
— | — | @@ -942,6 +942,8 @@ |
943 | 943 | loadRequest = loadRequest[0]; |
944 | 944 | } |
945 | 945 | } |
| 946 | + //Add a class callback hook ( for script-loader onDone callback ) |
| 947 | + mwLoadDoneCB[ loadRequest ] = callback; |
946 | 948 | |
947 | 949 | // Check for the module name loader function |
948 | 950 | if( this.moduleLoaders[ loadRequest ] && |
— | — | @@ -1169,17 +1171,7 @@ |
1170 | 1172 | } |
1171 | 1173 | |
1172 | 1174 | // Include class defined check for older browsers |
1173 | | - var classDone = false; |
1174 | | - |
1175 | | - //Add a class callback hook ( for script-loader onDone callback ) |
1176 | | - mwLoadDoneCB[ className ] = function(){ |
1177 | | - mw.log('run callback for: ' + className ); |
1178 | | - if( callback ){ |
1179 | | - callback( className ); |
1180 | | - } |
1181 | | - callback = null; |
1182 | | - mwLoadDoneCB[ className ] = 'done'; |
1183 | | - }; |
| 1175 | + var classDone = false; |
1184 | 1176 | |
1185 | 1177 | // Issue the request to load the class (include class name in result callback: |
1186 | 1178 | mw.getScript( scriptRequest, function( scriptRequest ) { |
— | — | @@ -1762,15 +1754,15 @@ |
1763 | 1755 | var script = document.createElement("script"); |
1764 | 1756 | script.setAttribute( 'src', url ); |
1765 | 1757 | |
1766 | | - // Attach handlers ( if not using script loader that issues onDone callback ) |
1767 | | - if( !mw.getScriptLoaderPath() ){ |
1768 | | - script.onload = script.onreadystatechange = function(){ |
1769 | | - if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { |
1770 | | - if( callback ) |
1771 | | - callback( scriptRequest ); |
1772 | | - } |
1773 | | - }; |
1774 | | - } |
| 1758 | + // Attach handlers ( if using script loader it issues onDone callback as well ) |
| 1759 | + script.onload = script.onreadystatechange = function(){ |
| 1760 | + if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { |
| 1761 | + if( callback ){ |
| 1762 | + callback( scriptRequest ); |
| 1763 | + callback = null; |
| 1764 | + } |
| 1765 | + } |
| 1766 | + }; |
1775 | 1767 | // Append the script to the DOM: |
1776 | 1768 | head.appendChild( script ); |
1777 | 1769 | } |