ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,103 @@
<?xml version="1.0"?>
<!--
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2021 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Plumrocket_CookieConsent::css/cookie-consent.css"/>
</head>
<body>
<referenceBlock name="head.additional">
<block class="Plumrocket\CookieConsent\Block\Html\HeadScripts" name="pr.cookie.cookie_service" template="Plumrocket_CookieConsent::cookie_service.phtml" ifconfig="pr_cookie/general/enabled" before="-">
<arguments>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
</arguments>
</block>
<block class="Plumrocket\CookieConsent\Block\Gtm" name="google_tag_manager" as="google_tag_manager" template="Plumrocket_CookieConsent::gtm.phtml" ifconfig="pr_cookie/general/enabled" before="-">
<arguments>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
</arguments>
</block>
<block class="Plumrocket\CookieConsent\Block\Html\HeadScripts" name="pr.adobe_commerce.data_collection.head_script" template="Plumrocket_CookieConsent::integration/adobe_commerce/data_collection_head_script.phtml" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
<argument name="dataCollectionViewModel" xsi:type="object">Plumrocket\CookieConsent\ViewModel\Integration\AdobeCommerce\DataCollection</argument>
</arguments>
</block>
</referenceBlock>
<referenceContainer name="after.body.start">
<block class="Plumrocket\CookieConsent\Block\RestrictionConfig" name="pr.cookie.restriction.config" before="-" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="template" xsi:type="string">Plumrocket_CookieConsent::restriction_config.phtml</argument>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
</arguments>
</block>
<block name="pr.adobe_commerce.data_collection" template="Plumrocket_CookieConsent::integration/adobe_commerce/data_collection.phtml" after="pr.cookie.restriction.config" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
<argument name="dataCollectionViewModel" xsi:type="object">Plumrocket\CookieConsent\ViewModel\Integration\AdobeCommerce\DataCollection</argument>
</arguments>
</block>
<block class="Plumrocket\CookieConsent\Block\Html\BodyScripts" name="pr_cookie_absolute_header" after="pr.cookie.restriction.config" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="template" xsi:type="string">Plumrocket_CookieConsent::html/absolute_header.phtml</argument>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
</arguments>
</block>
<block class="Plumrocket\CookieConsent\Block\CookieNotice" name="pr_cookie_notice" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="template" xsi:type="string">Plumrocket_CookieConsent::notice.phtml</argument>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="pr-cookie-notice" xsi:type="array">
<item name="component" xsi:type="string">Plumrocket_CookieConsent/js/view/notice</item>
<item name="template" xsi:type="string">Plumrocket_CookieConsent/notice/default</item>
</item>
</item>
</argument>
</arguments>
</block>
<block class="Plumrocket\CookieConsent\Block\Settings" name="pr-cookie-settings" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="template" xsi:type="string">Plumrocket_CookieConsent::settings.phtml</argument>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="pr-cookie-settings-bar" xsi:type="array">
<item name="component" xsi:type="string">Plumrocket_CookieConsent/js/view/settings</item>
<item name="template" xsi:type="helper" helper="Plumrocket\CookieConsent\Helper\Config\SettingsBar::getJsComponentTemplate"/>
</item>
</item>
</argument>
</arguments>
</block>
</referenceContainer>
<referenceContainer name="before.body.end">
<block name="pr.youtube.no.cookie" template="Plumrocket_CookieConsent::youtube.phtml" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="viewModel" xsi:type="object">Plumrocket\CookieConsent\ViewModel\Integration\NoCookieYoutube</argument>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
</arguments>
</block>
<block class="Plumrocket\CookieConsent\Block\Html\BodyScripts" name="pr_cookie_absolute_footer" after="absolute_footer" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="template" xsi:type="string">Plumrocket_CookieConsent::html/absolute_footer.phtml</argument>
<argument name="cspNonceViewModel" xsi:type="object">Plumrocket\Base\ViewModel\CspNonce</argument>
</arguments>
</block>
</referenceContainer>
<referenceBlock name="footer_links">
<block name="pr-cookie-settings-link" class="Plumrocket\CookieConsent\Block\Html\CookieSettingsLink" ifconfig="pr_cookie/settings_link/show_footer_link">
<arguments>
<argument name="label" xsi:type="string" translate="true">Cookie Settings</argument>
<argument name="path" xsi:type="string">#</argument>
<argument name="class" xsi:type="string">pr-open-cookie-settings</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<!--
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2021 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="data_privacy_nav_links">
<block name="pr_cookie_settings_link" template="Plumrocket_CookieConsent::account/navigation/cookie_settings.phtml" ifconfig="pr_cookie/general/enabled">
<arguments>
<argument name="label" xsi:type="string" translate="true">Cookie Settings</argument>
<argument name="description" xsi:type="string" translate="true">Update your cookie consent preferences and choose to allow or block certain cookie types. Click on cookie category headings to change your settings.</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,7 @@
var config = {
map: {
'*': {
prCookieBodyScripts: 'Plumrocket_CookieConsent/js/model/body-scripts',
}
}
};
@@ -0,0 +1,27 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2021 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
/** @var \Magento\Framework\View\Element\Template $block */
?>
<li class="prgdpr__item">
<a class="prgdpr__link pr-open-cookie-settings" href="#">
<svg class="prgdpr__icon" id="icons" xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 100 100"><defs><style>.cls-1{fill:#2a5082;}.cls-2{fill:#a3d4ff;}.cls-3{fill:#fff;}</style></defs><path class="cls-1" d="M53,80H10.07A7.48,7.48,0,0,1,2.6,72.53V21.74a7.48,7.48,0,0,1,7.47-7.47H77.29a7.48,7.48,0,0,1,7.47,7.47V46.2h-3V21.74a4.49,4.49,0,0,0-4.49-4.49H10.07a4.49,4.49,0,0,0-4.48,4.49V72.53A4.49,4.49,0,0,0,10.07,77H53Z"/><rect class="cls-1" x="4.09" y="26.4" width="79.18" height="2.99"/><rect class="cls-1" x="49.57" y="20.62" width="28.01" height="2.99"/><rect class="cls-1" x="49.57" y="42.26" width="28.01" height="2.99"/><rect class="cls-1" x="49.57" y="35.53" width="21.76" height="2.99"/><rect class="cls-1" x="11" y="20.62" width="3.55" height="2.99"/><rect class="cls-1" x="19.03" y="20.62" width="3.55" height="2.99"/><rect class="cls-1" x="27.06" y="20.62" width="3.55" height="2.99"/><path class="cls-1" d="M49.57,49v3H63.75a23.57,23.57,0,0,1,5.66-3Z"/><path class="cls-1" d="M49.57,55.72v3h7.85a23.32,23.32,0,0,1,2.21-3Z"/><path class="cls-1" d="M49.57,62.45v3h5a23.66,23.66,0,0,1,1-3Z"/><path class="cls-2" d="M96.26,74.19V66.71h-5a10.05,10.05,0,0,0-1.36-3.34l3.53-3.55-5.28-5.29-3.53,3.52a14.07,14.07,0,0,0-3.3-1.36V51.77H73.85v4.92a13.66,13.66,0,0,0-3.3,1.36L67,54.52,61.74,59.8l3.53,3.57a10.27,10.27,0,0,0-1.37,3.34h-5v7.48h5a9.65,9.65,0,0,0,1.37,3.25L61.74,81,67,86.22l3.53-3.53a14.07,14.07,0,0,0,3.3,1.36v5.08h7.47V84.05a14.1,14.1,0,0,0,3.3-1.37l3.53,3.53,5.28-5.28L89.9,77.44a9.45,9.45,0,0,0,1.36-3.25Z"/><path class="cls-1" d="M82.81,90.62H72.35V85.15a15.66,15.66,0,0,1-1.52-.63L67,88.34,59.62,81l3.79-3.77a8.77,8.77,0,0,1-.65-1.5H57.41V65.22h5.35a10.45,10.45,0,0,1,.66-1.59L59.63,59.8,67,52.41l3.81,3.81a13.5,13.5,0,0,1,1.52-.63V50.28H82.81v5.31a14.48,14.48,0,0,1,1.53.63l3.81-3.8,7.39,7.4-3.79,3.81a9.89,9.89,0,0,1,.66,1.59h5.34V75.68H92.41a8.77,8.77,0,0,1-.65,1.5l3.79,3.75-7.4,7.4-3.81-3.81q-.75.35-1.53.63Zm-7.47-3h4.49V82.91l1.1-.3a13.19,13.19,0,0,0,2.95-1.22l1-.57,3.28,3.28,3.16-3.16L88,77.7l.67-1.19a7.74,7.74,0,0,0,1.09-2.63l.26-1.19h4.71V68.21H90.06L89.8,67a8.5,8.5,0,0,0-1.2-2.91l-.56-1,3.28-3.31-3.17-3.18-3.28,3.28-1-.57a13,13,0,0,0-2.95-1.22l-1.1-.3V53.27H75.34v4.56l-1.1.3a12.32,12.32,0,0,0-2.95,1.22l-1,.56L67,56.63l-3.18,3.18,3.29,3.32-.57,1A8.66,8.66,0,0,0,65.37,67l-.26,1.18H60.4v4.48h4.71l.26,1.19a7.8,7.8,0,0,0,1.09,2.64l.67,1.18L63.85,81,67,84.11l3.28-3.29,1,.57a12.82,12.82,0,0,0,2.95,1.22l1.1.3Z"/><circle class="cls-3" cx="77.58" cy="70.45" r="5.23"/><path class="cls-1" d="M77.58,77.17a6.72,6.72,0,1,1,6.73-6.72A6.73,6.73,0,0,1,77.58,77.17Zm0-10.45a3.74,3.74,0,1,0,3.74,3.73A3.73,3.73,0,0,0,77.58,66.72Z"/><path class="cls-1" d="M27.06,68.69a16.72,16.72,0,0,1,0-33.43,1.49,1.49,0,0,1,1.26,2.31c-1,1.48-.85,1.92-.85,1.93h0a.85.85,0,0,0,.27.19,3.54,3.54,0,0,0,1.2.21,3.67,3.67,0,0,1,2.85,1.17,4.63,4.63,0,0,1,.53,3.59c0,.13,0,.25,0,.34l.62-.07a8,8,0,0,1,4.32.3c2,.82,2.54,2.82,2.92,4.28a5.56,5.56,0,0,0,.5,1.46,4.37,4.37,0,0,0,1-.35A1.5,1.5,0,0,1,43.78,52,16.74,16.74,0,0,1,27.06,68.69ZM24.6,38.47A13.73,13.73,0,1,0,40.66,53.93a2.94,2.94,0,0,1-1.33-.27c-1.38-.65-1.76-2.11-2.09-3.4s-.57-2-1.16-2.27a5.41,5.41,0,0,0-2.8-.1c-1.12.15-2.39.32-3.3-.62a3.51,3.51,0,0,1-.61-3.09A3.6,3.6,0,0,0,29.43,43a6.58,6.58,0,0,0-.72-.08,5.76,5.76,0,0,1-2.32-.53,3.31,3.31,0,0,1-1.81-2.08A3.66,3.66,0,0,1,24.6,38.47Z"/><circle class="cls-1" cx="29.9" cy="58.62" r="2.83"/><circle class="cls-1" cx="19.52" cy="54.18" r="1.79"/><circle class="cls-1" cx="23.11" cy="45.5" r="1.79"/></svg>
<b class="prgdpr__name"><?= $block->escapeHtml($block->getData('label')) ?></b>
<p class="prgdpr__text"><?= $block->escapeHtml($block->getData('description')) ?></p>
</a>
</li>
@@ -0,0 +1,124 @@
<?php
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
?>
<?php
/** @var \Plumrocket\CookieConsent\Block\RestrictionConfig $block */
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
?>
<script <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
var prCookieService = {
defaultAttributes: {path: '/'},
converter: {
write: function (value) {
return encodeURIComponent(value);
},
read: function (value) {
return decodeURIComponent(value)
}
},
decode: function(string)
{
return string.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
},
set: function (key, value, attributes)
{
if (typeof document === 'undefined') {
return;
}
attributes = Object.assign(this.defaultAttributes, attributes);
if (typeof attributes.expires === 'number') {
attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
}
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
try {
var result = JSON.stringify(value);
if (/^[\{\[]/.test(result)) {
value = result;
}
} catch (e) {}
value = this.converter.write(value);
key = this.converter.write(String(key))
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
.replace(/[\(\)]/g, escape);
var stringifiedAttributes = '';
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue;
}
stringifiedAttributes += '; ' + attributeName;
if (attributes[attributeName] === true) {
continue;
}
// Considers RFC 6265 section 5.2:
// ...
// 3. If the remaining unparsed-attributes contains a %x3B (";")
// character:
// Consume the characters of the unparsed-attributes up to,
// not including, the first %x3B (";") character.
// ...
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
}
return (document.cookie = key + '=' + value + stringifiedAttributes);
},
remove: function (key, attributes) {
this.set(key, '', {...attributes, ...{
expires: -1
}});
},
get: function (key, json = false)
{
if (typeof document === 'undefined') {
return;
}
var jar = {};
var cookies = document.cookie ? document.cookie.split('; ') : [];
var i = 0;
for (; i < cookies.length; i++) {
var parts = cookies[i].split('=');
var cookie = parts.slice(1).join('=');
if (!json && cookie.charAt(0) === '"') {
cookie = cookie.slice(1, -1);
}
try {
var name = this.converter.write(parts[0]);
cookie = this.converter.read(cookie);
if (json) {
try {
cookie = JSON.parse(cookie);
} catch (e) {}
}
jar[name] = cookie;
if (key === name) {
break;
}
} catch (e) {}
}
return key ? jar[key] : jar;
}
}
</script>
@@ -0,0 +1,57 @@
<?php
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
?>
<?php
/** @var \Plumrocket\CookieConsent\Block\Gtm $block */
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
?>
<!-- Google Tag Manager -->
<script type="text/javascript" <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
(function (config) {
function runGtm(config)
{
(function (w,d,s,l,i) {
w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'<?= $block->escapeJs($block->getGtmServerBaseUrl()) ?>/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer',config.containerId);
}
if (! config.consentMode) {
document.addEventListener('pr-cookie-consent-api:configured', () => {
prCookieConsentApi.isAllowedCategory(config.categoryKey) && runGtm(config);
});
return;
}
window.dataLayer = window.dataLayer || [];
function gtag() {dataLayer.push(arguments);}
gtag('consent', 'default', config.defaultConsentTypes);
runGtm(config);
document.addEventListener('pr-cookie-consent-api:configured', () => {
const updateGtmConsents = () => {
let updatedConsentTypes = { ...config.defaultConsentTypes };
for (const [key, categoryKey] of Object.entries(config.consentTypesCategories)) {
updatedConsentTypes[key] = prCookieConsentApi.isAllowedCategory(categoryKey) ? 'granted' : 'denied'
}
gtag('consent', 'update', updatedConsentTypes);
}
updateGtmConsents();
prCookieConsentApi.consent.addCallback(updateGtmConsents);
});
})(<?= /* @noEscape */ $block->getJsonConfig() ?>);
</script>
<!-- End Google Tag Manager -->
@@ -0,0 +1,52 @@
<?php
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
?>
<?php
/** @var \Plumrocket\CookieConsent\Block\Html\BodyScripts $block */
$essentialCategoriesWithScripts = $block->getEssentialCategoriesWithScripts();
$optionalCategoriesWithScripts = $block->getOptionalCategoriesWithScripts();
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
?>
<?php foreach ($essentialCategoriesWithScripts as $category): ?>
<?= /* @noEscape */ $category->getFooterMiscellaneousHtml() ?>
<?php endforeach; ?>
<?php if ($optionalCategoriesWithScripts): ?>
<?php foreach ($optionalCategoriesWithScripts as $category): ?>
<div id="pr-cookie-absolute-footer-<?= $block->escapeHtmlAttr($category->getKey()) ?>"></div>
<?php endforeach; ?>
<script <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
requirejs(['prCookieConsentApi', 'prCookieBodyScripts'], function (prCookieConsentApi, prCookieBodyScripts) {
'use strict';
var container;
<?php foreach ($optionalCategoriesWithScripts as $category): ?>
container = document.getElementById(
'pr-cookie-absolute-footer-' + '<?= $block->escapeJs($category->getKey()) ?>'
);
if (container && prCookieConsentApi.isAllowedCategory('<?= $block->escapeJs($category->getKey()) ?>')) {
container.innerHTML = '<?= $block->prepareHtml($category->getFooterMiscellaneousHtml()) ?>';
prCookieBodyScripts.execute(container, 'pr-cookie-footer-script');
}
<?php endforeach; ?>
});
</script>
<?php endif; ?>
<?php /** Activate all scripts like <script type="pr_cookie_category/..."> */ ?>
<script id="pr_cookie_consent_on_load_activate" <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
requirejs(['prCookieBodyScripts', 'domReady!'], function (bodyScripts) {
'use strict';
var scripts = document.querySelectorAll('script[type^="pr_cookie_category"]');
[].forEach.call(scripts, function (notActiveScript) {
bodyScripts.activatePrCookieCategoryScript(notActiveScript);
});
});
</script>
@@ -0,0 +1,51 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
?>
<?php
/** @var \Plumrocket\CookieConsent\Block\Html\BodyScripts $block */
$essentialCategoriesWithScripts = $block->getEssentialCategoriesWithScripts();
$optionalCategoriesWithScripts = $block->getOptionalCategoriesWithScripts();
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
?>
<?php foreach ($essentialCategoriesWithScripts as $category): ?>
<?= /* @noEscape */ $category->getHeadScripts() ?>
<?php endforeach; ?>
<?php if ($optionalCategoriesWithScripts): ?>
<?php foreach ($optionalCategoriesWithScripts as $category): ?>
<div id="pr-cookie-absolute-header-<?= $block->escapeHtmlAttr($category->getKey()) ?>"></div>
<?php endforeach; ?>
<script <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
requirejs(['prCookieConsentApi', 'prCookieBodyScripts'], function (prCookieConsentApi, prCookieBodyScripts) {
'use strict';
var container;
<?php foreach ($optionalCategoriesWithScripts as $category): ?>
container = document.getElementById(
'pr-cookie-absolute-header-' + '<?= $block->escapeJs($category->getKey()) ?>'
);
if (container && prCookieConsentApi.isAllowedCategory('<?= $block->escapeJs($category->getKey()) ?>')) {
container.innerHTML = '<?= $block->prepareHtml($category->getHeadScripts()) ?>';
prCookieBodyScripts.execute(container, 'pr-cookie-header-script');
}
<?php endforeach; ?>
});
</script>
<?php endif; ?>
@@ -0,0 +1,53 @@
<?php
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2025 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
?>
<?php
/** @var \Magento\Framework\View\Element\Template $block */
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
/** @var \Plumrocket\CookieConsent\ViewModel\Integration\AdobeCommerce\DataCollection $dataCollectionViewModel */
$dataCollectionViewModel = $block->getData('dataCollectionViewModel');
?>
<?php if ($dataCollectionViewModel->isEnabled()): ?>
<script type="text/javascript" <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
(() => {
document.addEventListener('pr-cookie-consent-api:cookie-blocking:validation', (event) => {
if ('mg_dnt' !== event.detail.cookieName) {
return;
}
setTimeout(() => {
const categoryKey = '<?= $block->escapeJs($dataCollectionViewModel->getAssociatedCategoryKey()) ?>';
let cookieValue = (event.detail.cookie.match(/^[^=]+=(.*?)(?:$|;)/) || [])[1]?.trim();
if (prCookieConsentApi.isAllowedCategory(categoryKey) && cookieValue.length) {
prCookieService.remove('mg_dnt', prCookieConsentApi.config.cookie);
return;
}
if (! prCookieConsentApi.isAllowedCategory(categoryKey) && ! cookieValue.length) {
prCookieService.set('mg_dnt', true, { ...prCookieConsentApi.config.cookie, expires: null });
}
}, 100);
});
let handleCookieConsent = () => {
const categoryKey = '<?= $block->escapeJs($dataCollectionViewModel->getAssociatedCategoryKey()) ?>';
if (prCookieConsentApi.isAllowedCategory(categoryKey)) {
prCookieService.remove('mg_dnt', prCookieConsentApi.config.cookie);
} else {
prCookieService.set('mg_dnt', true, { ...prCookieConsentApi.config.cookie, expires: null });
}
};
prCookieConsentApi.consent.addCallback(handleCookieConsent);
handleCookieConsent();
})();
</script>
<?php endif; ?>
@@ -0,0 +1,47 @@
<?php
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2025 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
?>
<?php
/** @var \Plumrocket\CookieConsent\Block\Html\HeadScripts $block */
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
/** @var \Plumrocket\CookieConsent\ViewModel\Integration\AdobeCommerce\DataCollection $dataCollectionViewModel */
$dataCollectionViewModel = $block->getData('dataCollectionViewModel');
?>
<?php if ($dataCollectionViewModel->isEnabled()): ?>
<script type="text/javascript" <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
(() => {
let userAllowedCookies = prCookieService.get('user_allowed_save_cookie');
if (! userAllowedCookies) {
return;
}
let customerConsent = prCookieService.get('pr-cookie-consent');
if (! customerConsent) {
return;
}
try {
customerConsent = JSON.parse(customerConsent);
} catch (error) {
return;
}
const categoryKey = '<?= $block->escapeJs($dataCollectionViewModel->getAssociatedCategoryKey()) ?>';
if (customerConsent.includes('all') || customerConsent.includes(categoryKey)) {
return;
}
let intervalId = setInterval(prCookieService.set.bind(prCookieService, 'mg_dnt', true, {expires: null}), 500);
document.addEventListener('pr-cookie-consent-api:configured', () => {
clearInterval(intervalId);
});
})();
</script>
<?php endif; ?>
@@ -0,0 +1,33 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
/** @var \Plumrocket\CookieConsent\Block\CookieNotice $block */
?>
<?php if ($block->isAllowedPage()): ?>
<div data-bind="scope: 'pr-cookie-notice'" class="pr-cookie-notice-wrapper">
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": <?= $block->getJsLayout() ?>
}
}
</script>
<?php endif; ?>
@@ -0,0 +1,438 @@
<?php
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
?>
<?php
/** @var \Plumrocket\CookieConsent\Block\RestrictionConfig $block */
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
?>
<script <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
var prCookieConsentApi = {
CUSTOMER_CONSENT: 'pr-cookie-consent',
SYSTEM_COOKIES: [
'PHPSESSID',
this.CUSTOMER_CONSENT,
'user_allowed_save_cookie',
],
config: {},
whitelist: {},
isConfigured: false,
/**
* Contains callbacks that run after all configuration come.
*
* @type {function[]}
*/
configuredCallbacks: [],
initCookieBlocking: function () {
var cookieDesc = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie')
|| Object.getOwnPropertyDescriptor(HTMLDocument.prototype, 'cookie');
if (cookieDesc && cookieDesc.configurable) {
var api = this;
Object.defineProperty(document, 'cookie', {
get: function () {
return cookieDesc.get.call(document);
},
set: function (cookie) {
let cookieName = cookie.substring(0, cookie.indexOf('=')).trim();
document.dispatchEvent(new CustomEvent('pr-cookie-consent-api:cookie-blocking:validation', {
detail: {cookieName: cookieName, isAllowed: api.isAllowed(cookieName), cookie: cookie}
}));
if (! api.isAllowed(cookieName)) {
api.logger.warn('CookieConsent: blocked cookie "' + cookieName + '"');
return;
}
cookieDesc.set.call(document, cookie);
}
});
}
},
getCookieValue: function (name) {
var values = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)');
return values ? decodeURIComponent(values.pop()) : '';
},
configure: function (configJson) {
this.logger.init();
this.userScript.init();
try {
this.config = JSON.parse(configJson);
} catch (e) {
console.error('CookieConsent: error has happened during parse JSON');
return false;
}
var finalizeConfiguration = () => {
this.isConfigured = true;
this.configuredCallbacks.forEach(function (callback) {
callback();
}.bind(this));
this.clearRejectedCookie();
document.dispatchEvent(new Event('pr-cookie-consent-api:configured'));
};
null === this.canManageCookie()
? this.fetchRestrictionState(finalizeConfiguration)
: finalizeConfiguration();
},
canManageCookie: function () {
if (null !== this.config.canManageCookie) {
return this.config.canManageCookie;
}
if (undefined !== prCookieService.get('pr-can-manage-cookie')) {
this.config.canManageCookie = prCookieService.get('pr-can-manage-cookie') === "true";
return this.config.canManageCookie;
}
return null;
},
fetchRestrictionState: function (callback) {
var url = this.config.canManageCookieApiUrl + '?_=' + Date.now();
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.setRequestHeader('Accept', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status >= 200 && xhr.status < 300) {
var body = xhr.responseText || '';
var parsed;
try { parsed = JSON.parse(body); } catch (_) { parsed = body; }
var status = String(parsed).toLowerCase() === "true";
prCookieService.set('pr-can-manage-cookie', status, {
path: prCookieConsentApi.config.cookie.path,
expires: prCookieConsentApi.config.mage.lifetime
? Math.ceil(prCookieConsentApi.config.mage.lifetime / 86400)
: 0
});
prCookieConsentApi.config.canManageCookie = status;
} else {
console.error('CookieConsent: restriction config is invalid');
}
callback();
};
xhr.send(null);
},
/**
* @param {function} callback
* @returns {prCookieConsentApi}
*/
addConfiguredCallback: function (callback) {
this.configuredCallbacks.push(callback);
return this;
},
<?php // This logic has php alternative in \Plumrocket\CookieConsent\Model\Category\IsAllowed ?>
isAllowedCategory: function (categoryKey) {
if (! this.canManageCookie()) {
return true;
}
if (this.isEssentialCategory(categoryKey)) {
return true;
}
if (this.isOptIn()) {
if (this.isAllCategoriesAllowed()) {
return true;
}
return this.consent.get().includes(categoryKey);
}
return this.config.canUseCookieBeforeOptIn;
},
getDomain: function (cookieName) {
return this.config.cookies[cookieName] ? this.config.cookies[cookieName].domain : null;
},
<?php // This logic has php alternative in \Plumrocket\CookieConsent\Model\Cookie\IsAllowed ?>
isAllowed: function (cookieName) {
if (this.isSystemCookie(cookieName)) {
return true;
}
if (! this.canManageCookie()) {
return true;
}
if (this.whitelist[cookieName]) {
return true;
}
cookieName = this.getTrueCookieName(cookieName);
if (! this.isOptIn()) {
if (this.config.canUseCookieBeforeOptIn) {
return true;
}
if (this.isKnownCookie(cookieName)) {
return this.isInEssentialCategory(cookieName);
}
return false;
}
if (! this.isKnownCookie(cookieName)) {
return ! this.config.canBlockUnknownCookie;
}
return this.isInAllowedCategory(cookieName);
},
isAllCategoriesAllowed: function () {
if (null === this.cache.get('allowAllCategories')) {
var customerConsent = this.consent.get();
if (customerConsent && customerConsent.includes('all') ) {
this.cache.set('allowAllCategories', true);
} else {
var allowedWebsites = this.websiteRestriction.getAllowed();
this.cache.set('allowAllCategories', allowedWebsites[this.config.mage.website] === 1);
}
}
return this.cache.get('allowAllCategories');
},
isEssentialCategory: function (categoryKey) {
return this.config.essentialCategoryKeys.includes(categoryKey);
},
isInEssentialCategory: function (cookieName) {
return this.isEssentialCategory(this.getCookieCategory(cookieName));
},
isInAllowedCategory: function (cookieName) {
return this.isAllowedCategory(this.getCookieCategory(cookieName));
},
getCookieCategory: function (cookieName) {
return this.config.cookieToCategoryMapping[cookieName];
},
isOptIn: function () {
var allowedWithDefaultCookie = this.websiteRestriction.getAllowed()[this.config.mage.website] === 1;
return Boolean(this.consent.get()) || allowedWithDefaultCookie;
},
isSystemCookie: function (cookieName) {
return this.SYSTEM_COOKIES.includes(cookieName);
},
isKnownCookie: function (cookieName) {
return this.config.cookieToCategoryMapping.hasOwnProperty(cookieName);
},
getTrueCookieName: function (cookieName) {
var keys = Object.keys(this.config.dynamicNamesPatterns), key;
for (var i = 0, length = keys.length; i < length; i++) {
key = keys[i];
if (new RegExp(this.config.dynamicNamesPatterns[key]).test(cookieName)) {
return key;
}
}
return cookieName;
},
clearRejectedCookie: function () {
let cookies = prCookieService.get();
Object.keys(cookies).forEach(function(cookieName) {
if (this.isAllowed(cookieName)) {
return;
}
var encodedCookieName = cookieName = encodeURIComponent(String(cookieName))
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
.replace(/[\(\)]/g, escape);
this.whitelist[encodedCookieName] = true;
if (this.getDomain(cookieName)) {
prCookieService.remove(cookieName, {domain: this.getDomain(cookieName)});
} else {
prCookieService.remove(cookieName);
if (this.config.cookie.parentDomain) {
prCookieService.remove(cookieName, {domain: this.config.cookie.parentDomain});
}
}
this.logger.warn('CookieConsent: remove cookie "' + cookieName + '"');
if (typeof prCookieService.get(cookieName) !== 'undefined') {
this.logger.error('CookieConsent: fail to remove cookie "' + cookieName + '"');
}
this.whitelist[encodedCookieName] = false;
}.bind(this));
}
};
prCookieConsentApi.userScript = {
/**
* List of callbacks and categories they depend on.
*/
pendingScripts: [],
/**
* Run script after model is configured or after user provided consent.
*/
init: function () {
prCookieConsentApi.addConfiguredCallback(this.executePendingScripts.bind(this));
prCookieConsentApi.consent.addCallback(this.executePendingScripts.bind(this));
},
/**
* Run or delay script.
*
* @param {function} callback
* @param {string} categoryKey
*/
execute: function (callback, categoryKey) {
if (prCookieConsentApi.isConfigured && prCookieConsentApi.isAllowedCategory(categoryKey)) {
callback();
return;
}
this.pendingScripts.push({callback: callback, categoryKey: categoryKey, executed: false});
},
/**
* Run pending scripts.
*/
executePendingScripts: function () {
this.pendingScripts.forEach(function (script) {
if (false === script.executed && prCookieConsentApi.isAllowedCategory(script.categoryKey)) {
script.callback();
script.executed = true;
}
}.bind(this));
},
};
prCookieConsentApi.websiteRestriction = {
getAllowed: function () {
var allowedWebsites = prCookieConsentApi.getCookieValue(prCookieConsentApi.config.mage.cookieName);
return allowedWebsites ? JSON.parse(allowedWebsites) : {};
},
allowCurrent: function () {
return this.set(prCookieConsentApi.config.mage.website, true);
},
disallowCurrent: function () {
return this.set(prCookieConsentApi.config.mage.website, false);
},
/**
* @param {number} website
* @param {boolean} flag
* @return {CookieRestriction.websiteRestriction}
*/
set: function (website, flag) {
var allowedWebsites = this.getAllowed();
if (flag) {
allowedWebsites[website] = 1;
} else {
delete allowedWebsites[website];
}
prCookieService.set(prCookieConsentApi.config.mage.cookieName, allowedWebsites, {
path: prCookieConsentApi.config.cookie.path,
expires: prCookieConsentApi.config.mage.lifetime ? Math.ceil(prCookieConsentApi.config.mage.lifetime / 86400) : 0
});
return this;
}
};
prCookieConsentApi.cache = {
cacheData: {allowAllCategories: null},
get: function (key) {
return this.cacheData[key];
},
set: function (key, value) {
this.cacheData[key] = value;
},
reset: function () {
this.cacheData = {allowAllCategories: null};
}
};
prCookieConsentApi.logger = {
level: 0, /* disabled */
init: function () {
if (window.location.hash === '#pr-enable-cookie-log') {
this.level = 1; /* only warnings and errors */
}
if (window.location.hash === '#pr-enable-cookie-log-all') {
this.level = 2; /* all logs */
}
},
log: function () {
this.level > 1 && console.log.apply(console, arguments);
},
warn: function () {
this.level > 0 && console.warn.apply(console, arguments);
},
error: function () {
this.level > 0 && console.error.apply(console, arguments);
}
};
prCookieConsentApi.consent = {
/**
* Contains callbacks that run after user consent.
*
* @type {function[]}
*/
callbacks: [],
allowAllCategories: function () {
prCookieConsentApi.cache.reset();
prCookieConsentApi.consent.set(['all']);
return this;
},
declineAll: function () {
prCookieConsentApi.cache.reset();
prCookieConsentApi.consent.set([]);
return this;
},
set: function (allowedCategories) {
prCookieService.set(prCookieConsentApi.CUSTOMER_CONSENT, JSON.stringify(allowedCategories), {
expires: prCookieConsentApi.config.consent.expiry,
path: prCookieConsentApi.config.cookie.path,
domain: prCookieConsentApi.config.cookie.domain
});
if (allowedCategories.includes('all')) {
prCookieConsentApi.websiteRestriction.allowCurrent();
} else {
prCookieConsentApi.websiteRestriction.disallowCurrent();
}
prCookieConsentApi.cache.reset();
var isAccepting = allowedCategories.length;
this.callbacks.forEach(function (callback) {
callback(allowedCategories)
});
fetch(prCookieConsentApi.config.consent.logUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
},
body: JSON.stringify({acceptedKeys: allowedCategories})
})
.then(this.pageReloadAfterAction.bind(this, isAccepting));
},
/**
* Reload page by configuration and action
*
* @param isAccepting
*/
pageReloadAfterAction: function (isAccepting) {
if (isAccepting && prCookieConsentApi.config.consent.reloadAfterAccept) {
window.location.reload();
}
if (! isAccepting && prCookieConsentApi.config.consent.reloadAfterDecline) {
window.location.reload();
}
},
get: function () {
var consent = prCookieConsentApi.getCookieValue(prCookieConsentApi.CUSTOMER_CONSENT);
return consent ? JSON.parse(consent) : false;
},
addCallback: function (callback) {
this.callbacks.push(callback);
return this;
},
};
prCookieConsentApi.configure('<?= $block->escapeJs($block->getSerializedRestrictionConfig()) ?>');
prCookieConsentApi.initCookieBlocking();
if (typeof define === 'function') {
define('prCookieService', function () {return prCookieService});
define('prCookieConsentApi', function () {return prCookieConsentApi;});
}
</script>
@@ -0,0 +1,31 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
/** @var \Plumrocket\CookieConsent\Block\Settings $block */
?>
<div data-bind="scope: 'pr-cookie-settings-bar'" class="pr-cookie-settings-bar-wrapper">
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": <?= $block->getJsLayout() ?>
}
}
</script>
@@ -0,0 +1,23 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2021 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
/** @var \Plumrocket\CookieConsent\Block\Widget\CookieSettingsButton $block */
?>
<button class="action primary pr-open-cookie-settings" title="<?= $block->escapeHtml(__($block->getTitle())) ?>">
<?= $block->escapeHtml(__($block->getTitle())) ?>
</button>
@@ -0,0 +1,23 @@
<?php
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2021 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
/** @var \Plumrocket\CookieConsent\Block\Widget\CookieSettingsButton $block */
?>
<a href="#" class="pr-open-cookie-settings" title="<?= $block->escapeHtmlAttr(__($block->getTitle())) ?>">
<?= $block->escapeHtml(__($block->getTitle())) ?>
</a>
@@ -0,0 +1,26 @@
<?php
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
?>
<?php
/** @var \Magento\Framework\View\Element\Template $block */
/** @var \Plumrocket\CookieConsent\ViewModel\Integration\NoCookieYoutube $viewModel */
$viewModel = $block->getData('viewModel');
/** @var \Plumrocket\Base\ViewModel\CspNonce $cspNonceViewModel */
$cspNonceViewModel = $block->getData('cspNonceViewModel');
?>
<?php if ($viewModel->isEnabled()): ?>
<script type="text/x-magento-init" <?= /* @noEscape */ $cspNonceViewModel->getNonce() ?>>
{
"*": {
"Plumrocket_CookieConsent/js/youtube": {
"categoryKey": "<?= $block->escapeJs($viewModel->getAssociatedCategoryKey()) ?>"
}
}
}
</script>
<?php endif; ?>
@@ -0,0 +1,961 @@
.blur-mode{
-webkit-filter: blur(3px);
filter: blur(3px);
}
.pr-cookie-modal-bottom {
display: none;
position: fixed;
bottom: 0;
z-index: 800 !important;
width: 100%;
box-sizing: border-box;
animation-duration: 1s;
animation-name: slideup;
animation-timing-function: ease-in-out;
}
.pr-cookie-modal.show-without-overlay {
display: block;
}
.pr-cookie-modal-bottom .modal-inner-wrap {
max-width: 100%;
padding: 15px;
padding-top: 35px;
background: rgba(0, 33, 68, 0.89);
}
.pr-cookie-title {
margin: 0;
font-weight: 700;
line-height: 1.1;
font-size: 1.9rem;
}
.pr-cookie-modal-bottom .pr-cookie-notice-text {
color: #e6e6e6;
}
.pr-cookie-notice-text p {
margin-bottom: 0;
font-size: 14px;
line-height: 1.43;
}
.pr-cookie-notice-text p a {
color: inherit;
text-decoration: underline;
white-space: nowrap;
}
.pr-cookie-notice-actions {
display: flex;
flex-direction: column;
margin-top: 15px;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn {
min-height: 40px;
margin: 5px 0;
padding: 7px 15px;
font-size: 1.4rem;
line-height: 1.6rem;
box-shadow: none;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn.setting-link {
padding: 0;
border: none;
text-decoration: underline;
background-color: transparent;
}
button.pr-cookie-close-modal {
position: absolute;
top: 10px;
right: 10px;
width: 32px;
height: 25px;
background-color: transparent;
border: none;
box-shadow: none;
opacity: 0.3;
}
.pr-cookie-close-modal::before,
.pr-cookie-close-modal::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
width: 15px;
height: 3px;
background-color: #e6e6e6;
border-radius: 1px;
}
.pr-cookie-close-modal::after {
transform: translate(-50%, -50%) rotate(-45deg);
}
.pr-cookie-modal button.pr-cookie-setting-btn.setting-link {
background-color: transparent;
box-shadow: none;
color: #fff;
}
.pr-cookie-modal button.pr-cookie-setting-btn.setting-link:hover {
background-color: transparent;
color: #dbdbdb;
}
.modal-slide.pr-cookie-left-bar {
right: 44px;
left: 0;
max-width: 400px;
}
.pr-cookie-left-bar .modal-title {
margin-bottom: 0;
font-size: 2.2rem;
line-height: 1.1;
font-weight: 600;
color: #333;
}
.pr-cookie-left-bar .pr-cookie-description {
margin-top: 10px;
}
.pr-cookie-left-bar .pr-cookie-description p {
margin: 0;
font-weight: 400;
line-height: 1.4;
font-size: 1.3rem;
color: #333;
}
.pr-cookie-category-descrip {
font-weight: 400;
font-size: 1.3rem;
line-height: 1.4;
color: #5C6670;
margin-bottom: 2rem;
}
.pr-cookie-left-bar .modal-content {
position: relative;
display: flex;
min-height: 100%;
box-sizing: border-box;
padding: 35px 18px;
}
.modal-slide.pr-cookie-left-bar .modal-inner-wrap {
transform: translateX(-100%);
}
.modal-slide.pr-cookie-left-bar._show .modal-inner-wrap {
transform: translateX(0);
}
.pr-cookie-left-bar .pr-actions-buttons {
display: flex;
justify-content: center;
padding-top: 20px;
padding-bottom: 30px;
border-bottom: 1px solid #ccc;
}
.pr-cookie-left-bar .pr-actions-buttons .action {
min-width: 150px;
min-height: 46px;
margin-right: 20px;
box-shadow: none;
}
.pr-cookie-left-bar .pr-actions-buttons .action:last-child {
margin-right: 0;
}
.modal-slide.pr-cookie-left-bar .page-main-actions {
margin-bottom: 0;
}
#pr-cookie-setting-bar {
display: flex;
flex-direction: column;
width: 100%;
}
#pr-cookie-setting-bar .pr-cookie-manage-title {
margin-top: 30px;
margin-bottom: 0;
font-weight: 700;
line-height: 1.1;
font-size: 1.9rem;
}
#pr-cookie-setting-bar .message-system-list {
margin-bottom: 35px;
padding-left: 0;
list-style: none;
}
.pr-cookie-option {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 30px;
margin-bottom: 10px;
}
#pr-cookie-setting-bar .option-label {
margin-right: 10px;
font-size: 1.4rem;
line-height: 1.1;
}
#pr-cookie-setting-bar .option-status {
font-size: 1.4rem;
color: #3f9001;
white-space: nowrap;
}
.pr-cookie-option .switch-area {
position: relative;
display: block;
width: 45px;
height: 25px;
box-sizing: border-box;
cursor: pointer;
border: 1px solid #ddd;
background-color: #f2f1f1;
border-radius: 20px;
transition: 0.3s;
}
.pr-cookie-option .switch-label {
position: relative;
}
.pr-cookie-option .switch-label input {
position: absolute;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
}
.pr-cookie-option .switch-label input[disabled] + .switch-area{
opacity: .5;
cursor: not-allowed;
}
.pr-cookie-option .switch-label .switch-nob {
content: "";
position: absolute;
top: 1px;
left: 2px;
width: 21px;
height: 21px;
background-color: #7d7d7d;
border-radius: 50%;
transition: 0.3s;
}
.pr-cookie-option .switch-label input:checked + .switch-area {
background-color: #6aa84f;
border-color: #3f9125;
}
.pr-cookie-option .switch-label input:checked + .switch-area .switch-nob {
transform: translate(calc(100% - 2px));
background-color: #fff;
}
.pr-cookie-left-bar .confirm {
align-self: flex-start;
margin-top: auto;
min-width: 170px;
height: 46px;
}
.pr-cookie-left-bar .pr-cookie-details {
margin-top: 8px;
padding: 0;
font-weight: 400;
font-size: 1.2rem;
line-height: 1.6rem;
background-color: transparent;
border: none;
box-shadow: none;
color: #386dc3;
}
.pr-cookie-left-bar .pr-cookie-details:hover {
text-decoration: underline;
}
.pr-cookie-view-top {
display: flex;
justify-content: space-between;
align-items: center;
}
.pr-cookie-group {
margin-top: 5px;
margin-bottom: 15px;
font-size: 1.2rem;
padding: 15px;
background-color: #f8f8f8;
border-radius: 5px;
}
.pr-cookie-group-row {
display: flex;
padding-bottom: 5px;
}
.pr-cookie-property {
flex-shrink: 0;
display: block;
min-width: 95px;
margin-right: 15px;
}
.pr-cookie-property-value {
overflow: hidden;
text-overflow: ellipsis;
}
.pr-cookie-details-info {
border-bottom: 1px solid #ccc;
}
.pr-cookie-details-info summary {
position: relative;
padding: 8px 0;
padding-right: 30px;
cursor: pointer;
}
.pr-cookie-details-info summary::-webkit-details-marker {
display: none;
}
.pr-cookie-group-title {
margin: 0;
font-size: 1.8rem;
line-height: 1.1;
font-weight: 400;
color: #386dc3;
}
.pr-cookie-view .pr-cookie-view-title {
margin: 0;
padding-top: 15px;
font-weight: 700;
line-height: 1.1;
font-size: 1.6rem;
color: #333;
}
.pr-cookie-view-top .pr-cookie-view-back {
position: relative;
padding: 7px 15px;
color: #333;
border: none;
background-color: transparent;
box-shadow: none;
font-size: 1.4rem;
line-height: 1.6rem;
box-sizing: border-box;
}
.pr-cookie-view-top .pr-cookie-view-back::before {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%) rotate(-45deg);
width: 5px;
height: 5px;
border: 1px solid #000;
border-right: none;
border-bottom: none;
}
.pr-cookie-view-top .pr-cookie-view-back::after {
content: "";
position: absolute;
top: 50%;
left: 1px;
transform: translatey(-50%);
width: 10px;
height: 1px;
background-color: #000;
}
.pr-cookie-view-top .pr-cookie-view-back:hover::before {
border-color: #386dc3;
}
.pr-cookie-view-top .pr-cookie-view-back:hover::after {
background-color: #386dc3;
}
.pr-cookie-details-modal .pr-cookie-details-info .pr-cookie-details-title,
.pr-cookie-details-info summary span {
position: relative;
display: inline-block;
margin-top: 5px;
padding-right: 14px;
font-size: 1.1rem;
font-weight: 600;
color: #386dc3;
}
.pr-cookie-details-info summary span::after {
content: "";
position: absolute;
top: 50%;
right: 0;
transform: translatey(-50%);
border-left: 7px solid #636363;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
transition: 0.2s;
}
.pr-cookie-details-modal .pr-cookie-details-info[open] .pr-cookie-details-title:after,
.pr-cookie-details-modal .first-details[open=true] .pr-cookie-details:after,
.pr-cookie-details-info[open] summary span::after {
transform: translatey(-50%) rotate(90deg);
}
.pr-cookie-details-info[open] .pr-cookie-group {
animation: slidedown 0.3s;
}
.pr-cookie-view-top strong {
font-size: 1.4rem;
line-height: 1.1;
font-weight: 700;
color: #333;
}
.pr-cookie-left-bar .pr-cookie-close {
position: absolute;
top: 5px;
right: 5px;
width: 32px;
height: 32px;
background-size: 10px;
background-position: center;
background-repeat: no-repeat;
background-color: transparent;
border: none;
box-shadow: none;
transition: 0.3s;
}
.pr-cookie-left-bar .pr-cookie-close::before,
.pr-cookie-left-bar .pr-cookie-close::after,
.pr-cookie-details-modal .pr-cookie-close::before,
.pr-cookie-details-modal .pr-cookie-close::after,
.pr-cookie-modal .pr-cookie-close::before,
.pr-cookie-modal .pr-cookie-close::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
transform-origin: center;
width: 12px;
height: 2px;
background-color: #494949;
border-radius: 30%;
}
.pr-cookie-modal .pr-cookie-close::before,
.pr-cookie-modal .pr-cookie-close::after{
background-color: #818181;
}
.pr-cookie-details-modal .pr-cookie-close::before,
.pr-cookie-details-modal .pr-cookie-close::after,
.pr-cookie-modal .pr-cookie-close .pr-cookie-close::before,
.pr-cookie-modal .pr-cookie-close .pr-cookie-close::after {
width: 15px;
height:3px;
border-radius: 2px;
}
.pr-cookie-details-modal .pr-cookie-close:hover,
.pr-cookie-modal .pr-cookie-close:hover
{
opacity: .7;
}
.pr-cookie-left-bar .pr-cookie-close::after,
.pr-cookie-details-modal .pr-cookie-close::after,
.pr-cookie-modal .pr-cookie-close::after{
transform: translate(-50%, -50%) rotate(-45deg);
}
.pr-cookie-left-bar .pr-cookie-close:hover {
opacity: 0.7;
}
.pr-cookie-setting-bar-wrap {
display: flex;
flex-direction: column;
min-height: 100%;
}
.pr-cookie-view .pr-cookie-details-title {
margin: 0;
font-size: 1.3rem;
font-weight: 700;
}
.pr-cookie-view-wrap {
height: 65px;
}
.pr-cookies-list {
height: calc(100vh - 225px);
overflow-y: auto;
margin: 0 -18px;
padding: 0 18px;
margin-top: 20px;
}
/* START --- pr-cookie-modal-wall pr-cookie-modal-popup --- */
.pr-cookie-modal.modal-popup .modal-inner-wrap{
position: absolute;
top: auto;
bottom: 0;
left: 0;
right: 0;
width: 100%;
padding: 25px 0;
margin: 0;
}
.pr-cookie-modal.modal-popup .pr-cookie-notice-wrap{
display: block;
}
.pr-cookie-modal.modal-popup .pr-cookie-notice-text,
.pr-cookie-modal-popup .pr-cookie-notice-text {
margin: 0 0 25px;
color: inherit;
}
.pr-cookie-modal.modal-popup .pr-cookie-notice-actions{
justify-content: space-around;
}
.pr-cookie-modal.modal-popup .pr-cookie-notice-actions .pr-cookie-notice-btn:last-child{
order: 0;
}
@media (min-width: 650px){
.pr-cookie-modal.modal-popup .modal-inner-wrap{
right: auto;
bottom: auto;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width: 600px;
padding: 0 0 3rem;
}
}
@media (max-width: 480px){
.pr-cookie-modal.modal-popup .pr-cookie-notice-actions .pr-cookie-notice-btn{
margin-bottom: 15px;
}
.pr-cookie-modal.modal-popup .pr-cookie-notice-actions .pr-cookie-notice-btn:last-child{
margin-bottom: 0;
}
}
/* END --- pr-cookie-modal-wall pr-cookie-modal-popup --- */
@media (max-width: 375px) {
.modal-slide.pr-cookie-left-bar {
width: 100%;
}
.pr-cookie-left-bar .pr-actions-buttons .action {
min-width: 130px;
}
}
@media (min-width: 480px) {
.pr-cookie-notice-actions {
flex-direction: row;
justify-content: center;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn {
margin-bottom: 0;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn:last-child {
order: -1;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn {
margin: 0 7.5px;
}
}
@media (min-width: 768px) {
.pr-cookie-modal-bottom .modal-inner-wrap{
padding-top: 15px;
padding-right: 50px;
}
.pr-cookie-notice-wrap {
display: flex;
justify-content: center;
align-items: center;
}
.pr-cookie-notice-actions {
flex-shrink: 0;
}
.pr-cookie-notice-text {
max-width: 850px;
margin-right: 25px;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn {
margin-right: 10px;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn:last-child {
margin-right: 0;
}
.pr-cookie-notice-text p {
font-size: 12px;
}
.pr-cookie-notice-actions .pr-cookie-notice-btn:last-child {
margin-right: 10px;
}
.pr-cookie-notice-actions {
margin-top: 0;
}
button.pr-cookie-close-modal {
top: 50%;
transform: translateY(-50%);
}
}
@keyframes slideup {
from {
opacity: 0;
transform: translatey(100%);
}
to {
opacity: 1;
transform: translatey(0);
}
}
@keyframes slidedown {
from {
opacity: 0;
transform: translatey(-30px);
}
to {
opacity: 1;
transform: translatey(0);
}
}
/************************************** ACCORDION_POPUP ********************************************/
.pr-cookie-details-modal{
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
}
.pr-cookie-details-modal.modal-popup .modal-inner-wrap{
width: 100%;
height: 100%;
position: absolute;
padding: 3rem 1rem;
overflow: hidden;
z-index: 1;
border-radius: 5px;
border: 1px solid #232323;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin: 0;
}
.pr-cookie-details-modal .modal-inner-wrap .modal-content{
max-height: 100%;
overflow: auto;
padding: 0 1rem;
}
.pr-cookie-details-modal .pr-cookie-close,
.pr-cookie-modal .pr-cookie-close{
position: absolute;
top: 0;
right: 0;
background: transparent;
width: 40px;
height: 40px;
box-shadow: none;
border: none;
padding: 15px;
}
.pr-cookie-details-modal .pr-actions-buttons{
display: flex;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 2rem;
padding-bottom: 3rem;
border-bottom: 3px solid #F0F0F0;
}
.pr-cookie-details-modal .pr-actions-buttons button{
margin: 6px;
min-height: 40px;
min-width: 130px;
box-shadow: none;
}
.pr-cookie-details-modal #pr-cookie-setting-bar .pr-cookie-title,
.pr-cookie-details-modal #pr-cookie-setting-bar .pr-cookie-manage-title{
text-align: center;
margin-bottom: 2rem;
margin-top: 0;
font-weight: 600;
font-size: 1.8rem;
}
.pr-cookie-details-modal .pr-cookie-description{
font-weight: 400;
font-size: 12px;
line-height: 16px;
color: #5C6670;
margin-bottom: 3rem;
}
.pr-cookie-details-modal .pr-cookie-description > p{
margin-bottom: 1.5rem;
}
.pr-cookie-details-modal .pr-cookie-description > p:last-of-type{
margin-bottom: 0;
}
.pr-cookie-details-modal #pr-cookie-setting-bar .message-system-list{
margin-bottom: 0;
}
.pr-cookie-details-modal .message-system-list > li{
margin-bottom: 1rem;
}
.pr-cookie-details-modal .message-system-list > li:last-child{
margin-bottom: 0;
}
.pr-cookie-details-modal .accordion-title{
background: #F0F4F7;
}
.pr-cookie-details-modal .accordion-title > .pr-cookie-option{
border-radius: 2px;
padding: 1.4rem;
margin-bottom: 0;
margin-top: 0;
justify-items: flex-start;
position: relative;
color: #2E4257;
}
.pr-cookie-details-modal .accordion-title > .pr-cookie-option:before{
content: "";
background: url("../images/accordionCaret.svg") center no-repeat;
background-size: contain;
width: 6px;
height: 11px;
font-weight: 700;
margin-right: 2rem;
flex-shrink: 0;
transition: all .2s ease;
}
.pr-cookie-details-modal .accordion-title.category-open > .pr-cookie-option:before{
transform: rotate(90deg);
}
.pr-cookie-details-modal .accordion-title > .pr-cookie-option:hover{
cursor: pointer;
}
#pr-cookie-setting-bar .option-label {
margin-right: 1rem;
}
.pr-cookie-details-modal .lvl1{
display: flex;
align-items: center;
margin-bottom: 1.5rem;
}
.pr-cookie-details-modal .first-details .pr-cookie-details{
font-weight: 400;
font-size: 1.1rem;
line-height: 15px;
color: #5F5F5F;
position: relative;
display: block;
flex-shrink: 0;
margin-right: 2rem;
}
.pr-cookie-details_line{
height: 1px;
background: #DEE5EB;
width: 100%;
}
.pr-cookie-details-modal .confirm.primary{
align-self: center;
min-height: 40px;
margin-top: 3.5rem;
}
.pr-cookie-details-modal .option-status,
.pr-cookie-details-modal .pr-cookie-switch{
position: relative;
z-index: 1;
margin-left: auto;
}
.pr-cookie-details-modal .pr-cookie-option .switch-area{
background: #B8C4CC;
border-color: #B8C4CC;
}
.pr-cookie-details-modal .pr-cookie-option .switch-label .switch-nob{
background: #fff;
}
.pr-cookie-details-modal .first-details{
display: none;
}
.pr-cookie-details-modal .category-open .first-details{
display: block;
animation: slidedown 0.3s;
padding: 2rem 2.4rem;
border-top: 1px solid #DEE5EB;;
}
.pr-cookie-details-modal .pr-cookies-list{
height: auto;
width: auto;
overflow:visible;
padding: 0;
margin: 0;
}
.pr-cookie-details-modal .pr-cookie-details-info{
padding: 0 1.5rem;
background: #FFFFFF;
border: 1px solid #DBE5EC;
border-radius: 2px 2px 0 0;
margin-bottom: -1px;
}
.pr-cookie-details-modal .pr-cookie-details-info .pr-cookie-details-title{
padding-left: 0;
padding-right: 10px;
}
.pr-cookie-details-modal .pr-cookie-details-info .pr-cookie-details-title:after{
content: "";
width: 3px;
height: 7px;
background: url("../images/accordionCaret1.svg") center no-repeat;
background-size: contain;
position: absolute;
top: 50%;
right: 0;
transform: translatey(-50%);
transition: 0.2s;
}
@media (min-width: 480px){
.pr-cookie-details-modal.modal-popup .modal-inner-wrap{
padding: 3rem 3rem 4rem 3rem;
height: 626px;
max-height:626px;
}
.pr-cookie-details-modal .modal-inner-wrap{
max-height: 80vh;
max-width: 800px;
}
}
@media (min-width: 768px) {
.pr-cookie-details-modal .pr-actions-buttons button{
margin: 0 6px;
}
.pr-cookie-details-modal .accordion-title > .pr-cookie-option{
padding: 1.4rem 2rem;
}
.pr-cookie-details-modal .accordion-title > .pr-cookie-option:before{
margin-right: 2rem;
}
.pr-cookie-details-modal #pr-cookie-setting-bar .option-label {
padding-left: 2rem;
}
.pr-cookie-details-modal .accordion-title > .pr-cookie-option:after{
content: '';
position: absolute;
left: calc(4rem + 6px);
top: 1rem;
bottom: 1rem;
width: 1px;
background: #DEE5EB;
}
.pr-cookie-details-modal .pr-cookie-option .switch-area {
min-width: 55px;
}
.pr-cookie-details-modal .pr-cookie-option .switch-label input:checked + .switch-area .switch-nob{
left: 100%;
transform: translateX(calc(-100% - 2px));
}
}
@@ -0,0 +1 @@
<svg width="6" height="11" fill="none" stroke="#2E4257" xmlns="http://www.w3.org/2000/svg"><path d="m1 1 4 4.5L1 10" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 188 B

@@ -0,0 +1 @@
<svg width="3" height="7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m.5 1 2 2.5L.5 6" stroke="#1979C3" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 171 B

@@ -0,0 +1,10 @@
define([], function () {
'use strict';
/**
* @deprecated since 1.11.0 - no more used
*/
return function (s) {
return s;
};
});
@@ -0,0 +1,10 @@
define([], function () {
'use strict';
/**
* @deprecated since 1.11.0 - no more used
*/
return function (originReturnData) {
return originReturnData;
};
});
@@ -0,0 +1,127 @@
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
/**
* Finds and executes scripts in a newly added element's body.
* Needed since innerHTML does not run scripts.
*/
define(['prCookieConsentApi', 'domReady!'], function (prCookieConsentApi) {
'use strict';
function BodyScripts()
{
this.execute = function (element, idPrefix) {
var scripts = this.collectScriptsFromChildren(element);
this.executeScripts(scripts, 0, idPrefix);
};
this.executeScripts = function (scripts, i, idPrefix) {
var self = this;
var script = scripts[i];
if (script.parentNode) {
script.parentNode.removeChild(script);
}
this.evalScript(scripts[i], idPrefix + '_' + i, function () {
if (i < scripts.length-1) {
self.executeScripts(scripts, ++i, idPrefix);
}
});
}
this.nodeName = function (elem, name) {
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
};
this.evalScript = function (elem, id, callback) {
var data = (elem.text || elem.textContent || elem.innerHTML || ''),
head = document.getElementsByTagName('head')[0] ||
document.documentElement;
var script = document.createElement('script');
script.type = "text/javascript";
if (id !== '') {
script.setAttribute('id', id);
}
if (elem.src !== '') {
script.src = elem.src;
head.appendChild(script);
// Then bind the event to the callback function.
// There are several events for cross browser compatibility.
script.onreadystatechange = callback;
script.onload = callback;
} else {
try {
// doesn't work on ie...
script.appendChild(document.createTextNode(data));
} catch (e) {
// IE has funky script nodes
script.text = data;
}
head.appendChild(script);
callback();
}
};
this.collectScriptsFromChildren = function (node) {
var scripts = [],
children_nodes = node.childNodes,
child,
i;
if (children_nodes === undefined) {
return;
}
for (i = 0; i<children_nodes.length; i++) {
child = children_nodes[i];
if (this.nodeName(child, 'script') &&
(!child.type || child.type.toLowerCase() === 'text/javascript')
) {
scripts.push(child);
} else {
var newScripts = this.collectScriptsFromChildren(child);
for (var j = 0; j < newScripts.length; j++) {
scripts.push(newScripts[j]);
}
}
}
return scripts;
};
/**
* Active <script type="pr_cookie_category/..."> scripts.
*
* Allowed types are:
* - pr_cookie_category/all
* - pr_cookie_category/{{category_name}}
*
* @param {HTMLScriptElement} notActiveScript
*/
this.activatePrCookieCategoryScript = function (notActiveScript) {
var cookieCategory = notActiveScript.type.replace('pr_cookie_category/', '');
var isScriptAllowed = ('all' === cookieCategory)
? prCookieConsentApi.isAllCategoriesAllowed()
: prCookieConsentApi.isAllowedCategory(cookieCategory);
if (isScriptAllowed) {
var script = document.createElement('script');
script.type = 'text/javascript';
if (notActiveScript.getAttribute('id')) {
script.setAttribute('id', notActiveScript.getAttribute('id'));
}
if (notActiveScript.src) {
script.src = notActiveScript.src;
} else {
script.text = notActiveScript.text;
}
notActiveScript.replaceWith(script);
}
};
}
return new BodyScripts();
});
@@ -0,0 +1,231 @@
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
define([
'underscore',
'ko',
'jquery',
'uiComponent',
'prCookieConsentApi',
'uiRegistry',
'Magento_Ui/js/modal/modal',
'text!Plumrocket_CookieConsent/template/notice/modal/modal-bottom.html',
'text!Plumrocket_CookieConsent/template/notice/modal/modal-popup.html',
'mage/translate',
'mage/cookies',
], function (_, ko, $, Component, prCookieConsentApi, uiRegistry, modal, modalBottomTpl, modalPopupTpl) {
'use strict';
var DISPLAY_STYLE_POPUP = 'popup';
var DISPLAY_STYLE_WALL = 'wall';
var DISPLAY_STYLE_BOTTOM = 'bottom';
return Component.extend({
/**
* @type {{
* titleColor: string,
* textColor: string,
* backgroundColor: string,
* overlayBackgroundColor: string,
* overlayBlur: boolean,
* }}
*/
design: {},
initialize: function (config) {
this._super();
this.createModal = _.once(this.createModal);
},
autoOpen: function () {
this.createModal();
if (false === prCookieConsentApi.canManageCookie()) {
return;
}
if (! prCookieConsentApi.isOptIn() && ! this.isDisabled()) {
this.getModal().openModal();
}
this.addStyles(this.design);
this.addChangingStyleOnHover($('.pr-cookie-notice-btn.allow'), this.acceptButtonConfig);
this.addChangingStyleOnHover($('.pr-cookie-notice-btn.decline'), this.declineButtonConfig);
this.addChangingStyleOnHover($('.pr-cookie-setting-btn'), this.settingsButtonConfig);
},
allowAll: function () {
prCookieConsentApi.consent.allowAllCategories();
this.getModal().closeModal();
},
declineAll: function () {
prCookieConsentApi.consent.declineAll();
this.getModal().closeModal();
},
openSettings: function () {
uiRegistry.get('pr-cookie-settings-bar').getModal().openModal();
},
/**
* @return {String}
*/
getDisplayStyle: function () {
return this.displayStyle;
},
createModal: function () {
var self = this;
var options = {
buttons: [],
modalClass: 'pr-cookie-modal pr-cookie-modal-' + this.getDisplayStyle(),
};
switch (this.getDisplayStyle()) {
case DISPLAY_STYLE_BOTTOM:
options = _.extendOwn(options, {
customTpl: modalBottomTpl,
type: 'custom',
overlayClass: 'pr-cookie-overlay',
parentModalClass: '',
modalVisibleClass: 'show-without-overlay',
keyEventHandlers: {
escapeKey: function () {}
}
});
break;
case DISPLAY_STYLE_WALL:
options = _.extendOwn(options, {
popupTpl: modalPopupTpl,
type: 'popup',
clickableOverlay: false,
canClose: false,
title: this.noticeTitle,
keyEventHandlers: {
escapeKey: function () {}
},
opened: function () {
self.design.overlayBlur && self.overlayBlur.enable();
},
closed: function () {
self.design.overlayBlur && self.overlayBlur.disable();
}
});
break;
case DISPLAY_STYLE_POPUP:
options = _.extendOwn(options, {
popupTpl: modalPopupTpl,
type: 'popup',
clickableOverlay: false,
canClose: true,
title: this.noticeTitle,
modalCloseBtnHandler: this.disableNotice.bind(this),
keyEventHandlers: {
escapeKey: this.disableNotice.bind(this)
},
opened: function () {
self.design.overlayBlur && self.overlayBlur.enable();
},
closed: function () {
self.design.overlayBlur && self.overlayBlur.disable();
},
});
break;
}
this.modal = modal(options, document.getElementById('pr-cookie-notice'));
},
getModal: function () {
this.createModal();
return this.modal;
},
/**
* Check if notice was closed by customer this day
*
* @return {boolean}
*/
isDisabled: function () {
return 'close' === $.mage.cookies.get(this.statusCookieName);
},
/**
* Temporally disable notice
* Don't execute on "closed" event because customer might close popup by accepting cookie
*/
disableNotice: function () {
$.mage.cookies.set(this.statusCookieName, 'close', {lifetime: 86400}); // one day
this.getModal().closeModal();
},
/**
* @param {any} $button
* @param {Object} config
* @param {string} config.type
* @param {string} config.text_color
* @param {string} config.text_color_on_hover
* @param {string} config.background_color
* @param {string} config.background_color_on_hover
* @param {string} config.link_color
* @param {string} config.link_color_on_hover
*/
addChangingStyleOnHover: function ($button, config) {
$button.on({
mouseenter: function () {
$(this).css({
'background-color': (config.type === 'link') ? '' : config.background_color_on_hover,
'border-color': (config.type === 'link') ? '' : config.background_color_on_hover,
'color': (config.type === 'link') ? config.link_color_on_hover : config.text_color_on_hover
})
},
mouseleave: function () {
$(this).css({
'background-color': (config.type === 'link') ? '' : config.background_color,
'border-color': (config.type === 'link') ? '' : config.background_color,
'color': (config.type === 'link') ? config.link_color : config.text_color
});
}
});
},
/**
*
* @param {{titleColor, textColor, backgroundColor, overlayBackgroundColor}} design
*/
addStyles: function (design) {
if (design.titleColor) {
$('.pr-cookie-modal .modal-title').css({'color': design.titleColor});
}
if (design.textColor) {
$('.pr-cookie-notice-text').css({'color': design.textColor});
}
var background = document.querySelector('.pr-cookie-modal > .modal-inner-wrap');
if (design.backgroundColor && background) {
background.style.backgroundColor = design.backgroundColor;
}
var overlayBackground = document.querySelector('.pr-cookie-modal + .modals-overlay');
if (design.overlayBackgroundColor && overlayBackground) {
overlayBackground.style.backgroundColor = design.overlayBackgroundColor;
}
},
overlayBlur: {
enable: function () {
document.querySelector('.page-wrapper').classList.add('blur-mode');
},
disable: function () {
document.querySelector('.page-wrapper').classList.remove('blur-mode');
}
}
});
});
@@ -0,0 +1,302 @@
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
define([
'underscore',
'ko',
'jquery',
'uiComponent',
'prCookieConsentApi',
'uiRegistry',
'Magento_Ui/js/modal/modal',
'text!Plumrocket_CookieConsent/template/settings/modal/modal-slide.html',
'text!Plumrocket_CookieConsent/template/settings/modal/modal-popup.html',
'mage/translate'
], function (_, ko, $, Component, prCookieConsentApi, uiRegistry, modal, modalSlideTpl, modalPopupTpl) {
'use strict';
var DISPLAY_STYLE_ACCORDION_POPUP = 'accordions_popup';
return Component.extend({
acceptButtonLabel: '',
/**
* Contains selected categories to confirm
*/
selectedCategories: [],
initialize: function (config) {
this._super();
this.createModal = _.once(this.createModal);
this.isDetailView = ko.observable(false);
this.currentCategory = ko.observable('');
_.each(this.categories, function (category) {
if (prCookieConsentApi.isAllowedCategory(category.key) || this.isPreChecked(category.key)) {
this.selectedCategories.push(category.key);
}
category.categoryVisible = ko.observable(false);
category.detailVisible = ko.observable(true);
}.bind(this));
this.initOpenCookieSettingsLinks('pr-open-cookie-settings');
prCookieConsentApi.consent.addCallback(this.reset.bind(this));
},
reset: function () {
this.isDetailView(false)
var categories = [];
_.each(this.categories, function (category) {
categories.push(category.key);
category.categoryVisible(false);
category.detailVisible(true);
}.bind(this));
_.each(
document.getElementById('pr-cookie-setting-bar').querySelectorAll('input[type="checkbox"]'),
function (checkbox) {
var categoryKey = checkbox.name;
if (! categories.includes(categoryKey)) {
return;
}
var shouldBeChecked = prCookieConsentApi.isAllowedCategory(categoryKey)
|| this.isPreChecked(categoryKey);
if (Boolean(shouldBeChecked) !== Boolean(checkbox.checked)) {
checkbox.checked = ! checkbox.checked;
}
}.bind(this)
)
},
isAllowed: function (categoryKey) {
return prCookieConsentApi.isAllowedCategory(categoryKey) || this.isPreChecked(categoryKey);
},
isPreChecked: function (categoryKey) {
return ! prCookieConsentApi.isOptIn() && this.getCategoryByKey(categoryKey).is_pre_checked;
},
/**
* Save Choices
*/
confirmChosen: function () {
prCookieConsentApi.consent.set(this.selectedCategories);
this.closeNotice();
this.getModal().closeModal();
},
/**
* Toggle is allowed category in local variable, to save chooses - use "this.confirmChosen"
*
* @param uiClass
* @param {jQuery.Event} jQueryEvent
*/
toggleSelectedCategory: function (uiClass, jQueryEvent) {
/** @type {HTMLInputElement} input */
var input = jQueryEvent.target;
var categoryKey = input.name;
if (input.checked) {
if (! this.selectedCategories.includes(categoryKey)) {
this.selectedCategories.push(categoryKey);
}
} else {
this.selectedCategories = _.without(this.selectedCategories, categoryKey);
}
},
createModal: function () {
var options = {
buttons: [],
};
switch (this.displayStyle) {
case DISPLAY_STYLE_ACCORDION_POPUP:
options = _.extendOwn(options, {
popupTpl: modalPopupTpl,
type: 'popup',
modalClass: 'pr-cookie-details-modal',
canClose: false
});
break;
default:
options = _.extendOwn(options, {
slideTpl: modalSlideTpl,
type: 'slide',
modalClass: 'pr-cookie-left-bar'
});
}
this.modal = modal(options, document.getElementById('pr-cookie-setting-bar'));
this.addChangingStyleOnHover($('#pr-cookie-setting-bar .action.confirm'), this.confirmButtonConfig);
this.addChangingStyleOnHover($('#pr-cookie-setting-bar .action.allow'), this.acceptButtonConfig);
this.addChangingStyleOnHover($('#pr-cookie-setting-bar .action.decline'), this.declineButtonConfig);
},
getModal: function () {
this.createModal();
return this.modal;
},
closeNotice: function () {
uiRegistry.get('pr-cookie-notice').getModal().closeModal();
},
/**
* @param $button
* @param {{type, text_color, text_color_on_hover, background_color, background_color_on_hover}} config
*/
addChangingStyleOnHover: function ($button, config) {
$button.on({
mouseenter: function () {
$(this).css({
'background-color': null !== config.background_color_on_hover ? config.background_color_on_hover : '',
'border-color': null !== config.background_color_on_hover ? config.background_color_on_hover : '',
'color': null !== config.text_color_on_hover ? config.text_color_on_hover : ''
})
},
mouseleave: function () {
$(this).css({
'background-color': null !== config.background_color ? config.background_color : '',
'border-color': null !== config.background_color ? config.background_color : '',
'color': null !== config.text_color ? config.text_color : ''
});
}
});
},
allowAll: function () {
prCookieConsentApi.consent.allowAllCategories();
this.closeNotice();
this.getModal().closeModal();
},
declineAll: function () {
prCookieConsentApi.consent.declineAll();
this.closeNotice();
this.getModal().closeModal();
},
showCookieDetails: function (uiClass, jQueryEvent) {
this.currentCategory(jQueryEvent.target.dataset.categoryKey);
this.isDetailView(true);
},
hideCookieDetails: function () {
this.isDetailView(false);
},
/**
* Get category by key
*
* @param {string} categoryKey
* @return {{}}
*/
getCategoryByKey: function (categoryKey) {
return _.find(this.categories, function (category) {
return category.key === categoryKey;
});
},
/**
* Get category name by key
*
* @param {string} categoryKey
* @return {string}
*/
getCategoryNameByKey: function (categoryKey) {
var category = this.getCategoryByKey(categoryKey);
return category ? category.name : categoryKey;
},
/**
* @param {string} categoryKey
* @return {[]}
*/
getGroupedCookies: function (categoryKey) {
var firstPartyCookies = [];
var thirdPartyCookies = [];
var result = [];
this.cookies.forEach(function (cookie) {
if (cookie.category_key === categoryKey) {
if (cookie.type === 'first') {
firstPartyCookies.push(cookie);
} else {
thirdPartyCookies.push(cookie);
}
}
});
if (firstPartyCookies.length > 0) {
result.push(
{
name: $.mage.__('First party'),
cookies: firstPartyCookies,
checkThirdParty: thirdPartyCookies.length > 0
}
);
}
var groupdThirdPartyCookies = thirdPartyCookies.reduce(function (cookiesByDomain, cookie) {
if (!cookiesByDomain[cookie.domain]) {
cookiesByDomain[cookie.domain] = [];
}
cookiesByDomain[cookie.domain].push(cookie);
return cookiesByDomain;
}, {});
_.each(groupdThirdPartyCookies, function (cookiesWithSameDomain) {
result.push({
name: cookiesWithSameDomain[0].domainLabel,
cookies: cookiesWithSameDomain,
checkThirdParty: thirdPartyCookies.length > 0
});
});
return result;
},
/**
* @param {string} categoryKey
* @return {boolean}
*/
isCategoryHasCookie: function (categoryKey) {
return _.some(this.cookies, function (cookie) {
return cookie.category_key === categoryKey;
});
},
closeModal: function () {
this.getModal().closeModal();
},
/**
* Add event listener to show this component (Settings Panel)
*
* We have added this logic to component to avoid separate js file loading
*
* @param openSettingsClass
*/
initOpenCookieSettingsLinks(openSettingsClass) {
$('body').on('click', function (event) {
if (event.target.classList.contains(openSettingsClass)) {
this.getModal().openModal();
}
}.bind(this));
},
toggleAccordion: function () {
this.categoryVisible(!this.categoryVisible())
},
toggleAccordionCookieDetails: function (data) {
this.detailVisible(!this.detailVisible());
},
});
});
@@ -0,0 +1,37 @@
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
define([
'jquery',
'prCookieConsentApi'
], function ($, prCookieConsentApi) {
'use strict';
/**
* @param {{
* categoryKey: string
* }} config
*/
return function (config) {
function changeNoCookieDomain()
{
var youtubeNoCookieIframes = $('iframe').filter(function () {
return this.src.indexOf('youtube-nocookie.com') !== -1;
});
youtubeNoCookieIframes.each(function (index, iframe) {
iframe.src = iframe.src.replace('youtube-nocookie.com', 'youtube.com');
});
}
prCookieConsentApi.userScript.execute(
function () {
changeNoCookieDomain(config);
},
config.categoryKey
);
}
});
@@ -0,0 +1,61 @@
<!--
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
-->
<div id="pr-cookie-notice" afterRender="autoOpen()">
<div class="pr-cookie-notice-wrap">
<div class="pr-cookie-notice-text"
data-bind="html: noticeTextHtml"
></div>
<div class="actions pr-cookie-notice-actions">
<button click="allowAll" id="btn-cookie-allow" class="action allow primary pr-cookie-notice-btn"
data-bind="style: {
color: acceptButtonConfig.text_color,
backgroundColor: acceptButtonConfig.background_color,
borderColor: acceptButtonConfig.background_color
}"
>
<translate args="acceptButtonConfig.label"></translate>
</button>
<button click="declineAll" id="btn-cookie-decline" class="action decline pr-cookie-notice-btn" if="declineButtonConfig.enabled"
data-bind="style: {
color: declineButtonConfig.text_color,
backgroundColor: declineButtonConfig.background_color,
borderColor: declineButtonConfig.background_color
}"
>
<translate args="declineButtonConfig.label"></translate>
</button>
<button click="openSettings" class="action pr-cookie-notice-btn pr-cookie-setting-btn" if="settingsButtonConfig.enabled"
data-bind="css: {
'setting-link': settingsButtonConfig.type == 'link'
},
style: {
color: settingsButtonConfig.type === 'button' ? settingsButtonConfig.text_color : settingsButtonConfig.link_color,
backgroundColor: settingsButtonConfig.type === 'button' ? settingsButtonConfig.background_color : '',
borderColor: settingsButtonConfig.background_color
}"
>
<translate args="settingsButtonConfig.label"></translate>
</button>
</div>
</div>
<!-- ko if: getDisplayStyle() === 'bottom' -->
<button class="pr-cookie-close-modal" data-bind="click: disableNotice" aria-label="Close notice"></button>
<!-- /ko -->
</div>
@@ -0,0 +1,32 @@
<!--
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
-->
<aside role="dialog"
class="modal-<%- data.type %> <%- data.modalClass %>
<% if(data.innerScroll){ %><%- data.innerScrollClass %><% } %>"
<% if(data.title){ %> aria-labelledby="modal-title-<%- data.id %>"<% } %>
aria-describedby="modal-content-<%- data.id %>"
data-role="modal"
data-type="<%- data.type %>"
tabindex="0">
<div data-role="focusable-start" tabindex="0"></div>
<div class="modal-inner-wrap" data-role="focusable-scope">
<div id="modal-content-<%- data.id %>" class="modal-content" data-role="content"></div>
</div>
<div data-role="focusable-end" tabindex="123"></div>
</aside>
@@ -0,0 +1,71 @@
<!--
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
-->
<aside role="dialog"
class="modal-<%- data.type %> <%- data.modalClass %>
<% if(data.responsive){ %><%- data.responsiveClass %><% } %>
<% if(data.innerScroll){ %><%- data.innerScrollClass %><% } %>"
<% if(data.title){ %> aria-labelledby="modal-title-<%- data.id %>"<% } %>
aria-describedby="modal-content-<%- data.id %>"
data-role="modal"
data-type="<%- data.type %>"
tabindex="0">
<div data-role="focusable-start" tabindex="0"></div>
<div class="modal-inner-wrap"
data-role="focusable-scope">
<header class="modal-header">
<% if(data.title || data.subTitle){ %>
<h1 id="modal-title-<%- data.id %>" class="modal-title"
data-role="title">
<% if(data.title){ %>
<%= data.title %>
<% } %>
<% if(data.subTitle){ %>
<span class="modal-subtitle"
data-role="subtitle">
<%= data.subTitle %>
</span>
<% } %>
</h1>
<% if(data.canClose){ %>
<button
class="pr-cookie-close"
data-role="closeBtn"
type="button">
</button>
<% } %>
<% } %>
</header>
<div id="modal-content-<%- data.id %>"
class="modal-content"
data-role="content"></div>
<% if(data.buttons.length > 0){ %>
<footer class="modal-footer">
<% _.each(data.buttons, function(button) { %>
<button
class="<%- button.class %>"
type="button"
data-role="action"><span><%= button.text %></span></button>
<% }); %>
</footer>
<% } %>
</div>
<div data-role="focusable-end" tabindex="0"></div>
</aside>
@@ -0,0 +1,184 @@
<!--
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
-->
<div id="pr-cookie-setting-bar" afterRender="createModal()">
<div class="pr-cookie-setting-bar-wrap">
<button class="pr-cookie-close" click="closeModal" type="button" aria-label="close popup"></button>
<div class="pr-cookie-detail-view">
<h3 class="pr-cookie-title" data-bind="text: overview.title"></h3>
<div class="pr-cookie-description" data-bind="html: overview.text"></div>
<div class="pr-actions-buttons">
<button click="allowAll" class="action allow primary" type="button" data-role="action"
data-bind="style: {
color: acceptButtonConfig.text_color,
backgroundColor: acceptButtonConfig.background_color,
borderColor: acceptButtonConfig.background_color
}, text: acceptButtonConfig.label"
></button>
<button click="declineAll" class="action decline" type="button" data-role="action" if="declineButtonConfig.enabled"
data-bind="style: {
color: declineButtonConfig.text_color,
backgroundColor: declineButtonConfig.background_color,
borderColor: declineButtonConfig.background_color
}, text: declineButtonConfig.label"
></button>
</div>
<h3 class="pr-cookie-manage-title" data-bind="text: consentPreferences.header"></h3>
<ul class="message-system-list">
<li repeat="foreach: categories, item: 'category'">
<div data-bind="css: {'category-open': category().categoryVisible}" class="accordion-title">
<div class="pr-cookie-option" data-bind="click: toggleAccordion.bind(category())">
<strong class="option-label" data-bind="text: category().name"></strong>
<if args="category().is_essential">
<strong class="option-status" data-bind="text: consentPreferences.essential_category_status"></strong>
</if>
<ifnot args="category().is_essential">
<div class="pr-cookie-switch" data-role="switcher"
data-bind="click: function(){return true}, clickBubble: false">
<label class="switch-label" aria-label="Switch">
<input type="checkbox"
data-bind="
attr: {name: category().key},
checked: isAllowed(category().key),
event: {change: toggleSelectedCategory}
">
<div class="switch-area">
<div class="switch-nob"></div>
</div>
</label>
</div>
</ifnot>
</div>
<div class="first-details" data-bind="attr:{'open': category().detailVisible}">
<div class="pr-cookie-category-descrip" data-bind="text: category().description"></div>
<if args="canShowCookieDetails">
<div class="lvl1">
<span class="pr-cookie-details"
data-bind="
text: consentPreferences.cookie_details_link,
attr: {'data-category-key': category().key}"
>
</span>
<span class="pr-cookie-details_line"></span>
</div>
<div class="second-details">
<div if="category().detailVisible()">
<div class="pr-cookie-view">
<div class="pr-cookies-list">
<if args="isCategoryHasCookie(category().key)">
<div class="pr-cookie-item"
repeat="foreach: getGroupedCookies(category().key), item: 'group'">
<if args="$data.checkThirdParty">
<details class="pr-cookie-details-info">
<summary>
<h4 class="pr-cookie-details-title" data-bind="i18n: group().name"></h4>
</summary>
<div class="pr-cookie-group-wrp"
repeat="foreach: group().cookies, item: 'cookie'">
<div class="pr-cookie-group">
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Name'"></span>
<span class="pr-cookie-property-value"
data-bind="text: cookie().name, attr: {title: cookie().name}"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property"
data-bind="i18n: 'Domain'"></span>
<span class="pr-cookie-property-value"
data-bind="text: cookie().domainLabel, attr: {title: cookie().domainLabel}"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property"
data-bind="i18n: 'Duration'"></span>
<span class="pr-cookie-property-value"
data-bind="text: cookie().durationLabel"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Type'"></span>
<span data-bind="text: cookie().typeLabel"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Category'"></span>
<span data-bind="text: getCategoryNameByKey(cookie().category_key)"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Description'"></span>
<span data-bind="text: cookie().description"></span>
</div>
</div>
</div>
</details>
</if>
<ifnot args="$data.checkThirdParty">
<details class="pr-cookie-details-info" open>
<summary>
<h4 class="pr-cookie-details-title" data-bind="i18n: group().name"></h4>
</summary>
<div class="pr-cookie-group-wrp"
repeat="foreach: group().cookies, item: 'cookie'">
<div class="pr-cookie-group">
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Name'"></span>
<span class="pr-cookie-property-value"
data-bind="text: cookie().name, attr: {title: cookie().name}"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property"
data-bind="i18n: 'Domain'"></span>
<span class="pr-cookie-property-value"
data-bind="text: cookie().domainLabel, attr: {title: cookie().domainLabel}"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property"
data-bind="i18n: 'Duration'"></span>
<span class="pr-cookie-property-value"
data-bind="text: cookie().durationLabel"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Type'"></span>
<span data-bind="text: cookie().typeLabel"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Category'"></span>
<span data-bind="text: getCategoryNameByKey(cookie().category_key)"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Description'"></span>
<span data-bind="text: cookie().description"></span>
</div>
</div>
</div>
</details>
</ifnot>
</div>
</if>
<p ifnot="isCategoryHasCookie(category().key)">
<translate args="'There are no cookies.'"></translate>
</p>
</div>
</div>
</div>
</div>
</if>
</div>
</div>
</li>
</ul>
</div>
<button class="action confirm primary" click="confirmChosen"
data-bind="
style: {
color: confirmButtonConfig.text_color,
backgroundColor: confirmButtonConfig.background_color,
borderColor: confirmButtonConfig.background_color
},
text: confirmButtonConfig.label">
</button>
</div>
</div>
@@ -0,0 +1,154 @@
<!--
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
-->
<div id="pr-cookie-setting-bar" afterRender="createModal()">
<div class="pr-cookie-setting-bar-wrap">
<button class="pr-cookie-close" click="closeModal" type="button" aria-label="close popup"></button>
<div class="pr-cookie-detail-view" data-bind="visible: ! isDetailView()">
<h3 class="pr-cookie-title" data-bind="text: overview.title"></h3>
<div class="pr-cookie-description" data-bind="html: overview.text"></div>
<div class="pr-actions-buttons">
<button click="allowAll" class="action allow primary" type="button" data-role="action"
data-bind="style: {
color: acceptButtonConfig.text_color,
backgroundColor: acceptButtonConfig.background_color,
borderColor: acceptButtonConfig.background_color
}, text: acceptButtonConfig.label"
></button>
<button click="declineAll" class="action decline" type="button" data-role="action" if="declineButtonConfig.enabled"
data-bind="style: {
color: declineButtonConfig.text_color,
backgroundColor: declineButtonConfig.background_color,
borderColor: declineButtonConfig.background_color
}, text: declineButtonConfig.label"
></button>
</div>
<h3 class="pr-cookie-manage-title" data-bind="text: consentPreferences.header"></h3>
<ul class="message-system-list">
<li repeat="foreach: categories, item: 'category'">
<div class="pr-cookie-option">
<strong class="option-label">
<text args="category().name"></text>
</strong>
<if args="category().is_essential">
<strong class="option-status" data-bind="text: consentPreferences.essential_category_status"></strong>
</if>
<ifnot args="category().is_essential">
<div class="pr-cookie-switch" data-role="switcher">
<label class="switch-label" aria-label="Switch">
<input type="checkbox"
data-bind="
attr: {name: category().key},
checked: isAllowed(category().key),
event: {change: toggleSelectedCategory}
">
<div class="switch-area">
<div class="switch-nob"></div>
</div>
</label>
</div>
</ifnot>
</div>
<div class="pr-cookie-category-descrip">
<text args="category().description"></text>
</div>
<button if="canShowCookieDetails" class="pr-cookie-details"
data-bind="
text: consentPreferences.cookie_details_link,
attr: {'data-category-key': category().key},
click: showCookieDetails"
>
</button>
</li>
</ul>
</div>
<div if="isDetailView()">
<div class="pr-cookie-view">
<div class="pr-cookie-view-wrap">
<div class="pr-cookie-view-top">
<button class="pr-cookie-view-back" data-bind="
i18n: 'Back',
click: hideCookieDetails"
>
</button>
<strong data-bind="text: getCategoryNameByKey(currentCategory())"></strong>
</div>
<h3 class="pr-cookie-view-title" data-bind="i18n: 'Cookies List'"></h3>
</div>
<div class="pr-cookies-list">
<div class="pr-cookie-item" if="isCategoryHasCookie(currentCategory())" repeat="foreach: getGroupedCookies(currentCategory()), item: 'group'">
<details class="pr-cookie-details-info">
<summary>
<h4 class="pr-cookie-details-title" data-bind="i18n: group().name"></h4>
<span class="pr-cookie-group-view" data-bind="i18n: 'View Cookies'"></span>
</summary>
<div class="pr-cookie-group" repeat="foreach: group().cookies, item: 'cookie'">
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Name'"></span>
<span
class="pr-cookie-property-value"
data-bind="
text: cookie().name,
attr: {title: cookie().name}"
>
</span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Domain'"></span>
<span
class="pr-cookie-property-value"
data-bind="
text: cookie().domainLabel,
attr: {title: cookie().domainLabel}"
>
</span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Duration'"></span>
<span
class="pr-cookie-property-value"
data-bind="text: cookie().durationLabel"
>
</span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Type'"></span>
<span data-bind="text: cookie().typeLabel"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Category'"></span>
<span data-bind="text: getCategoryNameByKey(cookie().category_key)"></span>
</div>
<div class="pr-cookie-group-row">
<span class="pr-cookie-property" data-bind="i18n: 'Description'"></span>
<span data-bind="text: cookie().description"></span>
</div>
</div>
</details>
</div>
<p ifnot="isCategoryHasCookie(currentCategory())">
<translate args="'There are no cookies.'"></translate>
</p>
</div>
</div>
</div>
<button class="action confirm primary" click="confirmChosen"
data-bind="style: {
color: confirmButtonConfig.text_color,
backgroundColor: confirmButtonConfig.background_color,
borderColor: confirmButtonConfig.background_color
}, text: confirmButtonConfig.label"
></button>
</div>
</div>
@@ -0,0 +1,36 @@
<!--
/**
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
-->
<aside role="dialog"
class="modal-<%- data.type %> <%- data.modalClass %>
<% if(data.responsive){ %><%- data.responsiveClass %><% } %>
<% if(data.innerScroll){ %><%- data.innerScrollClass %><% } %>"
<% if(data.title){ %> aria-labelledby="modal-title-<%- data.id %>"<% } %>
aria-describedby="modal-content-<%- data.id %>"
data-role="modal"
data-type="<%- data.type %>"
tabindex="0">
<div data-role="focusable-start" tabindex="0"></div>
<div class="modal-inner-wrap"
data-role="focusable-scope">
<div id="modal-content-<%- data.id %>"
class="modal-content"
data-role="content"></div>
<% if(data.buttons.length > 0){ %>
<footer class="modal-footer">
<% _.each(data.buttons, function(button) { %>
<button
class="<%- button.class %>"
type="button"
data-role="action"><span><%= button.text %></span></button>
<% }); %>
</footer>
<% } %>
</div>
<div data-role="focusable-end" tabindex="0"></div>
</aside>
@@ -0,0 +1,33 @@
<!--
/**
* Plumrocket Inc.
*
* NOTICE OF LICENSE
*
* This source file is subject to the End-user License Agreement
* that is available through the world-wide-web at this URL:
* http://wiki.plumrocket.net/wiki/EULA
* If you are unable to obtain it through the world-wide-web, please
* send an email to support@plumrocket.com so we can send you a copy immediately.
*
* @package Plumrocket_CookieConsent
* @copyright Copyright (c) 2020 Plumrocket Inc. (http://www.plumrocket.com)
* @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
*/
-->
<aside role="dialog"
class="modal-<%- data.type %> <%- data.modalClass %>
<% if(data.innerScroll){ %><%- data.innerScrollClass %><% } %>"
<% if(data.title){ %> aria-labelledby="modal-title-<%- data.id %>"<% } %>
aria-describedby="modal-content-<%- data.id %>"
data-role="modal"
data-type="<%- data.type %>"
tabindex="0">
<div data-role="focusable-start" tabindex="0"></div>
<div class="modal-inner-wrap"
data-role="focusable-scope">
<div id="modal-content-<%- data.id %>" class="modal-content" data-role="content"></div>
</div>
<div data-role="focusable-end" tabindex="0"></div>
</aside>