diff --git a/node/public/img/dickbutt.png b/node/public/img/dickbutt.png deleted file mode 100644 index bdbbda5..0000000 Binary files a/node/public/img/dickbutt.png and /dev/null differ diff --git a/node/public/js/easter.js b/node/public/js/easter.js index f5649eb..d9e0053 100644 --- a/node/public/js/easter.js +++ b/node/public/js/easter.js @@ -5,18 +5,3 @@ cheet('↑ ↑ ↓ ↓ ← → ← → b a enter', function () { cheet('c t d o', function () { showNotification("CTDO - Easteregg", "Was? Nein! Wieso?", "/img/yellow.png", 4); }); - -cheet('d i c k b u t t', function () { - - showDickbutt(); - -}); - -function showDickbutt() { - $("body").css("background-image","url('img/dickbutt.png')"); - window.setTimeout(removeDickbutt,4000); -} - -function removeDickbutt() { - $("body").css("background-image","url('')"); -} diff --git a/node/public/js/state-notify.js b/node/public/js/state-notify.js deleted file mode 100644 index 67223e4..0000000 --- a/node/public/js/state-notify.js +++ /dev/null @@ -1,21 +0,0 @@ -var data; -var laststate; - -window.setInterval(function(){ - $.getJSON("/api/simple/v2", function(data){ - var html = []; - - $.each(data, function(index, value){ - if (index == 'state' && value == false && laststate != false) { - laststate = false; - showNotification("CTDO - Status", "Der Chaostreff Dortmund ist nun geschlossen.", "/img/red.png", 4); - } - else if (index == 'state' && value == true && laststate != true) { - laststate = true; - showNotification("CTDO - Status", "Der Chaostreff Dortmund ist nun offen.", "/img/green.png", 4); - }else { - // Nothing - } - }); - }); -}, 60000); diff --git a/node/public/js/vendor/notification.js b/node/public/js/vendor/notification.js new file mode 100644 index 0000000..df6baf9 --- /dev/null +++ b/node/public/js/vendor/notification.js @@ -0,0 +1,30 @@ +var Notification = window.Notification || window.mozNotification || window.webkitNotification; + +Notification.requestPermission(function (permission) { + // console.log(permission); +}); + + +function showNotification(name, body, icon, timeout) { + var instance = new Notification( + name, { + body: body, + icon: icon + } + ); + + instance.onclick = function () { + // Something to do + }; + instance.onerror = function () { + // Something to do + }; + instance.onshow = function () { + setTimeout(function(){ + instance.close(); + }, timeout * 1000); + }; + instance.onclose = function () { + // Something to do + }; +}