1(function($) { 2 3 "use strict"; 4 5 $(document).ready(function() { 6 7 8 if (! aviaGetCookie('aviaCookieConsent')){ 9 $('.avia-cookie-consent').removeClass('cookiebar-hidden'); 10 } 11 12 //close btn 13 $('.avia-cookie-close-bar').on('click', function(e) { 14 15 var cookieContents = $(this).attr('data-contents'); 16 aviaSetCookie('aviaCookieConsent',cookieContents,60); 17 18 $('.avia-cookie-consent').addClass('cookiebar-hidden'); 19 20 e.preventDefault(); 21 }); 22 23 //info btn 24 if($.avia_utilities.av_popup) 25 { 26 var new_options = { 27 type:'inline', 28 midClick: true, // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. 29 items:{ 30 src: '#av-consent-extra-info', 31 type:'inline', 32 } 33 }; 34 35 new_options = $.extend({}, $.avia_utilities.av_popup, new_options); 36 $('.avia-cookie-info-btn').magnificPopup(new_options); 37 } 38 else 39 { 40 $('.avia-cookie-info-btn').on('click', function(e) { 41 alert('Default Lightbox must be activated for this feature to work'); 42 e.preventDefault(); 43 }); 44 } 45 46 function aviaSetCookie(CookieName,CookieValue,CookieDays) { 47 if (CookieDays) { 48 var date = new Date(); 49 date.setTime(date.getTime()+(CookieDays*24*60*60*1000)); 50 var expires = "; expires="+date.toGMTString(); 51 } 52 else var expires = ""; 53 document.cookie = CookieName+"="+CookieValue+expires+"; path=/"; 54 } 55 56 57 function aviaGetCookie(CookieName) { 58 var docCookiesStr = CookieName + "="; 59 var docCookiesArr = document.cookie.split(';'); 60 61 for(var i=0; i < docCookiesArr.length; i++) { 62 var thisCookie = docCookiesArr[i]; 63 64 while (thisCookie.charAt(0)==' ') { 65 thisCookie = thisCookie.substring(1,thisCookie.length); 66 } 67 if (thisCookie.indexOf(docCookiesStr) == 0) { 68 var cookieContents = $('.avia-cookie-close-bar').attr('data-contents'); 69 var savedContents = thisCookie.substring(docCookiesStr.length,thisCookie.length); 70 if (savedContents == cookieContents) { 71 return savedContents; 72 } 73 } 74 } 75 return null; 76 } 77 78 }); 79 80})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.