r58703 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58702‎ | r58703 | r58704 >
Date:13:27, 7 November 2009
Author:dale
Status:deferred
Tags:
Comment:
* more rewrite fixes
Modified paths:
  • /trunk/phase3/js2/remoteMwEmbed.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/remoteMwEmbed.js
@@ -84,13 +84,16 @@
8585
8686 // Parsed values:
8787 var src = '';
88 - var duration = '';
 88+ var duration_attr = '';
8989 var wikiTitleKey = $j( '#'+vidId + ' img').filter(':first').attr('alt').replace(/ /g, '_');
9090 var re = new RegExp( /videoUrl(":?\s*)*([^&]*)/ );
9191 src = re.exec( $j( '#'+vidId ).html() )[2];
9292
93 - var re = new RegExp( /length(":?\s*)*([^&]*)/ );
94 - duration = re.exec( $j( '#'+vidId ).html() )[2];
 93+ var re = new RegExp( /length(":?\s*)*([^,]*)/ );
 94+ var dv = re.exec( $j( '#'+vidId ).html() )[2];
 95+ if( dv ){
 96+ duration_attr = 'durationHint="'+ dv +'" ';
 97+ }
9598
9699 var re = new RegExp( /offset(":?\s*)*([^&]*)/ );
97100 offset = re.exec( $j( '#'+vidId ).html() )[2];
@@ -99,10 +102,10 @@
100103 if( src ) {
101104 var html_out = '';
102105
103 - var common_attr = ' id="vid_' + i +'" '+
 106+ var common_attr = ' id="mwe_' + vidId +'" '+
104107 'wikiTitleKey="' + wikiTitleKey + '" ' +
105108 'src="' + src + '" ' +
106 - 'durationHint="' + duration + '" ' +
 109+ duration_attr +
107110 offset_attr + ' ';
108111
109112 if( tag_type == 'audio' ){
@@ -118,7 +121,7 @@
119122 .css('height', pheight + 30);
120123
121124 }
122 - rewrite_by_id( vidId, function(){
 125+ rewrite_by_id( 'mwe_' + vidId, function(){
123126 if(vidIdList.length != 0){
124127 alert('did first rewite now doing another');
125128 setTimeout( function(){

Status & tagging log