http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61140
Revision: 61140 Author: dale Date: 2010-01-16 18:02:07 +0000 (Sat, 16 Jan 2010) Log Message: ----------- loading tweeks Modified Paths: -------------- branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js branches/js2-work/phase3/js/mwEmbed/mwEmbed.js Modified: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js =================================================================== --- branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js 2010-01-16 18:00:03 UTC (rev 61139) +++ branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js 2010-01-16 18:02:07 UTC (rev 61140) @@ -465,15 +465,16 @@ } } + // Remove the targetElement + $j( targetElement ).replaceWith( swapPlayerElement ); + // Now Swap out the video element for the embed_video obj: - $j( targetElement ) + //$j( targetElement ) // Put the swapPlayerElement after the targetElement - .after( swapPlayerElement ) - // Remove the targetElement - .remove(); + //.after( swapPlayerElement ); - // Set swapPlayerElement has height / width set: + // Set swapPlayerElement has height / width set and set to loading: $j( swapPlayerElement ).css( { 'width' : playerInterface.width + 'px', 'height' : playerInterface.height + 'px' Modified: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js =================================================================== --- branches/js2-work/phase3/js/mwEmbed/mwEmbed.js 2010-01-16 18:00:03 UTC (rev 61139) +++ branches/js2-work/phase3/js/mwEmbed/mwEmbed.js 2010-01-16 18:02:07 UTC (rev 61140) @@ -942,6 +942,8 @@ loadRequest = loadRequest[0]; } } + //Add a class callback hook ( for script-loader onDone callback ) + mwLoadDoneCB[ loadRequest ] = callback; // Check for the module name loader function if( this.moduleLoaders[ loadRequest ] && @@ -1169,17 +1171,7 @@ } // Include class defined check for older browsers - var classDone = false; - - //Add a class callback hook ( for script-loader onDone callback ) - mwLoadDoneCB[ className ] = function(){ - mw.log('run callback for: ' + className ); - if( callback ){ - callback( className ); - } - callback = null; - mwLoadDoneCB[ className ] = 'done'; - }; + var classDone = false; // Issue the request to load the class (include class name in result callback: mw.getScript( scriptRequest, function( scriptRequest ) { @@ -1762,15 +1754,15 @@ var script = document.createElement("script"); script.setAttribute( 'src', url ); - // Attach handlers ( if not using script loader that issues onDone callback ) - if( !mw.getScriptLoaderPath() ){ - script.onload = script.onreadystatechange = function(){ - if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { - if( callback ) - callback( scriptRequest ); - } - }; - } + // Attach handlers ( if using script loader it issues onDone callback as well ) + script.onload = script.onreadystatechange = function(){ + if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { + if( callback ){ + callback( scriptRequest ); + callback = null; + } + } + }; // Append the script to the DOM: head.appendChild( script ); } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs