fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wielolinijkowy toolbar z dostosowywaniem wysokosci edytora.
[redakcja.git]
/
project
/
static
/
js
/
jquery.logging.js
diff --git
a/project/static/js/jquery.logging.js
b/project/static/js/jquery.logging.js
index
02e10e4
..
315d48f
100644
(file)
--- a/
project/static/js/jquery.logging.js
+++ b/
project/static/js/jquery.logging.js
@@
-1,33
+1,35
@@
(function($) {
(function($) {
-
const
LEVEL_DEBUG = 1;
-
const
LEVEL_INFO = 2;
-
const
LEVEL_WARN = 3;
-
- const LOG_LEVEL = LEVEL_DEBUG;
-
- var mozillaLog = function(msg) {
-
if (console) console.log(msg
);
+
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
);
};
};
- var operaLog = function(msg) {
- opera.postError(msg);
+ var safariLog = function() {
+ if (window.console)
+ console.log.apply(console, arguments);
+ };
+
+ var operaLog = function() {
+ opera.postError(arguments.join(' '));
};
};
- var defaultLog = function(msg) { return false; };
-
- $.log = function(message, level) {
- if (level == null) level = LEVEL_INFO;
- if (message == null) message = 'TRACE';
- if (level < LOG_LEVEL)
- return false;
+ var defaultLog = function() { return false; };
- return $.log.browserLog(message);
+ $.log = function( ) {
+ return $.log.browserLog.apply(this, arguments);
};
};
- if ($.browser.mozilla
|| $.browser.safari
)
+ if ($.browser.mozilla)
$.log.browserLog = mozillaLog;
$.log.browserLog = mozillaLog;
+ else if ($.browser.safari)
+ $.log.browserLog = safariLog;
else if($.browser.opera)
else if($.browser.opera)
- $.log.browserLog = operaLog
+ $.log.browserLog = operaLog
;
else
$.log.browserLog = defaultLog;
else
$.log.browserLog = defaultLog;