From: Michael Dale Date: Sat, 7 Nov 2009 13:56:20 +0000 (+0000) Subject: * uses url for title key X-Git-Tag: 1.31.0-rc.0~38918 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=24a79eea9a28ce0822b4a85ca7b865759324fdca;p=lhc%2Fweb%2Fwiklou.git * uses url for title key --- diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 74ae795686..d7aeb7562c 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -335,7 +335,7 @@ mediaSource.prototype = } } //update duration from hit if present: - if(this.durationHint) + if( this.durationHint ) this.duration = this.durationHint; diff --git a/js2/remoteMwEmbed.js b/js2/remoteMwEmbed.js index 3037a7c8f6..50d5b301cf 100644 --- a/js2/remoteMwEmbed.js +++ b/js2/remoteMwEmbed.js @@ -63,7 +63,10 @@ function doPageSpecificRewrite() { // will be depreciated in favor of updates to OggHandler function rewrite_for_OggHandler( vidIdList ){ function procVidId( vidId ){ - js_log('vidIdList length: ' + vidIdList.length + ' left in the set: ' + vidIdList ); + //don't proccess empty vids + if(!vidId) + return ; + js_log('vidIdList on: ' + vidId +' length: ' + vidIdList.length + ' left in the set: ' + vidIdList ); // Grab the thumbnail and src of the video var pimg = $j( '#' + vidId + ' img' ); @@ -85,7 +88,8 @@ function rewrite_for_OggHandler( vidIdList ){ // Parsed values: var src = ''; var duration_attr = ''; - var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('alt').replace(/ /g, '_'); + var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('src').split('/'); + wikiTitleKey = unescape( wikiTitleKey[ wikiTitleKey.length - 2 ] ); var re = new RegExp( /videoUrl(":?\s*)*([^&]*)/ ); src = re.exec( $j( '#'+vidId ).html() )[2]; @@ -122,8 +126,7 @@ function rewrite_for_OggHandler( vidIdList ){ } rewrite_by_id( 'mwe_' + vidId, function(){ - if(vidIdList.length != 0){ - alert('did first rewite now doing another'); + if( vidIdList.length != 0 ){ setTimeout( function(){ procVidId( vidIdList.pop() ) }, 1); @@ -131,9 +134,7 @@ function rewrite_for_OggHandler( vidIdList ){ }); }; //process each item in the vidIdList (with setTimeout to avoid locking) - setTimeout( function(){ - procVidId( vidIdList.pop() ) - }, 1); + procVidId( vidIdList.pop() ); } function getRemoteEmbedPath() { for( var i = 0; i < document.getElementsByTagName( 'script' ).length; i++ ) {