1(function( $ ) { 2 'use strict'; 3 4 var COOKIE_NAME = 'webads_cookie_notice_ack'; 5 var COOKIE_MAX_AGE = 60 * 60 * 24 * 30; // 30 days 6 7 var hasCookieConsent = function() { 8 return document.cookie.indexOf( COOKIE_NAME + '=' ) !== -1; 9 }; 10 11 var setCookieConsent = function() { 12 document.cookie = COOKIE_NAME + '=1;path=/;max-age=' + COOKIE_MAX_AGE + ';SameSite=Lax'; 13 }; 14 15 $( function() { 16 var $notice = $( '#webads-cookie-notice' ); 17 18 if ( ! $notice.length ) { 19 return; 20 } 21 22 var $button = $notice.find( '.webads-cookie-notice__button' ); 23 24 if ( ! hasCookieConsent() ) { 25 $notice.addClass( 'is-visible' ).attr( 'aria-hidden', 'false' ); 26 } 27 28 $button.on( 'click', function() { 29 setCookieConsent(); 30 $notice.removeClass( 'is-visible' ).attr( 'aria-hidden', 'true' ); 31 } ); 32 } ); 33})( 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.