Add optional JS-based features

main
Anonymous Contributor 2023-09-15 14:34:50 +02:00
parent b259a3bec9
commit 9046380e16
2 changed files with 16 additions and 0 deletions

8
js/asset-protection.js Normal file
View File

@ -0,0 +1,8 @@
$(function() {
$(window).on('contextmenu', function(event) {
if(event.target.nodeName.toLowerCase() == 'img' || $(event.target).css('background-image') != 'none') {
alert($('html').data('copyright-msg'));
event.preventDefault();
}
});
});

8
js/cookiebanner.js Normal file
View File

@ -0,0 +1,8 @@
$(function() {
$('#cookie-law-message .imClose').on('click', function(event) {
$('#cookie-law-message').remove();
let expiry = new Date();
expiry.setTime(expiry.getTime() + 2592000000);
document.cookie = "cookieBannerDismiss=true; SameSite=Strict; Secure; expires=" + expiry.toUTCString();
});
});