1CookieConsent = Class.create(); 2CookieConsent.prototype = 3 { 4 initialize : function( b2URLBase ) 5 { 6 this.b2URLBase = b2URLBase; 7 this.CONSENT_COOKIE_NAME = 'COOKIE_CONSENT_ACCEPTED'; 8 }, 9 10 checkCookieAcceptance : function( nonceParameter, isFrameSetSupported ) 11 { 12 var cookieString = getCookie( this.CONSENT_COOKIE_NAME ); 13 14 if ( cookieString === null ) 15 { // cookie wasn't found 16 var backURL = top.location.href; 17 var consentURL = this.b2URLBase + 'execute/consent?backURL=' + escape( backURL ) + '&preview=false' + '&' + nonceParameter; 18 if ( isFrameSetSupported ) 19 { 20 this.cookieLB = new lightbox.Lightbox( 21 { 22 useDefaultDimensionsAsMinimumSize : true, 23 closeOnBodyClick : false, 24 showCloseLink : false, 25 onClose : this.onClose, 26 lbTemplate : '<div class="lb-content CookieConsent" aria-live="assertive"></div>', 27 top: 50, 28 ajax : 29 { 30 url : consentURL, 31 loadExternalScripts : true 32 }, 33 setPositionAbsolute: true //so that small device widths can access the agree button 34 } ); 35 this.cookieLB.open(); 36 } 37 else 38 { 39 top.location.href = consentURL; 40 } 41 } 42 }, 43 44 showPolicy : function( nonceParameter, isFrameSetSupported ) { 45 var backURL = top.location.href; 46 var consentURL = this.b2URLBase + 'execute/consent?backURL=' + escape( backURL ) + '&preview=true' + '&' + nonceParameter; 47 if ( isFrameSetSupported ) 48 { 49 this.cookieLB = new lightbox.Lightbox( 50 { 51 useDefaultDimensionsAsMinimumSize : true, 52 closeOnBodyClick : false, 53 showCloseLink : false, 54 lbTemplate : '<div class="lb-content CookieConsent" aria-live="assertive"></div>', 55 top: 50, 56 ajax : 57 { 58 url : consentURL, 59 loadExternalScripts : true 60 } 61 } ); 62 this.cookieLB.open(); 63 } 64 else 65 { 66 top.location.href = consentURL; 67 } 68 }, 69 70 agree : function( backURL ) 71 { 72 // Set expire to 10 years later. 73 var expiredate = new Date(); 74 expiredate.setFullYear( expiredate.getFullYear() + 10 ); 75 setCookie( this.CONSENT_COOKIE_NAME, true, expiredate ); 76 lightbox.acceptButtonClicked = true; 77 this.close(); 78 }, 79 80 onClose : function() { 81 // This is called if a close event happens, such as Escape key; if the lb wasn't closed by button click then we don't want to close it 82 if (!lightbox.acceptButtonClicked) { 83 throw new Exception('user clicked escape'); 84 } 85 }, 86 87 close : function() { 88 lightbox.closeCurrentLightbox(); 89 } 90 };
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.