mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Merge pull request #1189 from lastlegion/master
[FIX #1188] added fix for supporting weird filenames that look like JSONs
This commit is contained in:
commit
e55c5beb1c
@ -649,7 +649,11 @@ function processResponse( xhr ){
|
||||
data = xhr.responseText;
|
||||
}
|
||||
}else if( responseText.match(/\s*[\{\[].*/) ){
|
||||
data = $.parseJSON(responseText);
|
||||
try{
|
||||
data = $.parseJSON(responseText);
|
||||
} catch(e){
|
||||
data = responseText;
|
||||
}
|
||||
}else{
|
||||
data = responseText;
|
||||
}
|
||||
|
@ -2136,6 +2136,7 @@ function _getSafeElemSize (oElement) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @private
|
||||
@ -2151,7 +2152,12 @@ function getTileSourceImplementation( viewer, tileSource, imgOptions, successCal
|
||||
tileSource = $.parseXml( tileSource );
|
||||
//json should start with "{" or "[" and end with "}" or "]"
|
||||
} else if ( tileSource.match(/^\s*[\{\[].*[\}\]]\s*$/ ) ) {
|
||||
tileSource = $.parseJSON(tileSource);
|
||||
try {
|
||||
var tileSourceJ = $.parseJSON(tileSource);
|
||||
tileSource = tileSourceJ;
|
||||
} catch (e) {
|
||||
//tileSource = tileSource;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user