Verified Commit 09699422 authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

changes edp to lap

parent cc2599b5
<style>
#edp-cookies-banner {
#lap-cookies-banner {
position: fixed;
bottom: 0;
background-color: #fff;
......@@ -13,39 +13,39 @@
width: 100%;
}
#edp-cookies-banner .banner-text {
#lap-cookies-banner .banner-text {
float: center;
min-height: 60px;
padding-left: 40px;
padding-right: 40px;
}
@media (max-width: 991px) {
#edp-cookies-banner .banner-text {
#lap-cookies-banner .banner-text {
float: inherit;
text-align: center;
max-width: 100%;
}
}
#edp-cookies-banner .banner-text p a {
#lap-cookies-banner .banner-text p a {
color: #84c4f1;
}
#edp-cookies-banner .banner-text p a:hover {
#lap-cookies-banner .banner-text p a:hover {
color: #198cdc;
}
#edp-cookies-banner .banner-buttons {
#lap-cookies-banner .banner-buttons {
float: center;
line-height: 54px;
}
@media (max-width: 991px) {
#edp-cookies-banner .banner-buttons {
#lap-cookies-banner .banner-buttons {
float: inherit;
text-align: center;
max-width: 100%;
}
}
#edp-cookies-banner .banner-buttons .edp-cookies-accept,
#edp-cookies-banner .banner-buttons .edp-cookies-refuse,
#edp-cookies-banner .banner-buttons .edp-cookies-more {
#lap-cookies-banner .banner-buttons .lap-cookies-accept,
#lap-cookies-banner .banner-buttons .lap-cookies-refuse,
#lap-cookies-banner .banner-buttons .lap-cookies-more {
margin: 0.3rem 0.5rem;
text-decoration: none;
padding: 10px 25px;
......@@ -57,9 +57,9 @@
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
#edp-cookies-banner .banner-buttons .edp-cookies-accept:hover,
#edp-cookies-banner .banner-buttons .edp-cookies-refuse:hover,
#edp-cookies-banner .banner-buttons .edp-cookies-more:hover {
#lap-cookies-banner .banner-buttons .lap-cookies-accept:hover,
#lap-cookies-banner .banner-buttons .lap-cookies-refuse:hover,
#lap-cookies-banner .banner-buttons .lap-cookies-more:hover {
background: white;
color: #198cdc !important;
border: 1px solid #198cdc;
......@@ -68,7 +68,7 @@
-webkit-box-sizing: border-box;
text-decoration: none;
}
#edp-cookies-banner .btn {
#lap-cookies-banner .btn {
display: inline-block;
margin-bottom: 0;
text-align: center;
......@@ -85,11 +85,11 @@
user-select: none;
}
#edp-cookies-banner .btn.active {
#lap-cookies-banner .btn.active {
background-color: #D9EDF7;
border-color: #85c5e5;
}
#edp-cookies-banner .btn.disabled {
#lap-cookies-banner .btn.disabled {
background-color: #D9EDF7;
border-color: #85c5e5;
}
......@@ -136,14 +136,14 @@ function loadPiwik() {
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g,s);
}
function showEdpCookieBanner() {
var popup = jQuery('#edp-cookies-banner');
function showlapCookieBanner() {
var popup = jQuery('#lap-cookies-banner');
popup.hide();
popup.slideDown('slow');
console.log('popped the banner');
}
function hideEdpCookieBanner() {
var popup = jQuery('#edp-cookies-banner');
function hidelapCookieBanner() {
var popup = jQuery('#lap-cookies-banner');
popup.hide();
console.log('removed the banner');
}
......@@ -160,61 +160,61 @@ function clearPiwik() {
$( document ).ready(function() {
hideEdpCookieBanner();
hidelapCookieBanner();
/* accept */
$('.edp-cookies-accept').click(function (e) {
$('.lap-cookies-accept').click(function (e) {
e.preventDefault(true);
console.log('clicked on accept');
Cookies.set('edp_cookie_agree', 1, { expires: parseInt(settings.expires), path: '/' });
hideEdpCookieBanner();
//jQuery('#edp-cookies-banner').slideUp('slow');
jQuery('.edp-cookies-accept').addClass('disabled');
jQuery('.edp-cookies-refuse').removeClass('disabled');
Cookies.set('lap_cookie_agree', 1, { expires: parseInt(settings.expires), path: '/' });
hidelapCookieBanner();
//jQuery('#lap-cookies-banner').slideUp('slow');
jQuery('.lap-cookies-accept').addClass('disabled');
jQuery('.lap-cookies-refuse').removeClass('disabled');
jQuery(this).blur();
loadPiwik();
});
/* refuse */
$('.edp-cookies-refuse').click(function (e) {
$('.lap-cookies-refuse').click(function (e) {
e.preventDefault(true);
console.log('clicked on refuse');
clearPiwik();
Cookies.set('edp_cookie_agree', 0, { expires: parseInt(settings.expires), path: '/' });
hideEdpCookieBanner();
//jQuery('#edp-cookies-banner').slideUp('slow');
jQuery('.edp-cookies-refuse').addClass('disabled');
jQuery('.edp-cookies-accept').removeClass('disabled');
Cookies.set('lap_cookie_agree', 0, { expires: parseInt(settings.expires), path: '/' });
hidelapCookieBanner();
//jQuery('#lap-cookies-banner').slideUp('slow');
jQuery('.lap-cookies-refuse').addClass('disabled');
jQuery('.lap-cookies-accept').removeClass('disabled');
jQuery(this).blur();
});
/* default mechanism */
if (!jQuery('body').hasClass('edp-cookies-proceed')) {
jQuery('body').addClass('edp-cookies-proceed');
if (!jQuery('body').hasClass('lap-cookies-proceed')) {
jQuery('body').addClass('lap-cookies-proceed');
if (window.doNotTrack || navigator.doNotTrack || navigator.msDoNotTrack || ('external' in window && 'msTrackingProtectionEnabled' in window.external)) {
if (window.doNotTrack == "1" || navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1" || ('external' in window && 'msTrackingPronectionEnabled' in window.external && window.external.msTrackingProtectionEnabled())) {
/* Do Not Track is enabled => stop */
jQuery('.edp-cookies-dnt-inactive').hide(); // Hide no DNT message.
jQuery('.edp-cookies-accept, .edp-cookies-refuse').addClass('disabled');
jQuery('.lap-cookies-dnt-inactive').hide(); // Hide no DNT message.
jQuery('.lap-cookies-accept, .lap-cookies-refuse').addClass('disabled');
}
}
jQuery('.edp-cookies-dnt-active').hide(); // Hide DNT message.
edpCookieAgree = getCookie('edp_cookie_agree');
console.log(edpCookieAgree);
if (edpCookieAgree == '0') {
jQuery('.lap-cookies-dnt-active').hide(); // Hide DNT message.
lapCookieAgree = getCookie('lap_cookie_agree');
console.log(lapCookieAgree);
if (lapCookieAgree == '0') {
/* Visitor refused our cookies => remove piwik trace if present */
jQuery('.edp-cookies-refuse').addClass('disabled');
jQuery('.lap-cookies-refuse').addClass('disabled');
clearPiwik();
}
else if (edpCookieAgree == '1') {
else if (lapCookieAgree == '1') {
/* Visitor accepted our cookies => load Piwik */
jQuery('.edp-cookies-accept').addClass('disabled');
jQuery('.lap-cookies-accept').addClass('disabled');
loadPiwik();
}
else {
/* Visitor did not choose yet */
//var edpCookieAgree = Cookies.set('edp_cookie_agree', {path: '/'}); // do not set cookie
showEdpCookieBanner();
//var lapCookieAgree = Cookies.set('lap_cookie_agree', {path: '/'}); // do not set cookie
showlapCookieBanner();
}
}
......
......@@ -35,14 +35,14 @@
</div>
</div>
</footer>
<div id="edp-cookies-banner">
<div id="lap-cookies-banner">
<div class="banner-text">
<p>This website needs some cookies and similar means to function.<br>
If you permit us, we will use those means to collect data on your visits for aggregated statistics to improve our service.</p>
</div>
<div class="banner-buttons">
<button class="btn edp-cookies-accept" type="button">Accept cookies for aggregated statistics</button>
<button class="btn edp-cookies-refuse" type="button">No thanks, only technically necessary cookies</button>
<a class="btn edp-cookies-more" href="/policy">More information</a>
<button class="btn lap-cookies-accept" type="button">Accept cookies for aggregated statistics</button>
<button class="btn lap-cookies-refuse" type="button">No thanks, only technically necessary cookies</button>
<a class="btn lap-cookies-more" href="/policy">More information</a>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment