summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/notify.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/lib/utils/notify.js.coffee')
-rw-r--r--app/assets/javascripts/lib/utils/notify.js.coffee35
1 files changed, 0 insertions, 35 deletions
diff --git a/app/assets/javascripts/lib/utils/notify.js.coffee b/app/assets/javascripts/lib/utils/notify.js.coffee
deleted file mode 100644
index 9e28353ac34..00000000000
--- a/app/assets/javascripts/lib/utils/notify.js.coffee
+++ /dev/null
@@ -1,35 +0,0 @@
-((w) ->
- notificationGranted = (message, opts, onclick) ->
- notification = new Notification(message, opts)
-
- # Hide the notification after X amount of seconds
- setTimeout ->
- notification.close()
- , 8000
-
- if onclick
- notification.onclick = onclick
-
- notifyPermissions = ->
- if 'Notification' of window
- Notification.requestPermission()
-
- notifyMe = (message, body, icon, onclick) ->
- opts =
- body: body
- icon: icon
- # Let's check if the browser supports notifications
- if !('Notification' of window)
- # do nothing
- else if Notification.permission == 'granted'
- # If it's okay let's create a notification
- notificationGranted message, opts, onclick
- else if Notification.permission != 'denied'
- Notification.requestPermission (permission) ->
- # If the user accepts, let's create a notification
- if permission == 'granted'
- notificationGranted message, opts, onclick
-
- w.notify = notifyMe
- w.notifyPermissions = notifyPermissions
-) window