X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/74dca79d402e43baaa69b760698429f223f98e3c..37e03d34aec3af64d322f0c76d49dba46ee29f92:/project/static/js/jquery.logging.js diff --git a/project/static/js/jquery.logging.js b/project/static/js/jquery.logging.js index 9a7fbe02..315d48f5 100644 --- a/project/static/js/jquery.logging.js +++ b/project/static/js/jquery.logging.js @@ -1,16 +1,21 @@ (function($) { - const LEVEL_DEBUG = 1; - const LEVEL_INFO = 2; - const LEVEL_WARN = 3; - - const LOG_LEVEL = LEVEL_DEBUG; + var LEVEL_DEBUG = 1; + var LEVEL_INFO = 2; + var LEVEL_WARN = 3; + var LOG_LEVEL = LEVEL_DEBUG; var mozillaLog = function() { - if (window.console) console.log.apply(this, arguments); + if (window.console) + console.log.apply(this, arguments); }; + var safariLog = function() { + if (window.console) + console.log.apply(console, arguments); + }; + var operaLog = function() { - opera.postError.(arguments.join(' ')); + opera.postError(arguments.join(' ')); }; var defaultLog = function() { return false; }; @@ -19,10 +24,12 @@ return $.log.browserLog.apply(this, arguments); }; - if ($.browser.mozilla || $.browser.safari) + if ($.browser.mozilla) $.log.browserLog = mozillaLog; + else if ($.browser.safari) + $.log.browserLog = safariLog; else if($.browser.opera) - $.log.browserLog = operaLog + $.log.browserLog = operaLog; else $.log.browserLog = defaultLog;