From d82a894b7bae5ebbe0e15f84c9e13e699429f5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Thu, 20 Oct 2016 00:41:30 -0400 Subject: [PATCH] Remove browser notification polyfill and inform user when unsupported --- client/index.html | 9 +- client/js/libs/notification.js | 218 --------------------------------- client/js/lounge.js | 61 +++++---- 3 files changed, 45 insertions(+), 243 deletions(-) delete mode 100644 client/js/libs/notification.js diff --git a/client/index.html b/client/index.html index 25be00ab..2a3c94e5 100644 --- a/client/index.html +++ b/client/index.html @@ -283,7 +283,14 @@
diff --git a/client/js/libs/notification.js b/client/js/libs/notification.js deleted file mode 100644 index 4d84b16a..00000000 --- a/client/js/libs/notification.js +++ /dev/null @@ -1,218 +0,0 @@ -/** - * Notification JS - * Shims up the Notification API - * - * @author Andrew Dodson - * @website http://adodson.com/notification.js/ - */ - -// -// Does the browser support the the Notification API? -// .. and does it have a permission property? -// - -(function(window, document){ - - var PERMISSION_GRANTED = 'granted', - PERMISSION_DENIED = 'denied', - PERMISSION_UNKNOWN = 'unknown'; - - var a = [], iv, i=0; - - // - // Swap the document.title with the notification - // - function swaptitle(title){ - - if(a.length===0){ - a = [document.title]; - } - - a.push(title); - - if(!iv){ - iv = setInterval(function(){ - - // has document.title changed externally? - if(a.indexOf(document.title) === -1 ){ - // update the default title - a[0] = document.title; - } - - document.title = a[++i%a.length]; - }, 1000); - } - } - - function swapTitleCancel(){ - - // dont do any more if we haven't got anything open - if(a.length===0){ - return; - } - - // if an IE overlay is present, kill it - if("external" in window && "msSiteModeClearIconOverlay" in window.external ){ - window.external.msSiteModeClearIconOverlay(); - } - - clearInterval(iv); - - iv = false; - document.title = a[0]; - a = []; - } - - // - // Add aevent handlers - function addEvent(el,name,func){ - if(name.match(" ")){ - var a = name.split(' '); - for(var i=0;i