remove cookie notice
This commit is contained in:
parent
9679ed1221
commit
1f2745bd45
2 changed files with 1 additions and 46 deletions
|
@ -1,44 +0,0 @@
|
|||
|
||||
class cookieNotice extends HTMLElement{
|
||||
constructor() {
|
||||
super();
|
||||
this.innerHTML = `
|
||||
<div class="cookieinfo">
|
||||
<div class="cookieinfo-close"> ✖
|
||||
</div>
|
||||
<span class="cookieinfo-text">
|
||||
We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies. <a class="cookieinfo-link" href="http://wikipedia.org/wiki/HTTP_cookie">More info</a>
|
||||
</span>
|
||||
</div>`;
|
||||
|
||||
let cookieInfo = document.querySelector(".cookieinfo");
|
||||
if(cookieInfo != null) {
|
||||
if (this.getCookie("cookieMessageHide") === "1") {
|
||||
cookieInfo.style.display = "none";
|
||||
} else {
|
||||
cookieInfo.style.display = "block";
|
||||
}
|
||||
|
||||
document.querySelector(".cookieinfo-close").onclick = function() {
|
||||
console.log("close");
|
||||
document.cookie = "cookieMessageHide=1";
|
||||
cookieInfo.style.display = "none";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getCookie(name){
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(";");
|
||||
for (var i=0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while(c.charAt(0) === " ") c = c.substr(1, c.length);
|
||||
if(c.indexOf(nameEQ) === 0) return c.substr(nameEQ.length, c.length)
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("jl-cookie_notice", cookieNotice);
|
|
@ -40,9 +40,8 @@ class Footer extends HTMLElement {
|
|||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<jl-cookie_notice></jl-cookie_notice>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("jl-footer", Footer);
|
||||
customElements.define("jl-footer", Footer);
|
||||
|
|
Loading…
Reference in a new issue