2014-09-15 14:03:52 +04:00
|
|
|
var notificationWS = new WebSocket(config.channel.shell + '/notification/ws');
|
|
|
|
notificationWS.onopen = function() {
|
|
|
|
console.log('[notification onopen] connected');
|
|
|
|
};
|
|
|
|
notificationWS.onmessage = function(e) {
|
|
|
|
console.log('[notification onmessage]' + e.data);
|
|
|
|
var data = JSON.parse(e.data);
|
|
|
|
if ('init-notification' !== data.cmd) {
|
2014-09-17 06:10:26 +04:00
|
|
|
$('.bottom-window-group .notification').val(data.output);
|
2014-09-15 14:03:52 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
notificationWS.onclose = function(e) {
|
|
|
|
console.log('[notification onclose] disconnected (' + e.code + ')');
|
|
|
|
delete notificationWS;
|
|
|
|
};
|
|
|
|
notificationWS.onerror = function(e) {
|
|
|
|
console.log('[notification onerror] ' + e);
|
|
|
|
};
|
|
|
|
|
|
|
|
var notification = {
|
|
|
|
init: function() {
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
notification.init();
|
|
|
|
});
|