1jQuery(function ($) { 2 $('#flexiblecookies_accept_cookies').on('click', flexibleCookiesBlocker.acceptAllCookies); 3 $('#flexiblecookies_deny_cookies').on('click', flexibleCookiesBlocker.denyAllCookies); 4 $('.flexiblecookies_open_settings_button').on('click', flexibleCookiesUI.showCookiesSettingsWindow); 5 $('#flexiblecookies_accept_settings_cookies').on('click', flexibleCookiesBlocker.acceptSelectedCookies); 6 $('#flexiblecookies_close_settings').on('click', flexibleCookiesUI.hideCookiesSettingsWindow); 7 $('#flexiblecookies_settings_background').on('click', flexibleCookiesUI.hideCookiesSettingsWindow); 8 9 if (flexibleCookiesFunctions.getCookieValue(plugin_cookies['bar']) === false) { 10 flexibleCookiesUI.showCookieBar(); 11 } 12 if(flexibleCookiesFunctions.getCookieValue(plugin_cookies['bar']) !== false) { 13 flexibleCookiesUI.showReopenSettingsButton(); 14 } 15}); 16 17class FlexibleCookiesFunctions{ 18 getCookieValue( cookie_name ){ 19 let name = cookie_name + "="; 20 let decodedCookie = decodeURIComponent(document.cookie); 21 let ca = decodedCookie.split(';'); 22 for(let i = 0; i < ca.length; i++) { 23 let c = ca[i]; 24 while (c.charAt(0) === ' ') { 25 c = c.substring(1); 26 } 27 if (c.indexOf(name) === 0) { 28 return c.substring(name.length, c.length); 29 } 30 } 31 return false; 32 } 33 getCookiesArray(){ 34 let cookiesArray = []; 35 let cookies = document.cookie.split(";"); 36 37 for (let i = 0; i < cookies.length; i++) { 38 let cookie = cookies[i].trim(); 39 let cookieParts = cookie.split("="); 40 let cookieName = cookieParts[0]; 41 let cookieValue = cookieParts[1]; 42 43 cookiesArray.push({ 44 name: cookieName, 45 value: cookieValue 46 }); 47 } 48 49 return cookiesArray; 50 } 51 setCookie( cookie_name , cookie_value , parameters) { 52 let newCookie = cookie_name + '=' + cookie_value + ';' 53 54 Object.entries(parameters).forEach(function([key, value]) { 55 newCookie += key + '=' + value + ';'; 56 }); 57 document.cookie = newCookie; 58 } 59 getAcceptedCategories(){ 60 const checkboxValues = []; 61 62 jQuery('.wpdesk-cookie-category:checked').each(function() { 63 checkboxValues.push(jQuery(this).val()); 64 }); 65 66 return checkboxValues; 67 } 68 getAllCategories(){ 69 const checkboxValues = []; 70 71 jQuery('.wpdesk-cookie-category').each(function() { 72 checkboxValues.push(jQuery(this).val()); 73 }); 74 75 return checkboxValues; 76 77 } 78} 79const flexibleCookiesFunctions = new FlexibleCookiesFunctions();
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.