r58707 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58706‎ | r58707 | r58708 >
Date:13:56, 7 November 2009
Author:dale
Status:deferred
Tags:
Comment:
* uses url for title key
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/remoteMwEmbed.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -335,7 +335,7 @@
336336 }
337337 }
338338 //update duration from hit if present:
339 - if(this.durationHint)
 339+ if( this.durationHint )
340340 this.duration = this.durationHint;
341341
342342
Index: trunk/phase3/js2/remoteMwEmbed.js
@@ -63,7 +63,10 @@
6464 // will be depreciated in favor of updates to OggHandler
6565 function rewrite_for_OggHandler( vidIdList ){
6666 function procVidId( vidId ){
67 - js_log('vidIdList length: ' + vidIdList.length + ' left in the set: ' + vidIdList );
 67+ //don't proccess empty vids
 68+ if(!vidId)
 69+ return ;
 70+ js_log('vidIdList on: ' + vidId +' length: ' + vidIdList.length + ' left in the set: ' + vidIdList );
6871
6972 // Grab the thumbnail and src of the video
7073 var pimg = $j( '#' + vidId + ' img' );
@@ -85,7 +88,8 @@
8689 // Parsed values:
8790 var src = '';
8891 var duration_attr = '';
89 - var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('alt').replace(/ /g, '_');
 92+ var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('src').split('/');
 93+ wikiTitleKey = unescape( wikiTitleKey[ wikiTitleKey.length - 2 ] );
9094 var re = new RegExp( /videoUrl(":?\s*)*([^&]*)/ );
9195 src = re.exec( $j( '#'+vidId ).html() )[2];
9296
@@ -122,8 +126,7 @@
123127
124128 }
125129 rewrite_by_id( 'mwe_' + vidId, function(){
126 - if(vidIdList.length != 0){
127 - alert('did first rewite now doing another');
 130+ if( vidIdList.length != 0 ){
128131 setTimeout( function(){
129132 procVidId( vidIdList.pop() )
130133 }, 1);
@@ -131,9 +134,7 @@
132135 });
133136 };
134137 //process each item in the vidIdList (with setTimeout to avoid locking)
135 - setTimeout( function(){
136 - procVidId( vidIdList.pop() )
137 - }, 1);
 138+ procVidId( vidIdList.pop() );
138139 }
139140 function getRemoteEmbedPath() {
140141 for( var i = 0; i < document.getElementsByTagName( 'script' ).length; i++ ) {

Status & tagging log