X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/74dca79d402e43baaa69b760698429f223f98e3c..37c9ca34d7edb368cd080149cea73221a8d29f90:/project/static/js/jquery.logging.js?ds=sidebyside

diff --git a/project/static/js/jquery.logging.js b/project/static/js/jquery.logging.js
index 9a7fbe02..d6cee14d 100644
--- a/project/static/js/jquery.logging.js
+++ b/project/static/js/jquery.logging.js
@@ -1,30 +1,41 @@
 (function($) {
-	const LEVEL_DEBUG = 1;
-	const LEVEL_INFO = 2;
-	const LEVEL_WARN = 3;
-
-	const LOG_LEVEL = LEVEL_DEBUG;
-
-	var mozillaLog = function() {
-		if (window.console) console.log.apply(this, arguments);
-	};
-
+	var LEVEL_DEBUG = 1;
+	var LEVEL_INFO = 2;
+	var LEVEL_WARN = 3;
+	var LOG_LEVEL = LEVEL_DEBUG;
+	
+        var standardLog = 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; };
-
-	$.log = function( ) {
+        var msieLog = function() {
+            var args = $.makeArray(arguments);
+            var vals = $.map(args, function(n) {
+                try {
+                    return JSON.stringify(n);
+                } catch(e) {
+                    return ('' + n);
+                }
+            });
+
+            if (window.console)
+                console.log(vals.join(" "));
+        };
+
+	$.log = function() {
 		return $.log.browserLog.apply(this, arguments);
 	};
 
-	if ($.browser.mozilla || $.browser.safari)
-		$.log.browserLog = mozillaLog;
-	else if($.browser.opera)
-		$.log.browserLog = operaLog
-	else 
-		$.log.browserLog = defaultLog;
-
+        if($.browser.opera)
+            $.log.browserLog = operaLog;
+        else if($.browser.msie)
+            $.log.browserLog = msieLog;
+        else
+            $.log.browserLog = standardLog;
 
 })(jQuery);