mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-03-28 11:03:53 +03:00
Move $.console declaration up so $.Browser can make use of it
This commit is contained in:
parent
f7f2f501f5
commit
0953bb4be8
@ -2491,6 +2491,31 @@ function OpenSeadragon( options ){
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//TODO: $.console is often used inside a try/catch block which generally
|
||||||
|
// prevents allowings errors to occur with detection until a debugger
|
||||||
|
// is attached. Although I've been guilty of the same anti-pattern
|
||||||
|
// I eventually was convinced that errors should naturally propagate in
|
||||||
|
// all but the most special cases.
|
||||||
|
/**
|
||||||
|
* A convenient alias for console when available, and a simple null
|
||||||
|
* function when console is unavailable.
|
||||||
|
* @static
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
var nullfunction = function( msg ){
|
||||||
|
//document.location.hash = msg;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.console = window.console || {
|
||||||
|
log: nullfunction,
|
||||||
|
debug: nullfunction,
|
||||||
|
info: nullfunction,
|
||||||
|
warn: nullfunction,
|
||||||
|
error: nullfunction,
|
||||||
|
assert: nullfunction
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current browser vendor, version, and related information regarding detected features.
|
* The current browser vendor, version, and related information regarding detected features.
|
||||||
* @member {Object} Browser
|
* @member {Object} Browser
|
||||||
@ -2616,31 +2641,6 @@ function OpenSeadragon( options ){
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
//TODO: $.console is often used inside a try/catch block which generally
|
|
||||||
// prevents allowings errors to occur with detection until a debugger
|
|
||||||
// is attached. Although I've been guilty of the same anti-pattern
|
|
||||||
// I eventually was convinced that errors should naturally propagate in
|
|
||||||
// all but the most special cases.
|
|
||||||
/**
|
|
||||||
* A convenient alias for console when available, and a simple null
|
|
||||||
* function when console is unavailable.
|
|
||||||
* @static
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
var nullfunction = function( msg ){
|
|
||||||
//document.location.hash = msg;
|
|
||||||
};
|
|
||||||
|
|
||||||
$.console = window.console || {
|
|
||||||
log: nullfunction,
|
|
||||||
debug: nullfunction,
|
|
||||||
info: nullfunction,
|
|
||||||
warn: nullfunction,
|
|
||||||
error: nullfunction,
|
|
||||||
assert: nullfunction
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Adding support for HTML5's requestAnimationFrame as suggested by acdha.
|
// Adding support for HTML5's requestAnimationFrame as suggested by acdha.
|
||||||
// Implementation taken from matt synder's post here:
|
// Implementation taken from matt synder's post here:
|
||||||
// http://mattsnider.com/cross-browser-and-legacy-supported-requestframeanimation/
|
// http://mattsnider.com/cross-browser-and-legacy-supported-requestframeanimation/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user