r67556 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67555‎ | r67556 | r67557 >
Date:19:16, 7 June 2010
Author:dale
Status:deferred
Tags:
Comment:
fix for empty trigger events and less debug info in swarm transport
Modified paths:
  • /branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbed.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SwarmTransport/mw.SwarmTransport.js
@@ -23,7 +23,7 @@
2424 if( typeof window['swarmTransport'] != 'undefined' ){
2525
2626 // Add the swarm source
27 - mw.log(" SwarmTransport :: checkPlayerSourcesEvent ");
 27+ mw.log(" SwarmTransport :: checkPlayerSourcesEvent " + swapedPlayerId);
2828 _this.addSwarmSource( embedPlayer, callback );
2929
3030 } else {
@@ -79,7 +79,7 @@
8080 var absoluteSource = mw.absoluteUrl( source.getSrc() );
8181 var swarmSrc = httpseed2tstream( absoluteSource );
8282
83 - mw.log('addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + swarmSrc );
 83+ //mw.log('addSwarmSource for: ' + source.getSrc() + "\n\nGot:" + swarmSrc );
8484
8585 embedPlayer.mediaElement.tryAddSource(
8686 $j('<source />')
Index: branches/MwEmbedStandAlone/mwEmbed.js
@@ -2283,8 +2283,13 @@
22842284 if( ! $j( targetObject ).data( 'events' )[ triggerName ] ) {
22852285 callback();
22862286 }
 2287+
22872288 var callbackCount = $j( targetObject ).data( 'events' )[ triggerName ].length;
2288 -
 2289+ if( !callbackCount ){
 2290+ // No events run the callback directly
 2291+ callback();
 2292+ return ;
 2293+ }
22892294 mw.log(" runTriggersCallback:: " + callbackCount );
22902295 var callInx = 0;
22912296 $j( targetObject ).trigger( 'checkPlayerSourcesEvent', function() {

Status & tagging log