r96156 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96155‎ | r96156 | r96157 >
Date:22:20, 2 September 2011
Author:dale
Status:deferred
Tags:
Comment:
fixed relative url usage of mw.Uri
Modified paths:
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js (modified) (history)
  • /trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.MediaSource.js (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/EmbedPlayer.loader.js
@@ -102,7 +102,7 @@
103103 mediaWiki.loader.using( dependencySet, function(){
104104 mw.processEmbedPlayers( playerSelect, readyCallback );
105105 }, function( e ){
106 - throw new Error( 'Error loading EmbedPlayer dependency set' );
 106+ throw new Error( 'Error loading EmbedPlayer dependency set: ' + e.message );
107107 });
108108 };
109109
Index: trunk/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/mw.MediaSource.js
@@ -106,7 +106,8 @@
107107 // Set default URLTimeEncoding if we have a time url:
108108 // not ideal way to discover if content is on an oggz_chop server.
109109 // should check some other way.
110 - var pUrl = new mw.Uri ( this.src );
 110+ var pUrl = new mw.Uri ( mw.absoluteUrl( this.src) ); // mw.Uri only handles full urls
 111+
111112 if ( typeof pUrl.query[ 't' ] != 'undefined' ) {
112113 this.URLTimeEncoding = true;
113114 }
@@ -308,7 +309,7 @@
309310
310311 // Return title based on file name:
311312 try{
312 - var fileName = new mw.Uri( this.getSrc() ).path.split('/').pop();
 313+ var fileName = new mw.Uri( mw.absoluteUrl( this.getSrc() ) ).path.split('/').pop();
313314 if( fileName ){
314315 return fileName;
315316 }
@@ -327,7 +328,7 @@
328329 getURLDuration : function() {
329330 // check if we have a URLTimeEncoding:
330331 if ( this.URLTimeEncoding ) {
331 - var annoURL = new mw.Uri( this.src );
 332+ var annoURL = new mw.Uri( mw.absoluteUrl( this.getSrc() ) );
332333 if ( annoURL.query.t ) {
333334 var times = annoURL.query.t.split( '/' );
334335 this.start_npt = times[0];
@@ -350,7 +351,7 @@
351352 * @param String uri
352353 */
353354 getExt : function( uri ){
354 - var urlParts = new mw.Uri( uri );
 355+ var urlParts = new mw.Uri( mw.absoluteUrl( uri ) );
355356 // Get the extension from the url or from the relative name:
356357 var ext = ( urlParts.file )? /[^.]+$/.exec( urlParts.file ) : /[^.]+$/.exec( uri );
357358 return ext.toString().toLowerCase()

Status & tagging log