src/pyams_notify/skin/resources/js/pyams_notify.js
changeset 4 9698e6853781
parent 0 f53281280c23
child 14 1c9f8ee7c072
--- a/src/pyams_notify/skin/resources/js/pyams_notify.js	Fri Jun 24 16:25:25 2016 +0200
+++ b/src/pyams_notify/skin/resources/js/pyams_notify.js	Fri Jul 08 15:37:20 2016 +0200
@@ -29,7 +29,9 @@
 		},
 
 		onSocketOpened: function(event) {
-			console.debug("WS subscription connection opened");
+			if (globals.console) {
+				globals.console.debug("WS notifications connection opened");
+			}
 			MyAMS.ajax.post('get-notifications-context.json', {}, function(result) {
 				if (result.principal.id !== '') {
 					PyAMS_notify.connection.send(JSON.stringify({
@@ -49,12 +51,16 @@
 		},
 
 		onSocketError: function(event) {
-			console.log(event);
+			if (globals.console) {
+				globals.console.log(event);
+			}
 		},
 
 		onSocketClosed: function(event) {
 			PyAMS_notify.connection = null;
-			console.debug("WS connection closed");
+			if (globals.console) {
+				globals.console.debug("WS connection closed");
+			}
 		},
 
 		notifyOnDesktop: function(data) {