mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
footer.js: remove duplicate function.
There's already a function checking for cookies in the previous document.ready function. Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -110,6 +110,21 @@ function checkMessages() {
|
||||
});
|
||||
}
|
||||
|
||||
function testCookies() {
|
||||
if (navigator.cookieEnabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// set and read cookie
|
||||
document.cookie = "cookietest=1";
|
||||
var ret = document.cookie.indexOf("cookietest=") !== -1;
|
||||
|
||||
// delete cookie
|
||||
document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
var enaT = $("#enableTimer");
|
||||
var target = new Date(parseInt(enaT.html()));
|
||||
@@ -207,24 +222,3 @@ $(document).keypress(function (e) {
|
||||
$("#loginform").submit();
|
||||
}
|
||||
});
|
||||
|
||||
function testCookies() {
|
||||
if (navigator.cookieEnabled) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// set and read cookie
|
||||
document.cookie = "cookietest=1";
|
||||
var ret = document.cookie.indexOf("cookietest=") !== -1;
|
||||
|
||||
// delete cookie
|
||||
document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
$(function () {
|
||||
if (!testCookies() && $("#cookieInfo").length > 0) {
|
||||
$("#cookieInfo").show();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user