// fuenfknoepfe.js - teh ultimate fife buttons website function click_handler(ziel) { var chkBox = document.getElementById('rememberBox'); if (chkBox.checked == true) { setzeKeks(ziel); } else { entferneKeks(); } geheNachKeks(ziel); return false; } function geheNachKeks(ziel) { var echtesZiel = "https://im.c-base.org" + keks; console.log("gegeNach: " + echtesZiel) window.location.replace(echtesZiel); } function setzeKeks(ziel) { console.log("setzen"); wirklichsetzeKeks(ziel, 30); } function entferneKeks() { console.log("entfernen"); wirklichsetzeKeks("", -1); } function wirklichsetzeKeks(ziel, dauer) { var d = new Date(); d.setTime(d.getTime() + (dauer * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = "ziel=" + ziel + ";" + expires + ";path=/"; } function allewegefuehrennachKeks() { var keks = getCookie("ziel"); if (keks != "") { setzeKeks(keks); geheNachKeks(keks) // console.log("Do redirect here: " + keks); // Simulate an HTTP redirect: //window.location.replace("https://im.c-base.org" + keks); } else { console.log("Ohne Keks keine Äktschn."); } } function getCookie(keksname) { var name = keksname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function machkeksweg() { entferneKeks(); window.location.replace("index.html"); }