diff --git a/web-app/js/custom.js b/web-app/js/custom.js index 1851e88e..cf1928ab 100644 --- a/web-app/js/custom.js +++ b/web-app/js/custom.js @@ -968,6 +968,11 @@ jQuery(document).ready(function() { if (taskData.status !== 'running') { poller.stop = true; jCancellationForm.slideUp(); + if('Notification' in window) { + var notification = new Notification("Job's Done", { + 'body': taskData.status + }); + } } }, contentType: 'application/json' @@ -1721,4 +1726,15 @@ jQuery(document).ready(function() { }; setUpTableSortability(); + var setUpNotifications = function() { + if('Notification' in window && Notification.permission !== 'granted') { + Notification.requestPermission(function(permission) { + if(Notification.permission !== permission) { + Notification.permission = permission; + } + }); + } + }; + setUpNotifications(); + });