From 607dcab8306f3e403b04229d62afb428475a3da3 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Wed, 22 Oct 2025 12:43:46 +0200 Subject: [PATCH] Enhance Cookie Notice Pro styles and update navigation menu structure - Updated CSS for Cookie Notice Pro to improve button styles and layout. - Adjusted button order in mobile view for better user experience. - Set cookie settings display to none by default. - Modified link styles for better visibility. - Refactored navigation menu in NavMenu.php for improved readability and structure. - Ensured consistent indentation and formatting throughout the navigation menu. - Added missing submenu items for doors and windows categories. --- .../CookieNoticePro/cookienoticepro.script.js | 641 +++++++++++------- .../CookieNoticePro/cookienoticepro.style.css | 21 +- templates_user/components/NavMenu.php | 315 +++++---- 3 files changed, 566 insertions(+), 411 deletions(-) diff --git a/plugins/CookieNoticePro/cookienoticepro.script.js b/plugins/CookieNoticePro/cookienoticepro.script.js index 02e28f6..d08b70d 100644 --- a/plugins/CookieNoticePro/cookienoticepro.script.js +++ b/plugins/CookieNoticePro/cookienoticepro.script.js @@ -8,29 +8,29 @@ Make your own cookie information popup in minutes. * Changelog: https://cookienoticepro.flerosoft.com/docs/getting-started#item-1-4 */ -(function ($) { - +;(function ($) { 'use strict' const settingsIcon = - ''; + '' const cookieIcon = - ' '; + ' ' - const closeIcon = ''; + const closeIcon = + '' /* - *-------------------------------------------------------------------------- - * CONFIG OR SETTINGS - Customize the popup banner START - *-------------------------------------------------------------------------- - */ + *-------------------------------------------------------------------------- + * CONFIG OR SETTINGS - Customize the popup banner START + *-------------------------------------------------------------------------- + */ const config = { themeSettings: { - primaryColor: "#000", // Primary Color of Popup Banner - darkColor: "#3b3e4a", // Dark Theme Color - lightColor: "#ffffff", // Light Theme Color - themeMode: "light", // Theme Mode (light|dark) + primaryColor: '#232323', // Primary Color of Popup Banner + darkColor: '#3b3e4a', // Dark Theme Color + lightColor: '#ffffff', // Light Theme Color + themeMode: 'light', // Theme Mode (light|dark) }, enableGoogleConsentMode: true, // Add support for Google consent mode v2 (https://cookiebannergenerator.com/implementing-google-consent-mode-v2-with-cookie-notice-pro-a-step-by-step-guide/) enableMinimize: true, // Enable minimized floating cookie icon to adjust preferences @@ -41,182 +41,302 @@ Make your own cookie information popup in minutes. fullWidth: false, // Full width popup works only when "displayPosition" is set to top/bottom allCheckboxesChecked: true, // The setting checkboxes should be checked by default initially or not(true|false) - displayPosition: "bottom", // Where popup should appear(top|right|bottom|left) - settingsBtnLabel: "Customize", // Text of settings button + displayPosition: 'bottom', // Where popup should appear(top|right|bottom|left) + settingsBtnLabel: 'Adjust', // Text of settings button delay: 1, // After how much time should popup appear(2000 is equal to 2 seconds) expires: 365, // Expiry date of cookie(365 is equal to 365 days) - title: "We value user privacy.", // Title of popup bannner - description: "We use cookies to improve browsing quality, display ads or content tailored to individual user needs, and analyze site traffic. Clicking the „Accept all” button signifies consent to us using cookies.", // Message - acceptBtnLabel: "Accept", // Accept cookie button text - declineInfoBtnLabel: "Reject", // Decline cookie button text - moreInfoBtnLink: "/privacy-policy", // Learn more link(default: privacy policy page) - moreInfoBtnLabel: "Privacy Policy", // More info link text - cookieTypesTitle: "Select the cookies to accept", // Title of cookie preference options - necessaryCookieTypeLabel: "Required", // Label text of Necessary cookie item - floatingIconTooltip: "Customize", // Tooltip of floating cookie icon (Minimized) - necessaryCookieTypeDesc: "These cookies are necessary for the website to function and cannot be switched off in our systems.", // Hover text of necessary cookies - onConsentAccept: ()=> { // It will inject scripts in head if cookie preferences menu(showSettingsBtn) is enabled - console.log("Consent accepted!") + title: 'We value users privacy', // Title of popup bannner + // description: 'Używamy plików cookie, aby poprawić jakość przeglądania, wyświetlać reklamy lub treści dostosowane do indywidualnych potrzeb użytkowników oraz analizować ruch na stronie. Kliknięcie przycisku „Akceptuj wszystkie” oznacza zgodę na wykorzystywanie przez nas plików cookie.', // Message + description: ` + We use cookies and similar technologies to ensure the proper functioning of the website, analyze traffic and statistics, enable ad personalization, and measure their effectiveness.
+Personal data (e.g., IP address, cookie identifiers) may be used for analytical and advertising purposes.
+Google and our partners may use this data in accordance with the Google Data Processing Terms.
+Clicking the “Accept all” button means you consent to the processing of your data in accordance with our Privacy Policy. + `, + acceptBtnLabel: 'Accept all', // Accept cookie button text + declineInfoBtnLabel: 'Decline', // Decline cookie button text + showSettingsLabel: 'Cookie Settings', + ifOpenedSettings_acceptBtnLabel: 'Accept', + // moreInfoBtnLink: '/polityka-prywatnosci', // Learn more link(default: privacy policy page) + // moreInfoBtnLabel: 'Polityka prywatności', // More info link text + cookieTypesTitle: 'Select cookies to accept', // Title of cookie preference options + necessaryCookieTypeLabel: 'Necessary', // Label text of Necessary cookie item + floatingIconTooltip: 'Adjust', // Tooltip of floating cookie icon (Minimized) + necessaryCookieTypeDesc: + 'These cookies are essential for the website to function and cannot be disabled in our systems.', // Hover text of necessary cookies + onConsentAccept: () => { + // It will inject scripts in head if cookie preferences menu(showSettingsBtn) is enabled + console.log('Consent accepted!') }, - onConsentReject: ()=> { // This code will run on cookie reject/decline - console.log("Consent Rejected!"); + onConsentReject: () => { + // This code will run on cookie reject/decline + console.log('Consent Rejected!') }, cookieTypes: [ // Cookie types, value and description (Cookie Preferences Selection) { - type: "Functional", - value: "preferences", // WARNING: DO NOT EDIT THIS VALUE - description: "Essential cookies are crucial for basic website functions, and the website will not function properly without them. These cookies do not store any personally identifiable information.", + type: 'Functional', + value: 'preferences', // WARNING: DO NOT EDIT THIS VALUE + description: + 'These cookies are essential for the website to function and cannot be disabled in our systems. These cookies do not store any personally identifiable information.', }, { - type: "Advertisement", - value: "marketing", // WARNING: DO NOT EDIT THIS VALUE - description: "Advertising cookies are used to deliver personalized ads to users based on the pages they have visited previously and to analyze the effectiveness of advertising campaigns.", + type: 'Advertising', + value: 'marketing', // WARNING: DO NOT EDIT THIS VALUE + description: + 'Advertising cookies are used to provide users with personalized ads based on the pages they have previously visited and to analyze the effectiveness of advertising campaigns.', }, { - type: "Analytics", - value: "analytics", // WARNING: DO NOT EDIT THIS VALUE - description: "Analytical cookies are used to understand how users interact with the website. These cookies help provide information about metrics such as the number of visitors, bounce rate, traffic source, etc.", + type: 'Analytics', + value: 'analytics', // WARNING: DO NOT EDIT THIS VALUE + description: + 'Analytics cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.', }, ], - }; + } /* - *-------------------------------------------------------------------------- - * CONFIG OR SETTINGS - Customize the popup banner END - *-------------------------------------------------------------------------- - */ + *-------------------------------------------------------------------------- + * CONFIG OR SETTINGS - Customize the popup banner END + *-------------------------------------------------------------------------- + */ - const COOKIE_CONSENT = "cnp_consent"; // WARNING: DO NOT EDIT THIS VALUE - const COOKIE_CONSENT_PREFS = "cnp_prefs"; // WARNING: DO NOT EDIT THIS VALUE - const GOOGLE_CONSENT_MODE_AD_PREFS = "cnp_gconsent_ad_prefs" // WARNING: DO NOT EDIT THIS VALUE - const GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE = "cnp_gconsent_analytics_storage" // WARNING: DO NOT EDIT THIS VALUE + const COOKIE_CONSENT = 'cnp_consent' // WARNING: DO NOT EDIT THIS VALUE + const COOKIE_CONSENT_PREFS = 'cnp_prefs' // WARNING: DO NOT EDIT THIS VALUE + const GOOGLE_CONSENT_MODE_AD_PREFS = 'cnp_gconsent_ad_prefs' // WARNING: DO NOT EDIT THIS VALUE + const GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE = 'cnp_gconsent_analytics_storage' // WARNING: DO NOT EDIT THIS VALUE $.fn.cookieNoticePro = (event) => { - changeRootVariables(); - let cookieConsentExists = cookieExists(COOKIE_CONSENT); - let cookiePrefsValue = accessCookie(COOKIE_CONSENT_PREFS); + changeRootVariables() + let cookieConsentExists = cookieExists(COOKIE_CONSENT) + let cookiePrefsValue = accessCookie(COOKIE_CONSENT_PREFS) - if ( !cookieConsentExists) { - // add layer to the body below cookies to prevent click - $('body').append(''); - } + if (!cookieConsentExists) { + // add layer to the body below cookies to prevent click + $('body').append( + '' + ) + } // If consent is not accepted - if (!cookieConsentExists || event == "open") { - $("#cookieNoticePro").remove(); - $("#cookieMinimizeIcon").remove(); + if (!cookieConsentExists || event == 'open') { + $('#cookieNoticePro').remove() + $('#cookieMinimizeIcon').remove() - let cookieTypes='
  • "; + let cookieTypes = + '
  • ' - const preferences = JSON.parse(cookiePrefsValue); + const preferences = JSON.parse(cookiePrefsValue) $.each(config.cookieTypes, (index, field) => { - if (field.type !== "" && field.value !== "") { - let cookieTypeDescription = ""; + if (field.type !== '' && field.value !== '') { + let cookieTypeDescription = '' if (field.description !== false) { - cookieTypeDescription = ' title="' + field.description + '"'; + cookieTypeDescription = ' title="' + field.description + '"' } - cookieTypes+='
  • "; + cookieTypes += + '
  • ' } - }); + }) - let cookieNotice='
    '+ closeIcon +'
    '+cookieIcon+"

    "+config.title+'

    '+config.description+' '+config.moreInfoBtnLabel+'

    '+settingsIcon+config.settingsBtnLabel+'
    "; + let cookieNotice = + '
    ' + + closeIcon + + '
    ' + + cookieIcon + + '

    ' + + config.title + + '

    ' + + config.description + + '

    ' + + settingsIcon + + config.settingsBtnLabel + + '
    ' + setTimeout( + () => { + $('body').append(cookieNotice) + $('#cookieNoticePro') + .hide() + .fadeIn('slow', () => { + if (event == 'open') { + $('#cookieSettings').trigger('click') + $.each(preferences, (index, field) => { + $('input#gdprPrefItem' + field).prop('checked', true) + }) + } + }) + if (!config.showSettingsBtn) { + $('#cookieNoticePro #cookieSettings').hide() + } + if (!config.showDeclineBtn) { + $('#cookieNoticePro #cookieReject').hide() + } + if (!config.showCookieIcon) { + $('#cookieNoticePro #cookieIcon').hide() + } + if (!config.showCloseIcon) { + $('#cookieNoticePro #closeIcon').hide() + } + }, + event === 'open' ? 0 : config.delay + ) + $('body').on('click', '#cookieAccept', () => { + let acceptType = $('#cookieAccept').attr('accept') - setTimeout(() => { - $("body").append(cookieNotice); - $("#cookieNoticePro").hide().fadeIn("slow", () => { - if(event == "open") { - $("#cookieSettings").trigger("click"); - $.each(preferences, (index, field) => { - $("input#gdprPrefItem" + field).prop("checked", true); - }); - } - }); - if(!config.showSettingsBtn) { - $("#cookieNoticePro #cookieSettings").hide(); - } - if(!config.showDeclineBtn) { - $("#cookieNoticePro #cookieReject").hide(); - } - if(!config.showCookieIcon) { - $("#cookieNoticePro #cookieIcon").hide(); - } - if(!config.showCloseIcon) { - $("#cookieNoticePro #closeIcon").hide(); - } - }, event === "open" ? 0 : config.delay); - $("body").on("click", "#cookieAccept", () => { - hideCookieBanner(true, config.expires); - $('input[name="gdprPrefItem"][data-compulsory="on"]').prop("checked", true); - let prefs = []; - $.each($('input[name="gdprPrefItem"]').serializeArray(), (i, field) => { - prefs.push(field.value); - }); - createCookie(COOKIE_CONSENT_PREFS, encodeURIComponent(JSON.stringify(prefs)), { - expires: daysToUTC(365), - path: "/" - }); - config.onConsentAccept.call(this); - config.showSettingsBtn? injectScripts() : null; - if(config.enableGoogleConsentMode) { - googleConsentModeHandler(); - } - }); - $("body").on("click", "#cookieSettings", () => { - if(event === "open"){ - $('input[name="gdprPrefItem"]:not(:disabled)').attr("data-compulsory", "off").prop("checked", false); - $("#cookieTypes").slideDown("fast", function () { - $("#cookieSettings").prop("disabled", true); - }); + hideCookieBanner(true, config.expires) + $('input[name="gdprPrefItem"][data-compulsory="on"]').prop( + 'checked', + true + ) + + let prefs = [] + + if (acceptType === 'all') { + $.each($('input[name="gdprPrefItem"]'), (i, field) => { + prefs.push(field.value) + }) } else { - $('input[name="gdprPrefItem"]:not(:disabled)').attr("data-compulsory", "off").prop("checked", config.allCheckboxesChecked); - $("#cookieTypes").toggle("fast", function () { - $("#cookieSettings").prop("disabled", false); - }); + $.each( + $('input[name="gdprPrefItem"]').serializeArray(), + (i, field) => { + prefs.push(field.value) + } + ) } - }); - $("body").on("click", "#closeIcon", () => { - $("#cookieNoticePro").remove(); - }); - $("body").on("click", "#cookieReject", () => { - hideCookieBanner(false, config.expires); - config.onConsentReject.call(this); + + createCookie( + COOKIE_CONSENT_PREFS, + encodeURIComponent(JSON.stringify(prefs)), + { + expires: daysToUTC(365), + path: '/', + } + ) + config.onConsentAccept.call(this) + config.showSettingsBtn ? injectScripts() : null + if (config.enableGoogleConsentMode) { + googleConsentModeHandler() + } + }) + $('body').on('click', '#cookieSettings', () => { + if (event === 'open') { + $('input[name="gdprPrefItem"]:not(:disabled)') + .attr('data-compulsory', 'off') + .prop('checked', false) + // $('#cookieTypes').slideDown('fast', function () { + // $('#cookieSettings').prop('disabled', true) + // }) + } else { + $('input[name="gdprPrefItem"]:not(:disabled)') + .attr('data-compulsory', 'off') + .prop('checked', config.allCheckboxesChecked) + // $('#cookieTypes').toggle('fast', function () { + // $('#cookieSettings').prop('disabled', false) + // }) + } + }) + + $('body').on('click', '#cookieShowSettings', () => { + const cookieTypes = $('#cookieTypes') + + $('#cookieAccept').html(config.ifOpenedSettings_acceptBtnLabel) + $('#cookieAccept').attr('accept', 'none') + + if (event === 'open') { + $('#cookieTypes').slideDown('fast') + } else { + $('#cookieTypes').toggle('fast') + } + // if (cookieTypes.is(':hidden')) { + // cookieTypes.slideDown('fast') + // } else { + // cookieTypes.slideUp('fast') + // } + }) + + $('body').on('click', '#closeIcon', () => { + $('#cookieNoticePro').remove() + }) + $('body').on('click', '#cookieReject', () => { + hideCookieBanner(false, config.expires) + config.onConsentReject.call(this) // Delete prefs cookie from brower on reject - createCookie(COOKIE_CONSENT_PREFS, "", { + createCookie(COOKIE_CONSENT_PREFS, '', { expires: daysToUTC(-365), - path: "/" - }); - }); + path: '/', + }) + }) } // If already consent is accepted, inject preferences else { - if(config.showSettingsBtn) { - injectScripts(); + if (config.showSettingsBtn) { + injectScripts() } - if(config.enableMinimize){ - minimizeCookieBanner(); + if (config.enableMinimize) { + minimizeCookieBanner() } - if(config.enableGoogleConsentMode) { - googleConsentModeHandler(); + if (config.enableGoogleConsentMode) { + googleConsentModeHandler() } } - - - }; + } /** * Check if cookie exists * @param {string} cookieName */ const cookieExists = (cookieName) => { - if(document.cookie.indexOf(cookieName) > -1){ - return true; + if (document.cookie.indexOf(cookieName) > -1) { + return true } - return false; - }; + return false + } /** * Create the cookie and hide the banner @@ -226,45 +346,50 @@ Make your own cookie information popup in minutes. const hideCookieBanner = (value, expiryDays) => { createCookie(COOKIE_CONSENT, value, { expires: daysToUTC(expiryDays), - path: "/", - }); - $("#cookieNoticePro").fadeOut("fast", () => { - $('body').off('click', "#cookieSettings"); - $('body').off('click', "#cookieReject"); - $('body').off('click', "#closeIcon"); - $('body').off('click', "#cookieAccept"); - $(this).remove(); - }); - if(config.enableMinimize) { - minimizeCookieBanner(); + path: '/', + }) + $('#cookieNoticePro').fadeOut('fast', () => { + $('body').off('click', '#cookieSettings') + $('body').off('click', '#cookieReject') + $('body').off('click', '#closeIcon') + $('body').off('click', '#cookieAccept') + $(this).remove() + }) + if (config.enableMinimize) { + minimizeCookieBanner() } - }; + } /** * Minimize the cookie banner and show a minimized icon. */ const minimizeCookieBanner = () => { - $( '#cookie-layer' ).remove(); + $('#cookie-layer').remove() // Remove any existing minimize icon before appending a new one. - $('#cookieMinimizeIcon').remove(); + $('#cookieMinimizeIcon').remove() // Minimize the banner and show an icon instead. - let minimizeIcon = $('
    ' + cookieIcon + '
    '+ config.floatingIconTooltip +'
    '); - $('body').append(minimizeIcon); + let minimizeIcon = $( + '
    ' + + cookieIcon + + '
    ' + + config.floatingIconTooltip + + '
    ' + ) + $('body').append(minimizeIcon) // Define the click behavior for the minimize icon. - $('#cookieMinimizeIcon').on('click', function() { + $('#cookieMinimizeIcon').on('click', function () { if ($(this).hasClass('zoomIn')) { - $(this).removeClass('zoomIn').addClass('zoomOut'); + $(this).removeClass('zoomIn').addClass('zoomOut') setTimeout(() => { - $.fn.cookieNoticePro("open"); // Reopen the cookie notice - }, 200); // Match the timeout to the animation duration + $.fn.cookieNoticePro('open') // Reopen the cookie notice + }, 200) // Match the timeout to the animation duration } else { - $(this).removeClass('zoomOut').addClass('zoomIn'); + $(this).removeClass('zoomOut').addClass('zoomIn') } - }); - }; - + }) + } /** * Set Cookie @@ -272,15 +397,19 @@ Make your own cookie information popup in minutes. * @param {string} value - Cookie Value * @param {string} expiryDays - Expiry Date of cookie */ - const createCookie = (name, value, options={})=> { - document.cookie = `${name}=${value}${ - Object.keys(options) - .reduce((acc, key) => { - return acc + `;${key.replace(/([A-Z])/g, $1 => '-' + $1.toLowerCase())}=${ - options[key]}`; - }, '') - }`; - }; + const createCookie = (name, value, options = {}) => { + document.cookie = `${name}=${value}${Object.keys(options).reduce( + (acc, key) => { + return ( + acc + + `;${key.replace(/([A-Z])/g, ($1) => '-' + $1.toLowerCase())}=${ + options[key] + }` + ) + }, + '' + )}` + } /** * Converts Days Into UTC String @@ -288,10 +417,10 @@ Make your own cookie information popup in minutes. * @return {string} UTC date string */ const daysToUTC = (days) => { - const newDate = new Date(); - newDate.setTime(newDate.getTime() + days * 24 * 60 * 60 * 1000); - return newDate.toUTCString(); - }; + const newDate = new Date() + newDate.setTime(newDate.getTime() + days * 24 * 60 * 60 * 1000) + return newDate.toUTCString() + } /** * Get Cookie By Name @@ -299,131 +428,147 @@ Make your own cookie information popup in minutes. * @return {string(number|Array)} Value of the cookie */ const accessCookie = (name) => { - const cookies = document.cookie.split(";").reduce((acc, cookieString) => { - const [key, value] = cookieString.split("=").map((s) => s.trim()); + const cookies = document.cookie.split(';').reduce((acc, cookieString) => { + const [key, value] = cookieString.split('=').map((s) => s.trim()) if (key && value) { - acc[key] = decodeURIComponent(value); + acc[key] = decodeURIComponent(value) } - return acc; - }, {}); - return name ? cookies[name] || false : cookies; - }; + return acc + }, {}) + return name ? cookies[name] || false : cookies + } /** * Updates Google Consent Mode based on user consent and preferences. */ const googleConsentModeHandler = () => { - if(!config.enableGoogleConsentMode) return; - const consent = JSON.parse(accessCookie(COOKIE_CONSENT)); - const preferences = JSON.parse(accessCookie(COOKIE_CONSENT_PREFS)); - const googleConsentAnalyticsStorage = JSON.parse(accessCookie(GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE)); - const googleConsentAdPrefs = JSON.parse(accessCookie(GOOGLE_CONSENT_MODE_AD_PREFS)); + if (!config.enableGoogleConsentMode) return + const consent = JSON.parse(accessCookie(COOKIE_CONSENT)) + const preferences = JSON.parse(accessCookie(COOKIE_CONSENT_PREFS)) + const googleConsentAnalyticsStorage = JSON.parse( + accessCookie(GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE) + ) + const googleConsentAdPrefs = JSON.parse( + accessCookie(GOOGLE_CONSENT_MODE_AD_PREFS) + ) try { - if(consent === true) { + if (consent === true) { // if analytics is accepted - if(preferences.indexOf("analytics") > -1) { - if(!googleConsentAnalyticsStorage) { - createCookie(GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE, encodeURIComponent(true), { - expires: daysToUTC(365), - path: "/" - }); + if (preferences.indexOf('analytics') > -1) { + if (!googleConsentAnalyticsStorage) { + createCookie( + GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE, + encodeURIComponent(true), + { + expires: daysToUTC(365), + path: '/', + } + ) gtag('consent', 'update', { - 'analytics_storage': 'granted' - }); + analytics_storage: 'granted', + }) } } else { - if(googleConsentAnalyticsStorage === true) { + if (googleConsentAnalyticsStorage === true) { gtag('consent', 'update', { - 'analytics_storage': 'denied' - }); - createCookie(GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE, "", { + analytics_storage: 'denied', + }) + createCookie(GOOGLE_CONSENT_MODE_ANALYTICS_STORAGE, '', { expires: daysToUTC(-365), - path: "/" - }); + path: '/', + }) } } // if marketing or advertising is accepted - if( preferences.indexOf("marketing") > -1) { - if(!googleConsentAdPrefs) { - createCookie(GOOGLE_CONSENT_MODE_AD_PREFS, encodeURIComponent(true), { - expires: daysToUTC(365), - path: "/" - }); + if (preferences.indexOf('marketing') > -1) { + if (!googleConsentAdPrefs) { + createCookie( + GOOGLE_CONSENT_MODE_AD_PREFS, + encodeURIComponent(true), + { + expires: daysToUTC(365), + path: '/', + } + ) gtag('consent', 'update', { - 'ad_storage': 'granted', - 'ad_user_data': 'granted', - 'ad_personalization': 'granted' - }); + ad_storage: 'granted', + ad_user_data: 'granted', + ad_personalization: 'granted', + }) } } else { - if(googleConsentAdPrefs === true) { + if (googleConsentAdPrefs === true) { gtag('consent', 'update', { - 'ad_storage': 'denied', - 'ad_user_data': 'denied', - 'ad_personalization': 'denied' - }); - createCookie(GOOGLE_CONSENT_MODE_AD_PREFS, "", { + ad_storage: 'denied', + ad_user_data: 'denied', + ad_personalization: 'denied', + }) + createCookie(GOOGLE_CONSENT_MODE_AD_PREFS, '', { expires: daysToUTC(-365), - path: "/" - }); + path: '/', + }) } - } } - } catch (error) { - console.warn("CookieNoticePro: Error initializing Google Consent Mode. Ensure gtag.js is correctly installed:", error); + console.warn( + 'CookieNoticePro: Error initializing Google Consent Mode. Ensure gtag.js is correctly installed:', + error + ) } } - const changeRootVariables = () =>{ - $(':root').css('--cookieNoticeProLight', config.themeSettings.lightColor); - $(':root').css('--cookieNoticeProDark', config.themeSettings.darkColor); + const changeRootVariables = () => { + $(':root').css('--cookieNoticeProLight', config.themeSettings.lightColor) + $(':root').css('--cookieNoticeProDark', config.themeSettings.darkColor) } - return window.cookieNoticePro = { - init:()=>{ - $.fn.cookieNoticePro(); + return (window.cookieNoticePro = { + init: () => { + $.fn.cookieNoticePro() }, /** * Reopens the cookie notice banner */ - reinit:()=>{ - $.fn.cookieNoticePro("open"); + reinit: () => { + $.fn.cookieNoticePro('open') }, /** * Returns true if consent is given else false */ - isAccepted: ()=>{ - let consent = accessCookie(COOKIE_CONSENT); - return JSON.parse(consent); + isAccepted: () => { + let consent = accessCookie(COOKIE_CONSENT) + return JSON.parse(consent) }, /** * Returns the value of the cookieConsentPrefs cookie */ - getPreferences: ()=>{ - let preferences = accessCookie(COOKIE_CONSENT_PREFS); - return JSON.parse(preferences); + getPreferences: () => { + let preferences = accessCookie(COOKIE_CONSENT_PREFS) + return JSON.parse(preferences) }, /** * Check if a particular preference is accepted * @param {string} cookieName */ - isPreferenceAccepted: (cookieTypeValue)=>{ - let consent = JSON.parse(accessCookie(COOKIE_CONSENT)); - let preferences = accessCookie(COOKIE_CONSENT_PREFS); - preferences = JSON.parse(preferences); + isPreferenceAccepted: (cookieTypeValue) => { + let consent = JSON.parse(accessCookie(COOKIE_CONSENT)) + let preferences = accessCookie(COOKIE_CONSENT_PREFS) + preferences = JSON.parse(preferences) if (consent === false) { - return false; + return false } - if (preferences === false || preferences.indexOf(cookieTypeValue) === -1) { - return false; + if ( + preferences === false || + preferences.indexOf(cookieTypeValue) === -1 + ) { + return false } - return true; + return true }, - }; -})(jQuery); + }) +})(jQuery) diff --git a/plugins/CookieNoticePro/cookienoticepro.style.css b/plugins/CookieNoticePro/cookienoticepro.style.css index b49962c..d15155e 100644 --- a/plugins/CookieNoticePro/cookienoticepro.style.css +++ b/plugins/CookieNoticePro/cookienoticepro.style.css @@ -106,13 +106,24 @@ Make your own cookie information popup in minutes. font-size: 13px; } +#cookieNoticePro.light button#cookieShowSettings { + background: #ffffff; + background: var(--cookieNoticeProLight); + font-size: 13px; +} + + @media (max-width: 600px) { + #cookieNoticePro.light button#cookieShowSettings { + order: 3; + } + #cookieNoticePro.light button#cookieReject { - order: 1; + order: 2; } #cookieNoticePro.light button#cookieAccept { - order: 2; + order: 1; } } @@ -251,6 +262,7 @@ Make your own cookie information popup in minutes. #cookieNoticePro .btn-wrap button { -webkit-box-flex: 1; -ms-flex-positive: 1; + width: 100%; flex-grow: 1; padding: 0 7px; margin: 0 5px 10px 5px; @@ -282,6 +294,7 @@ Make your own cookie information popup in minutes. } #cookieNoticePro #cookieSettings { + display: none !important; font-size: 12px; font-weight: bold; display: -webkit-box; @@ -346,8 +359,8 @@ Make your own cookie information popup in minutes. } #cookieNoticePro a { - text-decoration: none; - font-size: 14px; + text-decoration: underline; + font-size: 12px; padding-bottom: 2px; border-bottom: 1px dotted rgba(255, 255, 255, 0.75); -webkit-transition: all 0.3s ease-in; diff --git a/templates_user/components/NavMenu.php b/templates_user/components/NavMenu.php index 16a0049..4ac834f 100644 --- a/templates_user/components/NavMenu.php +++ b/templates_user/components/NavMenu.php @@ -1,152 +1,163 @@
    -
    @@ -158,59 +169,45 @@