|
| 1 | +<style> |
| 2 | + #cookie-notice {padding: 7px 15px; display: none; text-align: center; position: fixed; bottom: 0; width: 100%; background: #222; color: rgba(255,255,255,0.8);} |
| 3 | + #cookie-notice a {cursor: pointer; margin-left: 10px;} |
| 4 | + @media (max-width: 767px) { |
| 5 | + #cookie-notice span {display: block; padding-top: 3px; margin-bottom: 13px;} |
| 6 | + #cookie-notice a {position: relative; bottom: 4px;} |
| 7 | + } |
| 8 | +</style> |
| 9 | + |
| 10 | +<div id="cookie-notice"><span>We would like to use third party cookies and scripts to improve the functionality of this website.</span><a id="cookie-notice-accept" class="btn btn-primary btn-sm">Approve</a><a href="/privacy" class="btn btn-primary btn-sm">More info</a></div> |
| 11 | +<script> |
| 12 | + function createCookie(name,value,days) { |
| 13 | + var expires = ""; |
| 14 | + if (days) { |
| 15 | + var date = new Date(); |
| 16 | + date.setTime(date.getTime() + (days*24*60*60*1000)); |
| 17 | + expires = "; expires=" + date.toUTCString(); |
| 18 | + } |
| 19 | + document.cookie = name + "=" + value + expires + "; path=/"; |
| 20 | + } |
| 21 | + function readCookie(name) { |
| 22 | + var nameEQ = name + "="; |
| 23 | + var ca = document.cookie.split(';'); |
| 24 | + for(var i=0;i < ca.length;i++) { |
| 25 | + var c = ca[i]; |
| 26 | + while (c.charAt(0)==' ') c = c.substring(1,c.length); |
| 27 | + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); |
| 28 | + } |
| 29 | + return null; |
| 30 | + } |
| 31 | + function eraseCookie(name) { |
| 32 | + createCookie(name,"",-1); |
| 33 | + } |
| 34 | + |
| 35 | + if(readCookie('cookie-notice-dismissed')=='true') { |
| 36 | + // {% include ga.js %} |
| 37 | + } else { |
| 38 | + $('#cookie-notice').show(); |
| 39 | + } |
| 40 | + $('#cookie-notice-accept').click(function() { |
| 41 | + createCookie('cookie-notice-dismissed','true',31); |
| 42 | + $('#cookie-notice').hide(); |
| 43 | + }); |
| 44 | + |
| 45 | +</script> |
0 commit comments