Merge pull request #1074 from altert/smallfix

See #832, further fix for dzitilesource guessing of tilesUrl, for iii…
This commit is contained in:
Ian Gilman 2016-12-22 09:59:09 -08:00 committed by GitHub
commit 6a3b2d52c5
2 changed files with 5 additions and 2 deletions

View File

@ -140,7 +140,7 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
if (url && !options.tilesUrl) { if (url && !options.tilesUrl) {
options.tilesUrl = url.replace( options.tilesUrl = url.replace(
/([^\/]+?)(\.(dzi|xml|js))?\/?(\?.*)?$/, '$1_files/'); /([^\/]+?)(\.(dzi|xml|js))?(\?[^\/]*)?\/?$/, '$1_files/');
if (url.search(/\.(dzi|xml|js)\?/) != -1) { if (url.search(/\.(dzi|xml|js)\?/) != -1) {
options.queryParams = url.match(/\?.*/); options.queryParams = url.match(/\?.*/);

View File

@ -32,7 +32,10 @@
'relative link should stay the same'); 'relative link should stay the same');
testImplicitTilesUrl( testImplicitTilesUrl(
'/p/foo.dzi?a=1&b=2', '/p/foo_files/', '/p/foo.dzi?a=1&b=2', '/p/foo_files/',
'querystring in dzi url should be ignored'); 'querystring in dzi url should be ignored after slashes');
testImplicitTilesUrl(
'/iiipsrv?DeepZoom=/path/my.dzi', '/iiipsrv?DeepZoom=/path/my_files/',
'querystring in dzi url should not be ignored before slashes');
}); });
}()); }());