-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ee51f9
commit 790fd41
Showing
2 changed files
with
35 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,13 +112,13 @@ <h3>Where can I go with my questions?</h3> | |
<p>If you have questions about our processing of your personal data, or if you want to make use of one or more of your legal rights, then contact:</p> | ||
|
||
<ul> | ||
<li>Our privacy officer, who is available via: <a href="mailto:[email protected]">Webmaster</a> </li> | ||
<li>Our privacy officer, who is available via: <a href="mailto:[email protected]">[email protected]</a> </li> | ||
</ul> | ||
|
||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Accept</button> | ||
<button id="btn-accept-user-consent" type="button" class="btn btn-primary" data-dismiss="modal">Accept</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,45 @@ | ||
$(document).ready(function() { | ||
|
||
// Browser recommendation | ||
function isCookieSet(cookieName) { | ||
return document.cookie.split(';').filter(item => item.trim().startsWith(cookieName + '=')).length > 0; | ||
} | ||
|
||
const isChrome = () => navigator.userAgent.indexOf('Chrome') > -1; | ||
const cookieExists = (cookieName) => !!document.cookie.split(';').filter((item) => item.trim().startsWith(cookieName + '=')).length; | ||
const setCookies = (cookieName) => { | ||
const expiryDate = new Date(); | ||
expiryDate.setMonth(expiryDate.getMonth() + 1); | ||
document.cookie = cookieName + '=accepted; expires=' + expiryDate; | ||
}; | ||
function setCookie(cookieName, intMonth) { | ||
var expiryDate = new Date(); | ||
expiryDate.setMonth(expiryDate.getMonth() + intMonth); | ||
document.cookie = cookieName + '=accepted; expires=' + expiryDate + '; path=/'; | ||
} | ||
|
||
if(!isChrome() && !cookieExists('bg__browser-recommendation')) { | ||
// Browser recommendation | ||
|
||
if((navigator.userAgent.indexOf('Chrome') < 0) && !isCookieSet('bg__browser-recommendation')) { | ||
$("#browser-recommendation").toast('show'); | ||
}; | ||
|
||
$('#browser-recommendation').on('hidden.bs.toast', function () { | ||
setCookies('bg__browser-recommendation'); | ||
setCookie('bg__browser-recommendation', 1); | ||
$("#browser-recommendation").toast('dispose'); | ||
}); | ||
|
||
// User consent | ||
|
||
$('#menu_login a.nav-link').click(function(e) { | ||
e.preventDefault(); | ||
|
||
if (!isCookieSet('bg__user-consent')) { | ||
$('#user-consent').modal('show'); | ||
} else { | ||
window.location = $(this).attr('href'); | ||
}; | ||
}); | ||
|
||
$('#btn-accept-user-consent').click(function(e) { | ||
e.preventDefault(); | ||
|
||
setCookie('bg__user-consent', 6); | ||
|
||
var href = $('#menu_login a.nav-link').attr('href'); | ||
window.location = href; | ||
}); | ||
|
||
}); |