fix cookie notice
This commit is contained in:
parent
b2472e6881
commit
8aecbd15c5
24
js/cookie.js
24
js/cookie.js
|
@ -1,7 +1,3 @@
|
||||||
function acceptCookie(){
|
|
||||||
document.cookie = "cookieMessageHide=1";
|
|
||||||
checkHide();
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCookie(name){
|
function getCookie(name){
|
||||||
var nameEQ = name + "=";
|
var nameEQ = name + "=";
|
||||||
|
@ -14,11 +10,15 @@ function getCookie(name){
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkHide(){
|
let cookieInfo = document.querySelector(".cookieinfo");
|
||||||
let cookieInfo = document.getElementsByClassName("cookieinfo")[0];
|
if (getCookie("cookieMessageHide") === "1"){
|
||||||
if (getCookie("cookieMessageHide") === "1"){
|
cookieInfo.style.display = "none";
|
||||||
cookieInfo.style.display = "none";
|
} else {
|
||||||
} else {
|
cookieInfo.style.display = "block";
|
||||||
cookieInfo.style.display = "block";
|
}
|
||||||
}
|
|
||||||
}
|
document.querySelector(".cookieinfo-close").onclick = function() {
|
||||||
|
console.log("close");
|
||||||
|
document.cookie = "cookieMessageHide=1";
|
||||||
|
cookieInfo.style.display = "none";
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
require("./burgerMenu");
|
|
||||||
require("./cookie");
|
require("./cookie");
|
||||||
|
require("./burgerMenu");
|
||||||
require("./dialog");
|
require("./dialog");
|
||||||
require("./error");
|
require("./error");
|
||||||
require("./imgPreview");
|
require("./imgPreview");
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"compile": "concurrently \"yarn css\" \"yarn js\"",
|
"compile": "concurrently \"yarn css\" \"yarn js\"",
|
||||||
"css": "sass scss/:public/css --style=compressed --no-source-map",
|
"css": "sass scss/:public/css --style=compressed --no-source-map",
|
||||||
"js": "webpack --config ./webpack.conf.js",
|
"js": "webpack --config ./webpack.conf.js",
|
||||||
"watch": "concurrently \"sass --watch --style compressed scss/:public/css\" \"cd public && php -S locaLhost:1234\" \"webpack --config ./webpack.conf.js --mode development\""
|
"watch": "concurrently \"sass --watch --style compressed scss/:public/css\" \"cd public && php -S locaLhost:1234\" \"webpack --config ./webpack.conf.js --mode development --watch\""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@webpack-cli/init": "^1.1.3",
|
"@webpack-cli/init": "^1.1.3",
|
||||||
|
|
|
@ -42,7 +42,7 @@ function getFooter(){
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<div class="cookieinfo">
|
<div class="cookieinfo">
|
||||||
<div class="cookieinfo-close" onclick="acceptCookie()">
|
<div class="cookieinfo-close">
|
||||||
✖
|
✖
|
||||||
</div>
|
</div>
|
||||||
<span class="cookieinfo-text">
|
<span class="cookieinfo-text">
|
||||||
|
@ -50,9 +50,6 @@ function getFooter(){
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<script src="/js/script.js"></script>
|
<script src="/js/script.js"></script>
|
||||||
<script>
|
|
||||||
checkHide();
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
EOF);
|
EOF);
|
||||||
|
|
|
@ -7,6 +7,7 @@ module.exports = {
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, "public/js"),
|
path: path.resolve(__dirname, "public/js"),
|
||||||
filename: "script.js",
|
filename: "script.js",
|
||||||
|
libraryTarget: 'window'
|
||||||
},
|
},
|
||||||
mode: "production"
|
mode: "production"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue