mirror of
https://github.com/openvk/openvk
synced 2024-11-13 10:39:24 +03:00
Global: Add Cookies notification
just for fun xd
This commit is contained in:
parent
45fe270700
commit
f481b27503
5 changed files with 69 additions and 1 deletions
|
@ -275,6 +275,8 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{include "components/cookies.xml"}
|
||||||
|
|
||||||
{script "js/node_modules/msgpack-lite/dist/msgpack.min.js"}
|
{script "js/node_modules/msgpack-lite/dist/msgpack.min.js"}
|
||||||
{script "js/node_modules/soundjs/lib/soundjs.min.js"}
|
{script "js/node_modules/soundjs/lib/soundjs.min.js"}
|
||||||
{script "js/node_modules/ky/umd.js"}
|
{script "js/node_modules/ky/umd.js"}
|
||||||
|
|
35
Web/Presenters/templates/components/cookies.xml
Normal file
35
Web/Presenters/templates/components/cookies.xml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<div class="cookies-popup" style="display: none;">
|
||||||
|
<div class="contanier">
|
||||||
|
<div class="text">
|
||||||
|
{tr("cookies_popup_content")|noescape}
|
||||||
|
</div>
|
||||||
|
<div class="buttons">
|
||||||
|
<a href="javascript:agreeWithCookies()" class="button">
|
||||||
|
{_cookies_popup_agree}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let cookie = decodeURIComponent(document.cookie).split(";");
|
||||||
|
let cookiesAgreed = false;
|
||||||
|
for(let i = 0; i < cookie.length; i++) {
|
||||||
|
let c = cookie[i];
|
||||||
|
while (c.charAt(0) == ' ') {
|
||||||
|
c = c.substring(1);
|
||||||
|
}
|
||||||
|
if(c == "cookiesAgreed=true") {
|
||||||
|
cookiesAgreed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!cookiesAgreed) {
|
||||||
|
u(".cookies-popup").nodes[0].style.display = "block";
|
||||||
|
}
|
||||||
|
|
||||||
|
function agreeWithCookies() {
|
||||||
|
document.cookie = "cookiesAgreed=true";
|
||||||
|
u(".cookies-popup").nodes[0].style.display = "none";
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1913,4 +1913,25 @@ table td[width="120"] {
|
||||||
border-bottom: 1.5px solid #707070;
|
border-bottom: 1.5px solid #707070;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cookies-popup {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
background: linear-gradient(#fff, #eee);
|
||||||
|
box-shadow: inset 0px 1px 0px #bbb, inset 0px 2px 0px #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cookies-popup .contanier {
|
||||||
|
width: 760px;
|
||||||
|
display: flex;
|
||||||
|
margin: 0 auto;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cookies-popup .contanier .text {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
|
@ -972,3 +972,8 @@
|
||||||
/* User alerts */
|
/* User alerts */
|
||||||
|
|
||||||
"user_alert_scam" = "This account has been reported a lot for scam. Please be careful, especially if he asked for money.";
|
"user_alert_scam" = "This account has been reported a lot for scam. Please be careful, especially if he asked for money.";
|
||||||
|
|
||||||
|
/* Cookies pop-up */
|
||||||
|
|
||||||
|
"cookies_popup_content" = "All kids love cookies, so this website uses cookies to identify you and nothing more. Check <a href='/privacy'>our privacy policy</a> for more information.";
|
||||||
|
"cookies_popup_agree" = "Accept";
|
||||||
|
|
|
@ -1023,3 +1023,8 @@
|
||||||
/* User alerts */
|
/* User alerts */
|
||||||
|
|
||||||
"user_alert_scam" = "На этот аккаунт много жаловались в связи с мошенничеством. Пожалуйста, будьте осторожны, особенно если у вас попросят денег.";
|
"user_alert_scam" = "На этот аккаунт много жаловались в связи с мошенничеством. Пожалуйста, будьте осторожны, особенно если у вас попросят денег.";
|
||||||
|
|
||||||
|
/* Cookies pop-up */
|
||||||
|
|
||||||
|
"cookies_popup_content" = "Все дети любят печенья, поэтому этот вебсайт использует Cookies чтобы идентифицировать вас и ничего более. Ознакомьтесь с нашей <a href='/privacy'>политикой конфиденциальности</a> для получения дополнительной информации.";
|
||||||
|
"cookies_popup_agree" = "Согласен";
|
||||||
|
|
Loading…
Reference in a new issue