Commit 6e89ec5b authored by Georgi Mateev's avatar Georgi Mateev
Browse files

[TASK] Add a reject button to the external content consent

parent f8700a88
......@@ -809,6 +809,7 @@ class StaticFileGenerationService implements SingletonInterface {
'cookie_lifetime_text' => $translatedData['cookie_lifetime_text'],
'iframe_button_allow_all_text' => $translatedData['iframe_button_allow_all_text'],
'iframe_button_allow_one_text' => $translatedData['iframe_button_allow_one_text'],
'iframe_button_reject_text' => $translatedData['iframe_button_reject_text'],
'iframe_button_load_one_text' => $translatedData['iframe_button_load_one_text'],
'iframe_open_settings_text' => $translatedData['iframe_open_settings_text'],
'iframe_button_load_one_description' => $translatedData['iframe_button_load_one_description'],
......
......@@ -36,7 +36,7 @@ $configuration = [
essential_title, essential_description, extend_box_link_text, extend_box_link_text_close,
extend_table_link_text, extend_table_link_text_close, cookie_name_text, cookie_provider_text,
cookie_purpose_text, cookie_lifetime_text, iframe_title, iframe_description, iframe_cookies, iframe_button_allow_all_text,
iframe_button_allow_one_text, iframe_button_load_one_description, iframe_button_load_one_text, iframe_open_settings_text, iframe_whitelist_regex, template_html,
iframe_button_allow_one_text, iframe_button_reject_text, iframe_button_load_one_description, iframe_button_load_one_text, iframe_open_settings_text, iframe_whitelist_regex, template_html,
banner_html, banner_button_accept_text, banner_button_settings_text, banner_description,
save_confirmation_text',
'delete' => 'deleted',
......@@ -125,7 +125,7 @@ $configuration = [
],
'iframe_texts' => [
'label' => 'LLL:EXT:sg_cookie_optin/Resources/Private/Language/locallang_db.xlf:tx_sgcookieoptin_domain_model_optin.iframe_texts',
'showitem' => 'iframe_button_allow_all_text, iframe_button_allow_one_text, --linebreak--,
'showitem' => 'iframe_button_allow_all_text, iframe_button_allow_one_text, iframe_button_reject_text, --linebreak--,
iframe_button_load_one_text, iframe_open_settings_text, --linebreak--,
iframe_button_load_one_description'
],
......@@ -854,6 +854,17 @@ $configuration = [
'eval' => 'trim, required'
],
],
'iframe_button_reject_text' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_cookie_optin/Resources/Private/Language/locallang_db.xlf:tx_sgcookieoptin_domain_model_optin.iframe_button_reject_text',
'config' => [
'type' => 'input',
'size' => 30,
'default' => 'Nicht erlauben',
'placeholder' => 'Nicht erlauben',
'eval' => 'trim, required'
],
],
'iframe_button_load_one_description' => [
'exclude' => TRUE,
'label' => 'LLL:EXT:sg_cookie_optin/Resources/Private/Language/locallang_db.xlf:tx_sgcookieoptin_domain_model_optin.iframe_button_load_one_description',
......@@ -1600,7 +1611,7 @@ if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo
. 'color_table_header_text, color_Table_data_text, color_button_close, color_button_close_hover,'
. 'color_button_close_text, cookie_name_text, cookie_provider_text, cookie_purpose_text, cookie_lifetime_text,'
. 'iframe_enabled, iframe_title, iframe_description, iframe_cookies, iframe_button_allow_all_text,'
. 'iframe_button_allow_one_text, iframe_button_load_one_description, iframe_button_load_one_text, iframe_open_settings_text,'
. 'iframe_button_allow_one_text, iframe_button_reject_text, iframe_button_load_one_description, iframe_button_load_one_text, iframe_open_settings_text,'
. 'iframe_color_consent_box_background, iframe_color_button_load_one, iframe_color_button_load_one_hover,'
. 'iframe_color_button_load_one_text, iframe_color_open_settings, iframe_html, iframe_overwritten,'
. 'iframe_selection, iframe_replacement_html, iframe_replacement_overwritten, iframe_replacement_selection,'
......
......@@ -13,14 +13,6 @@
<source><![CDATA[No parameters sent to the server.]]></source>
<target><![CDATA[Es werden keine Parameter an den Server gesendet.]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.render_assets_inline" approved="yes">
<source><![CDATA[Render CSS and JavaScript contents inline (may impact the performance negatively)]]></source>
<target><![CDATA[CSS- und JavaScript-Inhalte inline rendern (kann sich negativ auf die Performance auswirken)]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.consider_do_not_track">
<source><![CDATA[Take DoNotTrack into account]]></source>
<target><![CDATA[DoNotTrack berücksichtigen]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_cookie" approved="yes">
<source><![CDATA[Cookie]]></source>
<target><![CDATA[Cookie]]></target>
......@@ -333,6 +325,10 @@
<source><![CDATA[Cookie Description Tables]]></source>
<target><![CDATA[Cookie-Beschreibungstabellen]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.consider_do_not_track" approved="yes">
<source><![CDATA[Take DoNotTrack into account]]></source>
<target><![CDATA[DoNotTrack berücksichtigen]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.cookie_lifetime" approved="yes">
<source><![CDATA[Lifetime of cookie that saves the user's choices in days]]></source>
<target><![CDATA[Laufzeit des Cookies, der die Auswahl des Nutzers speichert (in Tagen)]]></target>
......@@ -433,6 +429,10 @@
<source><![CDATA[Button: "Load external content"]]></source>
<target><![CDATA[Button: "Externen Inhalt laden"]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.iframe_button_reject_text" approved="yes">
<source><![CDATA[Button: "Don't allow"]]></source>
<target><![CDATA[Button: "Nicht erlauben"]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.iframe_color_button_load_one" approved="yes">
<source><![CDATA[Button: "Load external content"]]></source>
<target><![CDATA[Button: "Externen Inhalt laden"]]></target>
......@@ -585,6 +585,10 @@
<source><![CDATA[Version control]]></source>
<target><![CDATA[Versionskontrolle]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.render_assets_inline" approved="yes">
<source><![CDATA[Render CSS and JavaScript contents inline (may impact the performance negatively)]]></source>
<target><![CDATA[CSS- und JavaScript-Inhalte inline rendern (kann sich negativ auf die Performance auswirken)]]></target>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.save_confirmation_text" approved="yes">
<source><![CDATA[Text for notification shown when cookie preferences are set]]></source>
<target><![CDATA[Text für die Benachrichtigung, der angezeigt wird, wenn Cookie-Einstellungen gespeichert werden]]></target>
......
......@@ -12,12 +12,6 @@
<trans-unit id="backend.searchError.noParametersSentToTheServer">
<source><![CDATA[No parameters sent to the server.]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.render_assets_inline">
<source><![CDATA[Render CSS and JavaScript contents inline (may impact the performance negatively)]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.consider_do_not_track">
<source><![CDATA[Take DoNotTrack into account]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_cookie">
<source><![CDATA[Cookie]]></source>
</trans-unit>
......@@ -252,6 +246,9 @@
<trans-unit id="tx_sgcookieoptin_domain_model_optin.colors_tables">
<source><![CDATA[Cookie Description Tables]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.consider_do_not_track">
<source><![CDATA[Take DoNotTrack into account]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.cookie_lifetime">
<source><![CDATA[Lifetime of cookie that saves the user's choices in days]]></source>
</trans-unit>
......@@ -327,6 +324,9 @@
<trans-unit id="tx_sgcookieoptin_domain_model_optin.iframe_button_load_one_text">
<source><![CDATA[Button: "Load external content"]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.iframe_button_reject_text">
<source><![CDATA[Button: "Don't allow"]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.iframe_color_button_load_one">
<source><![CDATA[Button: "Load external content"]]></source>
</trans-unit>
......@@ -441,6 +441,9 @@
<trans-unit id="tx_sgcookieoptin_domain_model_optin.palette.update_version">
<source><![CDATA[Version control]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.render_assets_inline">
<source><![CDATA[Render CSS and JavaScript contents inline (may impact the performance negatively)]]></source>
</trans-unit>
<trans-unit id="tx_sgcookieoptin_domain_model_optin.save_confirmation_text">
<source><![CDATA[Text for notification shown when cookie preferences are set]]></source>
</trans-unit>
......
......@@ -7,15 +7,16 @@
<p class="sg-cookie-optin-box-description">{{{iFrameGroup.description}}}</p>
<div class="sg-cookie-optin-box-button">
<button class="sg-cookie-optin-box-button-accept-all">{{{textEntries.iframe_button_allow_all_text}}}</button>
<button class="sg-cookie-optin-box-button-accept-specific">{{{textEntries.iframe_button_allow_one_text}}}</button>
<button tabindex="1" class="sg-cookie-optin-box-button-accept-all">{{{textEntries.iframe_button_allow_all_text}}}</button>
<button tabindex="1" class="sg-cookie-optin-box-button-accept-specific">{{{textEntries.iframe_button_allow_one_text}}}</button>
<button tabindex="1" class="sg-cookie-optin-box-button-iframe-reject">{{{textEntries.iframe_button_reject_text}}}</button>
</div>
<p class="sg-cookie-optin-box-flash-message"></p>
<div class="sg-cookie-optin-box-footer">
<div class="sg-cookie-optin-box-copyright">
<a class="sg-cookie-optin-box-copyright-link{{#settings.disable_powered_by}} sg-cookie-optin-box-copyright-link-hidden{{/settings.disable_powered_by}}"
<a tabindex="1" class="sg-cookie-optin-box-copyright-link{{#settings.disable_powered_by}} sg-cookie-optin-box-copyright-link-hidden{{/settings.disable_powered_by}}"
href="https://www.sgalinski.de/typo3-produkte-webentwicklung/sgalinski-cookie-optin/"
target="_blank">
Powered by<br>sgalinski Cookie Opt In
......@@ -27,7 +28,7 @@
{{#index}}
<span class="sg-cookie-optin-box-footer-divider"> | </span>
{{/index}}
<a class="sg-cookie-optin-box-footer-link" href="{{url}}" target="_blank">{{{name}}}</a>
<a tabindex="1" class="sg-cookie-optin-box-footer-link" href="{{url}}" target="_blank">{{{name}}}</a>
{{/footerLinks}}
</div>
</div>
......
......@@ -1336,6 +1336,12 @@ var SgCookieOptin = {
document.body.insertAdjacentElement('beforeend', wrapper);
// focus the first button for better accessability
var buttons = document.getElementsByClassName('sg-cookie-optin-box-button-accept-all');
if (buttons.length > 0) {
buttons[0].focus();
}
// Emit event
var externalContentConsentDisplayedEvent = new CustomEvent('externalContentConsentDisplayed', {
bubbles: true,
......@@ -1355,6 +1361,9 @@ var SgCookieOptin = {
var closeButtons = element.querySelectorAll('.sg-cookie-optin-box-close-button');
SgCookieOptin.addEventListenerToList(closeButtons, 'click', SgCookieOptin.hideCookieOptIn);
var rejectButtons = element.querySelectorAll('.sg-cookie-optin-box-button-iframe-reject');
SgCookieOptin.addEventListenerToList(rejectButtons, 'click', SgCookieOptin.hideCookieOptIn);
var acceptAllButtons = element.querySelectorAll('.sg-cookie-optin-box-button-accept-all');
SgCookieOptin.addEventListenerToList(acceptAllButtons, 'click', function() {
SgCookieOptin.acceptAllExternalContents();
......
......@@ -153,6 +153,7 @@
/* Buttons */
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-accept-all,
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-accept-specific,
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-iframe-reject,
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-accept-essential,
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-banner-content .sg-cookie-optin-banner-button-settings,
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-banner-content .sg-cookie-optin-banner-button-accept {
......@@ -172,7 +173,8 @@
border-radius: 5px;
}
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-accept-specific {
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-accept-specific,
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-iframe-reject {
color: ###color_button_specific_text###;
background-color: ###color_button_specific###;
}
......@@ -196,7 +198,8 @@
background-color: ###color_button_all_hover###;
}
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-accept-specific:hover {
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-accept-specific:hover,
#SgCookieOptin .sg-cookie-optin-box .sg-cookie-optin-box-button .sg-cookie-optin-box-button-iframe-reject:hover {
background-color: ###color_button_specific_hover###;
}
......
......@@ -114,6 +114,7 @@ CREATE TABLE tx_sgcookieoptin_domain_model_optin (
iframe_button_allow_all_text varchar(255) DEFAULT 'Alle externen Inhalte erlauben' NOT NULL,
iframe_button_allow_one_text varchar(255) DEFAULT 'Einmalig erlauben' NOT NULL,
iframe_button_reject_text varchar(255) DEFAULT 'Nicht erlauben' NOT NULL,
iframe_button_load_one_text varchar(255) DEFAULT 'Externen Inhalt laden' NOT NULL,
iframe_open_settings_text varchar(255) DEFAULT 'Einstellungen anzeigen' NOT NULL,
iframe_button_load_one_description text NOT NULL,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment