Removed Dickbutt Easteregg

This commit is contained in:
Tim Windelschmidt 2015-09-16 15:45:01 +02:00
parent d300e734b3
commit f598a2b20e
4 changed files with 30 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@ -5,18 +5,3 @@ cheet('↑ ↑ ↓ ↓ ← → ← → b a enter', function () {
cheet('c t d o', function () { cheet('c t d o', function () {
showNotification("CTDO - Easteregg", "Was? Nein! Wieso?", "/img/yellow.png", 4); 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('')");
}

View File

@ -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);

30
node/public/js/vendor/notification.js vendored Normal file
View File

@ -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
};
}