Loading config/install/eu_cookie_compliance.settings.yml +4 −0 Original line number Diff line number Diff line Loading @@ -73,3 +73,7 @@ cookie_value_disagreed: '0' cookie_value_agreed_show_thank_you: '1' cookie_value_agreed: '2' accessibility_focus: false close_button_action: 'close_banner' reject_button_label: '' reject_button_enabled: false close_button_enabled: false config/schema/eu_cookie_compliance.schema.yml +12 −0 Original line number Diff line number Diff line Loading @@ -229,3 +229,15 @@ eu_cookie_compliance.settings: accessibility_focus: type: boolean label: 'Buttons have red focus outline (for accessibility)' close_button_action: type: string label: 'Close button action' reject_button_label: type: string label: 'Reject button label' reject_button_enabled: type: boolean label: 'Enable "Reject/deny all" button' close_button_enabled: type: boolean label: 'Close button/box enabled' css/eu_cookie_compliance.css +17 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ display: inline-block; text-align: left; width: 100%; position: relative; } .eu-cookie-compliance-buttons { Loading Loading @@ -215,6 +216,22 @@ transform: translate(-50%, -100%) scaleY(-1); } .eu-cookie-compliance-close-button { background: url('../images/close.png'); width: 24px; height: 24px; border-width: 0; font-size: 0px; position: absolute; right: 2px; top: -12px; cursor: pointer; } body:not(.eu-cookie-compliance-popup-open) .eu-cookie-compliance-close-button { display: none; } @media screen and (max-width: 600px) { .eu-cookie-compliance-content { max-width: 95%; Loading eu_cookie_compliance.install +13 −0 Original line number Diff line number Diff line Loading @@ -702,3 +702,16 @@ function eu_cookie_compliance_update_8127() { ->getEditable('eu_cookie_compliance.settings') ->save(); } /** * Add defaults for reject button. */ function eu_cookie_compliance_update_8128() { \Drupal::configFactory() ->getEditable('eu_cookie_compliance.settings') ->set('close_button_enabled', FALSE) ->set('reject_button_enabled', FALSE) ->set('reject_button_label', '') ->set('close_button_action', 'close_banner') ->save(); } eu_cookie_compliance.module +17 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ function eu_cookie_compliance_build_data() { $conditional_olivero_button_primary_classes = $config->get('use_olivero_css') ? ' button button--small button--primary' : ''; $conditional_olivero_button_secondary_classes = $config->get('use_olivero_css') ? ' button button--small' : ''; $tertiary_button_label = ''; $tertiary_button_class = ''; $close_button_enabled = FALSE; switch ($method) { case 'default': $click_confirmation = $config->get('popup_clicking_confirmation'); Loading Loading @@ -419,6 +423,9 @@ function eu_cookie_compliance_build_data() { $primary_button_class = 'agree-button eu-cookie-compliance-default-button' . $conditional_olivero_button_primary_classes; $secondary_button_label = $config->get('withdraw_action_button_label'); $secondary_button_class = 'eu-cookie-withdraw-button visually-hidden' . $conditional_olivero_button_secondary_classes; $tertiary_button_label = $config->get('reject_button_label'); $tertiary_button_class = 'decline-button eu-cookie-compliance-default-button eu-cookie-compliance-reject-button'; $close_button_enabled = ($config->get('close_button_enabled')) ?: FALSE; $privacy_settings_tab_label = ($withdraw_button_on_info_popup || $settings_tab_enabled) ? $config->get('withdraw_tab_button_label') : FALSE; break; Loading Loading @@ -480,6 +487,9 @@ function eu_cookie_compliance_build_data() { '#secondary_button_label' => $secondary_button_label, '#primary_button_class' => $primary_button_class, '#secondary_button_class' => $secondary_button_class, '#tertiary_button_label' => $tertiary_button_label, '#tertiary_button_class' => $tertiary_button_class, '#close_button_enabled' => $close_button_enabled, '#cookie_categories' => $cookie_categories, '#save_preferences_button_label' => $save_preferences_button_label, '#privacy_settings_tab_label' => $privacy_settings_tab_label, Loading @@ -499,6 +509,9 @@ function eu_cookie_compliance_build_data() { '#secondary_button_label' => $secondary_button_label, '#primary_button_class' => $primary_button_class, '#secondary_button_class' => $secondary_button_class, '#tertiary_button_label' => $tertiary_button_label, '#tertiary_button_class' => $tertiary_button_class, '#close_button_enabled' => $close_button_enabled, '#cookie_categories' => $cookie_categories, '#save_preferences_button_label' => $save_preferences_button_label, '#privacy_settings_tab_label' => $privacy_settings_tab_label, Loading Loading @@ -609,6 +622,7 @@ function eu_cookie_compliance_build_data() { 'settings_tab_enabled' => $config->get('settings_tab_enabled'), 'olivero_primary_button_classes' => $conditional_olivero_button_primary_classes, 'olivero_secondary_button_classes' => $conditional_olivero_button_secondary_classes, 'close_button_action' => !empty($config->get('close_button_action')) ? $config->get('close_button_action') : '', ]; return $data; } Loading @@ -628,6 +642,9 @@ function eu_cookie_compliance_theme($existing, $type, $theme, $path) { 'secondary_button_label' => NULL, 'primary_button_class' => NULL, 'secondary_button_class' => NULL, 'tertiary_button_label' => NULL, 'tertiary_button_class' => NULL, 'close_button_enabled' => NULL, 'cookie_categories' => NULL, 'save_preferences_button_label' => NULL, 'privacy_settings_tab_label' => NULL, Loading Loading
config/install/eu_cookie_compliance.settings.yml +4 −0 Original line number Diff line number Diff line Loading @@ -73,3 +73,7 @@ cookie_value_disagreed: '0' cookie_value_agreed_show_thank_you: '1' cookie_value_agreed: '2' accessibility_focus: false close_button_action: 'close_banner' reject_button_label: '' reject_button_enabled: false close_button_enabled: false
config/schema/eu_cookie_compliance.schema.yml +12 −0 Original line number Diff line number Diff line Loading @@ -229,3 +229,15 @@ eu_cookie_compliance.settings: accessibility_focus: type: boolean label: 'Buttons have red focus outline (for accessibility)' close_button_action: type: string label: 'Close button action' reject_button_label: type: string label: 'Reject button label' reject_button_enabled: type: boolean label: 'Enable "Reject/deny all" button' close_button_enabled: type: boolean label: 'Close button/box enabled'
css/eu_cookie_compliance.css +17 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ display: inline-block; text-align: left; width: 100%; position: relative; } .eu-cookie-compliance-buttons { Loading Loading @@ -215,6 +216,22 @@ transform: translate(-50%, -100%) scaleY(-1); } .eu-cookie-compliance-close-button { background: url('../images/close.png'); width: 24px; height: 24px; border-width: 0; font-size: 0px; position: absolute; right: 2px; top: -12px; cursor: pointer; } body:not(.eu-cookie-compliance-popup-open) .eu-cookie-compliance-close-button { display: none; } @media screen and (max-width: 600px) { .eu-cookie-compliance-content { max-width: 95%; Loading
eu_cookie_compliance.install +13 −0 Original line number Diff line number Diff line Loading @@ -702,3 +702,16 @@ function eu_cookie_compliance_update_8127() { ->getEditable('eu_cookie_compliance.settings') ->save(); } /** * Add defaults for reject button. */ function eu_cookie_compliance_update_8128() { \Drupal::configFactory() ->getEditable('eu_cookie_compliance.settings') ->set('close_button_enabled', FALSE) ->set('reject_button_enabled', FALSE) ->set('reject_button_label', '') ->set('close_button_action', 'close_banner') ->save(); }
eu_cookie_compliance.module +17 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ function eu_cookie_compliance_build_data() { $conditional_olivero_button_primary_classes = $config->get('use_olivero_css') ? ' button button--small button--primary' : ''; $conditional_olivero_button_secondary_classes = $config->get('use_olivero_css') ? ' button button--small' : ''; $tertiary_button_label = ''; $tertiary_button_class = ''; $close_button_enabled = FALSE; switch ($method) { case 'default': $click_confirmation = $config->get('popup_clicking_confirmation'); Loading Loading @@ -419,6 +423,9 @@ function eu_cookie_compliance_build_data() { $primary_button_class = 'agree-button eu-cookie-compliance-default-button' . $conditional_olivero_button_primary_classes; $secondary_button_label = $config->get('withdraw_action_button_label'); $secondary_button_class = 'eu-cookie-withdraw-button visually-hidden' . $conditional_olivero_button_secondary_classes; $tertiary_button_label = $config->get('reject_button_label'); $tertiary_button_class = 'decline-button eu-cookie-compliance-default-button eu-cookie-compliance-reject-button'; $close_button_enabled = ($config->get('close_button_enabled')) ?: FALSE; $privacy_settings_tab_label = ($withdraw_button_on_info_popup || $settings_tab_enabled) ? $config->get('withdraw_tab_button_label') : FALSE; break; Loading Loading @@ -480,6 +487,9 @@ function eu_cookie_compliance_build_data() { '#secondary_button_label' => $secondary_button_label, '#primary_button_class' => $primary_button_class, '#secondary_button_class' => $secondary_button_class, '#tertiary_button_label' => $tertiary_button_label, '#tertiary_button_class' => $tertiary_button_class, '#close_button_enabled' => $close_button_enabled, '#cookie_categories' => $cookie_categories, '#save_preferences_button_label' => $save_preferences_button_label, '#privacy_settings_tab_label' => $privacy_settings_tab_label, Loading @@ -499,6 +509,9 @@ function eu_cookie_compliance_build_data() { '#secondary_button_label' => $secondary_button_label, '#primary_button_class' => $primary_button_class, '#secondary_button_class' => $secondary_button_class, '#tertiary_button_label' => $tertiary_button_label, '#tertiary_button_class' => $tertiary_button_class, '#close_button_enabled' => $close_button_enabled, '#cookie_categories' => $cookie_categories, '#save_preferences_button_label' => $save_preferences_button_label, '#privacy_settings_tab_label' => $privacy_settings_tab_label, Loading Loading @@ -609,6 +622,7 @@ function eu_cookie_compliance_build_data() { 'settings_tab_enabled' => $config->get('settings_tab_enabled'), 'olivero_primary_button_classes' => $conditional_olivero_button_primary_classes, 'olivero_secondary_button_classes' => $conditional_olivero_button_secondary_classes, 'close_button_action' => !empty($config->get('close_button_action')) ? $config->get('close_button_action') : '', ]; return $data; } Loading @@ -628,6 +642,9 @@ function eu_cookie_compliance_theme($existing, $type, $theme, $path) { 'secondary_button_label' => NULL, 'primary_button_class' => NULL, 'secondary_button_class' => NULL, 'tertiary_button_label' => NULL, 'tertiary_button_class' => NULL, 'close_button_enabled' => NULL, 'cookie_categories' => NULL, 'save_preferences_button_label' => NULL, 'privacy_settings_tab_label' => NULL, Loading