Merge pull request #56 from acdha/dzitilesource-relative-paths

DziTileSource: avoid changing relative paths
This commit is contained in:
Chris Thatcher 2013-03-26 17:47:31 -07:00
commit da35f3b39f

View File

@ -108,19 +108,8 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
options = configureFromObject( this, data );
}
if( url && !options.tilesUrl ){
if( 'http' !== url.substring( 0, 4 ) ){
host = location.protocol + '//' + location.host;
}
dziPath = url.split('/');
dziName = dziPath.pop();
dziName = dziName.substring(0, dziName.lastIndexOf('.'));
dziPath = '/' + dziPath.join('/') + '/' + dziName + '_files/';
tilesUrl = dziPath;
if( host ){
tilesUrl = host + tilesUrl;
}
options.tilesUrl = tilesUrl;
if (url && !options.tilesUrl) {
options.tilesUrl = url.replace(/([^\/]+)\.dzi$/, '$1_files/');
}
return options;