1/* ------------------------------ 2 HANDLE COOKIE POPUP OVERLAY PREFERENCES 3-------------------------------*/ 4 5const LOCAL_STORAGE_KEY_COOKIE_OVERLAY = "gametizeShowCookiePopupOverlay"; 6const LOCAL_STORAGE_KEY_COOKIE_ACCEPTED = "gametizeUserCookiesAccepted"; 7 8$(document).ready(function() { 9 // To always show cookie popup overlay by default if not yet set (with localstorage) 10 if (localStorage.getItem(LOCAL_STORAGE_KEY_COOKIE_OVERLAY) === null) { 11 updateCookieOverlayPreferences(true); 12 } 13 14 // Display overlay 15 renderCookieOverlay(); 16}); 17 18/** 19 * Update cookie popup overlay preferences 20 * 21 * @param {boolean} setting - true/false 22 */ 23function updateCookieOverlayPreferences(setting) { 24 localStorage.setItem(LOCAL_STORAGE_KEY_COOKIE_OVERLAY, setting); 25} 26 27/** 28 * Render cookie popup overlay from localstorage setting 29 */ 30function renderCookieOverlay() { 31 var displayOverlay = localStorage.getItem(LOCAL_STORAGE_KEY_COOKIE_OVERLAY); 32 33 if (displayOverlay === "true") { 34 $('#doShowCookiesOverlay').show(); 35 activateAcceptCookiesButton(); 36 } 37} 38 39/** 40 * Close cookie popup overlay and update localstorage setting 41 */ 42function hideCookieOverlay() { 43 $('#doShowCookiesOverlay').hide(); 44 updateCookieOverlayPreferences(false); 45} 46 47/** 48 * Activate "Accept Cookies" button 49 */ 50function activateAcceptCookiesButton() { 51 $('.doAcceptCookies').click(function() { 52 doAcceptCookies(); 53 return false; 54 }); 55} 56 57/** 58 * Accept cookies and update localstorage setting 59 */ 60function doAcceptCookies() { 61 localStorage.setItem(LOCAL_STORAGE_KEY_COOKIE_ACCEPTED, true); 62 hideCookieOverlay(); 63}
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.