mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-04-18 08:31:00 +00:00
Update openseadragon.js
modified console to make it easy to break into the debugger when errors happen.
This commit is contained in:
parent
c1f0b384c8
commit
1e5b9b98e0
1 changed files with 13 additions and 16 deletions
|
@ -1341,11 +1341,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||
request.open( "GET", options.url, options.async );
|
||||
request.send( null );
|
||||
} catch (e) {
|
||||
$.console.log(
|
||||
"%s while making AJAX request: %s",
|
||||
e.name,
|
||||
e.message
|
||||
);
|
||||
$.console.log(e.name + " while making AJAX request: " + e.message);
|
||||
|
||||
request.onreadystatechange = null;
|
||||
request = null;
|
||||
|
@ -1637,18 +1633,19 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||
* @static
|
||||
* @private
|
||||
*/
|
||||
var nullfunction = function( msg ){
|
||||
//document.location.hash = msg;
|
||||
};
|
||||
|
||||
$.console = window.console || {
|
||||
log: nullfunction,
|
||||
debug: nullfunction,
|
||||
info: nullfunction,
|
||||
warn: nullfunction,
|
||||
error: nullfunction
|
||||
// modified to make it easy to break into the debugger when errors happen.
|
||||
var logfunction = function (msg) {
|
||||
if (window.console) return window.console.log(msg);
|
||||
window.alert(msg);
|
||||
};
|
||||
|
||||
$.console = {
|
||||
log: function (msg) { logfunction(msg); },
|
||||
debug: function (msg) { logfunction(msg); },
|
||||
info: function (msg) { logfunction(msg); },
|
||||
warn: function (msg) { logfunction(msg); },
|
||||
error: function (msg) { logfunction(msg); }
|
||||
};
|
||||
|
||||
|
||||
// Adding support for HTML5's requestAnimationFrame as suggested by acdha.
|
||||
// Implementation taken from matt synder's post here:
|
||||
|
|
Loading…
Add table
Reference in a new issue