From dc580fe00f1415ed910d6c603e00c1154f95a6dd Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Sat, 7 Nov 2009 13:13:48 +0000 Subject: [PATCH] * fixed rewrite ogg handler --- js2/mwEmbed/skins/mvpcf/playerSkin.css | 2 +- js2/remoteMwEmbed.js | 27 ++++++++++---------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/js2/mwEmbed/skins/mvpcf/playerSkin.css b/js2/mwEmbed/skins/mvpcf/playerSkin.css index 64289a7118..0583fd3338 100644 --- a/js2/mwEmbed/skins/mvpcf/playerSkin.css +++ b/js2/mwEmbed/skins/mvpcf/playerSkin.css @@ -140,7 +140,7 @@ float: left; display: inline; height: 10px; - margin-left:10px; + margin-left:8px; margin-top:10px; position:relative; } diff --git a/js2/remoteMwEmbed.js b/js2/remoteMwEmbed.js index 25e055bee4..e88af4dee3 100644 --- a/js2/remoteMwEmbed.js +++ b/js2/remoteMwEmbed.js @@ -62,15 +62,9 @@ function doPageSpecificRewrite() { } // will be depreciated in favor of updates to OggHandler function rewrite_for_OggHandler( vidIdList ){ - function procVidId(vidId){ - if( $j( '#'+vidId).length == 0){ - if(vidIdList.length != 0){ - setTimeout( function(){ - procVidId( vidIdList.pop() ) - }, 1); - } - return ; - } + function procVidId( vidId ){ + js_log('vidIdList length: ' + vidIdList.length + ' left in the set: ' + vidIdList ); + // Grab the thumbnail and src of the video var pimg = $j( '#' + vidId + ' img' ); var poster_attr = 'poster = "' + pimg.attr( 'src' ) + '" '; @@ -90,9 +84,8 @@ function rewrite_for_OggHandler( vidIdList ){ // Parsed values: var src = ''; - var duration = ''; - var wikiTitleKey = $j( '#'+vidId + ' img').attr('alt').replace(' ', '_'); - + var duration = ''; + var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('alt').replace(/ /g, '_'); var re = new RegExp( /videoUrl(":?\s*)*([^&]*)/ ); src = re.exec( $j( '#'+vidId ).html() )[2]; @@ -117,24 +110,24 @@ function rewrite_for_OggHandler( vidIdList ){ }else{ html_out='' + 'style="width:' + pwidth + 'px;height:' + pheight + 'px;">' + ''; } //set the video tag inner html and update the height $j( '#' + vidId ).html( html_out ) .css('height', pheight + 30); - } - rewrite_by_id( 'vid_' + i, function(){ + } + rewrite_by_id( vidId, function(){ if(vidIdList.length != 0){ + alert('did first rewite now doing another'); setTimeout( function(){ procVidId( vidIdList.pop() ) }, 1); } }); }; - //proccess each item in the vidIdList (with setTimeout to avoid locking) + //process each item in the vidIdList (with setTimeout to avoid locking) setTimeout( function(){ procVidId( vidIdList.pop() ) }, 1); -- 2.20.1