src/pyams_notify/skin/resources/js/pyams_notify.js
changeset 55 15d11232b0dc
parent 52 6d8e4d38f94d
equal deleted inserted replaced
54:7c4fff8524d9 55:15d11232b0dc
    38 			}
    38 			}
    39 			MyAMS.ajax && MyAMS.ajax.post('get-notifications-context.json', {}, function(result) {
    39 			MyAMS.ajax && MyAMS.ajax.post('get-notifications-context.json', {}, function(result) {
    40 				if (result.principal.id !== '') {
    40 				if (result.principal.id !== '') {
    41 					PyAMS_notify.connection.send(JSON.stringify({
    41 					PyAMS_notify.connection.send(JSON.stringify({
    42 						action: 'subscribe',
    42 						action: 'subscribe',
       
    43 						host: window.location.host,
    43 						principal: result.principal,
    44 						principal: result.principal,
    44 						context: result.context
    45 						context: result.context
    45 					}));
    46 					}));
    46 					MyAMS.ajax.post('get-user-notifications.json', {}, PyAMS_notify.showNotifications);
    47 					MyAMS.ajax.post('get-user-notifications.json', {}, PyAMS_notify.showNotifications);
    47 				}
    48 				}