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

minor changes

parent bd772610
<p>
<a href="privacyPolicy">Privacy Policy</a>
(<span id="gdpr-result-text"></span> - <a href="javascript: showCookieBanner();">change</a>)
</p>
(<span id="gdpr-result-text"></span> - <a href="javascript: showBanner();">change</a>)
</p>
\ No newline at end of file
......@@ -32,15 +32,15 @@ function setResultText(acceptCookies){
}
}
/* showCookieBanner: show the banner */
function showCookieBanner() {
/* showBanner: show the banner */
function showBanner() {
var popup = $('#lap-cookies-banner');
popup.hide();
popup.slideDown('slow');
}
/* hideCookieBanner: show the banner */
function hideCookieBanner() {
/* hideBanner: show the banner */
function hideBanner() {
var popup = $('#lap-cookies-banner');
popup.hide();
}
......@@ -97,7 +97,7 @@ function accept(cookieMgmt) {
}
// feedback
hideCookieBanner();
hideBanner();
setResultText(true);
// style
......@@ -116,7 +116,7 @@ function refuse(cookieMgmt) {
}
// feedback
hideCookieBanner();
hideBanner();
setResultText(false);
// style
......@@ -124,15 +124,15 @@ function refuse(cookieMgmt) {
$('.lap-cookies-accept').removeClass('selected');
}
/* main function */
$( document ).ready(function() {
/* accept */
// accept
$('.lap-cookies-accept').click(function(e){
e.preventDefault(true);
accept();
});
/* refuse */
// refuse
$('.lap-cookies-refuse').click(function(e){
e.preventDefault(true);
refuse();
......@@ -145,22 +145,21 @@ $( document ).ready(function() {
// Check if DoNotTrack is activated
var dnt = navigator.doNotTrack || navigator.msDoNotTrack || window.doNotTrack;
var isToTrack = (dnt !== null && dnt !== undefined) ? (dnt && dnt !== 'yes' && dnt !== 1 && dnt !== '1') : true;
var doNotTrack = false;
// Do nothing if it is a bot
// If DoNotTrack is activated, do nothing too
// do nothing if it is a bot or if DoNotTrack is active
if (isBot || !isToTrack || !hasConsent()) {
refuse(false);
doNotTrack = true;
}
// User has already consent to use cookies to tracking
if (doNotTrack == false) {
if (doNotTrack === false) {
if (hasConsent() === true) {
// user has already given consent to use cookies to tracking
accept(true);
} else if (hasConsent() === false) {
// If it's not a bot, no DoNotTrack and not already accept, so show banner
showCookieBanner();
// all other cases considered, show banner
showBanner();
}
}
});
\ 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