mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06: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;
|
data = xhr.responseText;
|
||||||
}
|
}
|
||||||
}else if( responseText.match(/\s*[\{\[].*/) ){
|
}else if( responseText.match(/\s*[\{\[].*/) ){
|
||||||
data = $.parseJSON(responseText);
|
try{
|
||||||
|
data = $.parseJSON(responseText);
|
||||||
|
} catch(e){
|
||||||
|
data = responseText;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
data = responseText;
|
data = responseText;
|
||||||
}
|
}
|
||||||
|
@ -2136,6 +2136,7 @@ function _getSafeElemSize (oElement) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @private
|
* @private
|
||||||
@ -2151,7 +2152,12 @@ function getTileSourceImplementation( viewer, tileSource, imgOptions, successCal
|
|||||||
tileSource = $.parseXml( tileSource );
|
tileSource = $.parseXml( tileSource );
|
||||||
//json should start with "{" or "[" and end with "}" or "]"
|
//json should start with "{" or "[" and end with "}" or "]"
|
||||||
} else if ( tileSource.match(/^\s*[\{\[].*[\}\]]\s*$/ ) ) {
|
} 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