r58716 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58715‎ | r58716 | r58717 >
Date:15:59, 7 November 2009
Author:dale
Status:deferred
Tags:
Comment:
* archive.org duration query is currently broken (added checks and fallbacks)
* added source page linkback
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js
@@ -87,7 +87,7 @@
8888 do_api_req( {
8989 'data':{'avinfo':1},
9090 'url':_this.dnUrl + rObj.resourceKey + '/format=Ogg+video'
91 - },function(data){
 91+ },function(data){
9292 if(data['length'])
9393 rObj.duration = data['length'];
9494 if(data['width'])
@@ -103,7 +103,11 @@
104104 if(!options)
105105 options ={};
106106 var id_attr = (options['id'])?' id = "' + options['id'] +'" ': '';
107 - var src = rObj.src + '?t=0:0:0/'+ seconds2npt( rObj.duration );
 107+ if( rObj.duration ){
 108+ var src = rObj.src + '?t=0:0:0/'+ seconds2npt( rObj.duration );
 109+ }else{
 110+ var src = rObj.src;
 111+ }
108112 if(rObj.mime == 'application/ogg' || rObj.mime == 'audio/ogg' || rObj.mime=='video/ogg'){
109113 return '<video ' + id_attr + ' src="' + src + '" poster="' + rObj.poster + '" type="video/ogg"></video>';
110114 }
Index: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js
@@ -1,7 +1,7 @@
22 /*
3 - hanndles clip edit controls
 3+ handles clip edit controls
44 'inoutpoints':0, //should let you set the in and out points of clip
5 - 'panzoom':0, //should allow setting keyframes and tweenning modes
 5+ 'panzoom':0, //should allow setting keyframes and tweening modes
66 'overlays':0, //should allow setting "locked to clip" overlay tracks
77 'audio':0 //should allow controlling the audio volume (with keyframes)
88 */
@@ -135,14 +135,16 @@
136136 var start_ntp = (_this.rObj.embed.start_ntp) ? _this.rObj.embed.start_ntp : seconds2npt( 0 );
137137 if(!start_ntp)
138138 seconds2npt( 0 );
139 -
140 - $j(target).html(
141 - _this.getSetInOutHtml({
142 - 'start_ntp' : start_ntp,
143 - 'end_ntp' : end_ntp
144 - })
145 - );
146 - _this.setInOutBindings();
 139+ //make sure we have an end time
 140+ if( end_ntp ){
 141+ $j(target).html(
 142+ _this.getSetInOutHtml({
 143+ 'start_ntp' : start_ntp,
 144+ 'end_ntp' : end_ntp
 145+ })
 146+ );
 147+ _this.setInOutBindings();
 148+ }
147149 }
148150 },
149151 'fileopts':{
@@ -378,13 +380,15 @@
379381 eb.preview_mode = true;
380382 $j('#'+this.control_ct).html('<h3>' + gM('mwe-edit-video-tools') + '</h3>');
381383 if( eb.supportsURLTimeEncoding() ){
382 - $j('#'+this.control_ct).append(
383 - _this.getSetInOutHtml({
384 - 'start_ntp' : eb.start_ntp,
385 - 'end_ntp' : eb.end_ntp
386 - })
387 - );
388 - _this.setInOutBindings();
 384+ if(eb.end_ntp){
 385+ $j('#'+this.control_ct).append(
 386+ _this.getSetInOutHtml({
 387+ 'start_ntp' : eb.start_ntp,
 388+ 'end_ntp' : eb.end_ntp
 389+ })
 390+ );
 391+ _this.setInOutBindings();
 392+ }
389393 }
390394 //if in a sequence we have no need for insertDesc
391395 if( !_this.p_seqObj){
Index: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js
@@ -364,7 +364,7 @@
365365 '<p class="short_match vo_showcode"><a href="#"><span>'+gM('mwe-share')+'</span></a></p>';
366366
367367 //link to the stream page if we are not already there:
368 - if( ctrlObj.embedObj.roe && typeof mv_stream_interface == 'undefined' )
 368+ if( ( ctrlObj.embedObj.roe || ctrlObj.embedObj.linkback ) && typeof mv_stream_interface == 'undefined' )
369369 o+='<p class="short_match"><a href="javascript:$j(\'#'+ctrlObj.id+'\').get(0).doLinkBack()"><span><strong>Source Page</strong></span></a></p>';
370370
371371 o+='</div>'+
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -1665,17 +1665,19 @@
16661666 doLinkBack:function(){
16671667 if(this.roe && this.media_element.addedROEData==false){
16681668 var _this = this;
1669 - this.displayHTML(gM('mwe-loading_txt'));
 1669+ this.displayHTML( gM('mwe-loading_txt') );
16701670 do_request(this.roe, function(data)
16711671 {
16721672 _this.media_element.addROE(data);
16731673 _this.doLinkBack();
16741674 });
16751675 }else{
1676 - if(this.media_element.linkback){
 1676+ if( this.linkback){
 1677+ window.location = this.linkback;
 1678+ }else if(this.media_element.linkback){
16771679 window.location = this.media_element.linkback;
16781680 }else{
1679 - this.displayHTML(gM('mwe-could_not_find_linkback'));
 1681+ this.displayHTML( gM('mwe-could_not_find_linkback') );
16801682 }
16811683 }
16821684 },
@@ -1703,6 +1705,7 @@
17041706 $cpTxt.click(function(){
17051707 $j(this).get(0).select();
17061708 });
 1709+
17071710 //add copy binding:
17081711 $cpBtn.click(function(){
17091712 $cpTxt.focus().get(0).select();

Status & tagging log