
dale at svn
Nov 7, 2009, 7:59 AM
Post #1 of 1
(11 views)
Permalink
|
|
SVN: [58716] trunk/phase3/js2/mwEmbed
|
|
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/58716 Revision: 58716 Author: dale Date: 2009-11-07 15:59:45 +0000 (Sat, 07 Nov 2009) Log Message: ----------- * 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 trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js Modified: trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js =================================================================== --- trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js 2009-11-07 15:56:37 UTC (rev 58715) +++ trunk/phase3/js2/mwEmbed/libAddMedia/searchLibs/archiveOrgSearch.js 2009-11-07 15:59:45 UTC (rev 58716) @@ -87,7 +87,7 @@ do_api_req( { 'data':{'avinfo':1}, 'url':_this.dnUrl + rObj.resourceKey + '/format=Ogg+video' - },function(data){ + },function(data){ if(data['length']) rObj.duration = data['length']; if(data['width']) @@ -103,7 +103,11 @@ if(!options) options ={}; var id_attr = (options['id'])?' id = "' + options['id'] +'" ': ''; - var src = rObj.src + '?t=0:0:0/'+ seconds2npt( rObj.duration ); + if( rObj.duration ){ + var src = rObj.src + '?t=0:0:0/'+ seconds2npt( rObj.duration ); + }else{ + var src = rObj.src; + } if(rObj.mime == 'application/ogg' || rObj.mime == 'audio/ogg' || rObj.mime=='video/ogg'){ return '<video ' + id_attr + ' src="' + src + '" poster="' + rObj.poster + '" type="video/ogg"></video>'; } Modified: trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js =================================================================== --- trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js 2009-11-07 15:56:37 UTC (rev 58715) +++ trunk/phase3/js2/mwEmbed/libClipEdit/mvClipEdit.js 2009-11-07 15:59:45 UTC (rev 58716) @@ -1,7 +1,7 @@ /* - hanndles clip edit controls + handles clip edit controls 'inoutpoints':0, //should let you set the in and out points of clip - 'panzoom':0, //should allow setting keyframes and tweenning modes + 'panzoom':0, //should allow setting keyframes and tweening modes 'overlays':0, //should allow setting "locked to clip" overlay tracks 'audio':0 //should allow controlling the audio volume (with keyframes) */ @@ -135,14 +135,16 @@ var start_ntp = (_this.rObj.embed.start_ntp) ? _this.rObj.embed.start_ntp : seconds2npt( 0 ); if(!start_ntp) seconds2npt( 0 ); - - $j(target).html( - _this.getSetInOutHtml({ - 'start_ntp' : start_ntp, - 'end_ntp' : end_ntp - }) - ); - _this.setInOutBindings(); + //make sure we have an end time + if( end_ntp ){ + $j(target).html( + _this.getSetInOutHtml({ + 'start_ntp' : start_ntp, + 'end_ntp' : end_ntp + }) + ); + _this.setInOutBindings(); + } } }, 'fileopts':{ @@ -378,13 +380,15 @@ eb.preview_mode = true; $j('#'+this.control_ct).html('<h3>' + gM('mwe-edit-video-tools') + '</h3>'); if( eb.supportsURLTimeEncoding() ){ - $j('#'+this.control_ct).append( - _this.getSetInOutHtml({ - 'start_ntp' : eb.start_ntp, - 'end_ntp' : eb.end_ntp - }) - ); - _this.setInOutBindings(); + if(eb.end_ntp){ + $j('#'+this.control_ct).append( + _this.getSetInOutHtml({ + 'start_ntp' : eb.start_ntp, + 'end_ntp' : eb.end_ntp + }) + ); + _this.setInOutBindings(); + } } //if in a sequence we have no need for insertDesc if( !_this.p_seqObj){ Modified: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js =================================================================== --- trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js 2009-11-07 15:56:37 UTC (rev 58715) +++ trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js 2009-11-07 15:59:45 UTC (rev 58716) @@ -1665,17 +1665,19 @@ doLinkBack:function(){ if(this.roe && this.media_element.addedROEData==false){ var _this = this; - this.displayHTML(gM('mwe-loading_txt')); + this.displayHTML( gM('mwe-loading_txt') ); do_request(this.roe, function(data) { _this.media_element.addROE(data); _this.doLinkBack(); }); }else{ - if(this.media_element.linkback){ + if( this.linkback){ + window.location = this.linkback; + }else if(this.media_element.linkback){ window.location = this.media_element.linkback; }else{ - this.displayHTML(gM('mwe-could_not_find_linkback')); + this.displayHTML( gM('mwe-could_not_find_linkback') ); } } }, @@ -1703,6 +1705,7 @@ $cpTxt.click(function(){ $j(this).get(0).select(); }); + //add copy binding: $cpBtn.click(function(){ $cpTxt.focus().get(0).select(); Modified: trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js =================================================================== --- trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js 2009-11-07 15:56:37 UTC (rev 58715) +++ trunk/phase3/js2/mwEmbed/skins/ctrlBuilder.js 2009-11-07 15:59:45 UTC (rev 58716) @@ -364,7 +364,7 @@ '<p class="short_match vo_showcode"><a href="#"><span>'+gM('mwe-share')+'</span></a></p>'; //link to the stream page if we are not already there: - if( ctrlObj.embedObj.roe && typeof mv_stream_interface == 'undefined' ) + if( ( ctrlObj.embedObj.roe || ctrlObj.embedObj.linkback ) && typeof mv_stream_interface == 'undefined' ) o+='<p class="short_match"><a href="javascript:$j(\'#'+ctrlObj.id+'\').get(0).doLinkBack()"><span><strong>Source Page</strong></span></a></p>'; o+='</div>'+ _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS[at]lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
|