Guest User

Untitled

a guest
Feb 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. jQuery(function($) {
  2.  
  3. checkCookie_eu();
  4.  
  5. function checkCookie_eu()
  6. {
  7.  
  8. var consent = getCookie_eu("cookies_consent");
  9.  
  10. if (consent == null || consent == "" || consent == undefined)
  11. {
  12. // show notification bar
  13. $('#cookie_directive_container').show();
  14. }
  15.  
  16. }
  17.  
  18. function setCookie_eu(c_name,value,exdays)
  19. {
  20.  
  21. var exdate = new Date();
  22. exdate.setDate(exdate.getDate() + exdays);
  23. var c_value = escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
  24. document.cookie = c_name + "=" + c_value+"; path=/";
  25.  
  26. $('#cookie_directive_container').hide('slow');
  27. }
  28.  
  29.  
  30. function getCookie_eu(c_name)
  31. {
  32. var i,x,y,ARRcookies=document.cookie.split(";");
  33. for (i=0;i<ARRcookies.length;i++)
  34. {
  35. x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  36. y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  37. x=x.replace(/^\s+|\s+$/g,"");
  38. if (x==c_name)
  39. {
  40. return unescape(y);
  41. }
  42. }
  43. }
  44.  
  45. $("#cookie_accept a").click(function(){
  46. setCookie_eu("cookies_consent", 1, 30);
  47. });
  48.  
  49. });
Add Comment
Please, Sign In to add comment