Slight Adjustment to /latest/ view
Added Better Cookies Added the option
This commit is contained in:
parent
c6cffefe80
commit
d2903baefe
1 changed files with 3 additions and 5 deletions
|
@ -15,8 +15,6 @@ window.onload = () => {
|
|||
const notsafe = document.querySelector("#notsafe");
|
||||
if (document.cookie.includes("NSFW=true")) {
|
||||
notsafe.checked = true;
|
||||
document.querySelectorAll(".nsfw").forEach(e => e.classList.add("noff"));
|
||||
addCookie("NSFW", true);
|
||||
isNSFWSHOW = true;
|
||||
}
|
||||
if (document.cookie.includes("always=true")) {
|
||||
|
@ -45,10 +43,10 @@ window.onload = () => {
|
|||
}
|
||||
|
||||
function addCookie(name, state) {
|
||||
if (document.cookie.includes(name))
|
||||
document.cookie = document.cookie.replace(`${name}=${!state}`, `${name}=${state}`);
|
||||
if (state)
|
||||
document.cookie = `${name}=${state}; max-age=15780000; SameSite=None; Secure`;
|
||||
else
|
||||
document.cookie += `${name}=${state}; max-age=15780000; SameSite=None; Secure`;
|
||||
document.cookie = `${name}=`;
|
||||
}
|
||||
|
||||
function cookieTime() {
|
||||
|
|
Loading…
Reference in a new issue