File manager - Edit - /home/opticamezl/www/newok/theme-cookie.zip
Back
PK պ�\' n�Y Y src/Listener/LoadThemeHead.phpnu �[��� <?php namespace YOOtheme\Theme\Cookie\Listener; use YOOtheme\Config; use YOOtheme\Metadata; use YOOtheme\Path; use YOOtheme\View; class LoadThemeHead { public View $view; public Config $config; public Metadata $metadata; public function __construct(Config $config, Metadata $metadata, View $view) { $this->view = $view; $this->config = $config; $this->metadata = $metadata; } public function handle() { if (!($mode = $this->config->get('~theme.cookie.mode'))) { return; } $this->config->set('theme.data.cookie', [ 'mode' => $mode, 'template' => trim($this->view->render('~theme/templates/cookie')), 'position' => $this->config->get('~theme.cookie.bar_position'), ]); if (!$this->config->get('app.isCustomizer')) { if ($custom = $this->config->get('~theme.cookie.custom_js')) { $this->metadata->set( 'script:cookie-custom', "(window.\$load ||= []).push(function(c,n) {try {{$custom}\n} catch (e) {console.error(e)} n()});\n", ); } $this->metadata->set('script:cookie', [ 'src' => Path::get('../../app/cookie.min.js', __DIR__), 'defer' => true, ]); } } } PK պ�\ń_�� � app/cookie.min.jsnu �[��� /*! YOOtheme Pro v4.5.33 | https://yootheme.com */ (function(s){"use strict";typeof SuppressedError=="function"&&SuppressedError;function i(n,o){return Object.prototype.hasOwnProperty.call(n,o)}function f(n){return n.replace(/[.*+?^$|[\](){}\\-]/g,"\\$&")}function l(n){var o=n.charAt(n.length-1),t=parseInt(n,10),e=new Date;switch(o){case"Y":e.setFullYear(e.getFullYear()+t);break;case"M":e.setMonth(e.getMonth()+t);break;case"D":e.setDate(e.getDate()+t);break;case"h":e.setHours(e.getHours()+t);break;case"m":e.setMinutes(e.getMinutes()+t);break;case"s":e.setSeconds(e.getSeconds()+t);break;default:e=new Date(n)}return e}function p(n){for(var o="",t=0,e=Object.keys(n);t<e.length;t++){var r=e[t];if(/^expires$/i.test(r)){var a=n[r],c=void 0;typeof a=="object"?c=a:(a+=typeof a=="number"?"D":"",c=l(String(a))),o+=";".concat(r,"=").concat(c.toUTCString())}else/^secure|partitioned$/.test(r)?n[r]&&(o+=";".concat(r)):o+=";".concat(r,"=").concat(n[r])}return i(n,"path")||(o+=";path=/"),o}function v(n,o){o===void 0&&(o=decodeURIComponent);var t=new RegExp("(?:^|; )".concat(f(n),"(?:=([^;]*))?(?:;|$)")),e=t.exec(document.cookie);return e===null?null:typeof o=="function"?o(e[1]):e[1]}function g(n,o,t,e){t===void 0&&(t=encodeURIComponent),typeof t=="object"&&t!==null&&(e=t,t=encodeURIComponent);var r=p(e||{}),a=typeof t=="function"?t(o):o,c="".concat(n,"=").concat(a).concat(r);document.cookie=c}(window.$load||(window.$load=[])).unshift(({cookie:{mode:n,template:o,position:t}={}},e)=>{const r="_cookieAllowed",a=v(r);(a==="true"||n==="notification")&&e(),a===null&&s.once((t==="top"?s.prepend:s.append)(document.body,o),"click","[data-uk-toggle]",({target:c})=>{const u=!s.hasClass(c,"js-reject");g(r,u,{expires:"1M"}),u&&n!=="notification"&&e()})})})(UIkit.util); PK պ�\�.6 6 config/customizer.jsonnu �[��� { "panels": { "cookie": { "title": "Cookie Banner", "width": 500, "fields": { "cookie.mode": { "label": "Cookie Banner", "description": "Show a banner to inform your visitors of cookies used by your website. Choose between a simple notification that cookies are loaded or require a mandatory consent before loading cookies.", "type": "select", "options": { "Disabled": "", "As notification only ": "notification", "With mandatory consent": "consent" } }, "cookie.type": { "label": "Type", "description": "Choose between an attached bar or a notification.", "type": "select", "options": { "Bar": "bar", "Notification": "notification" }, "enable": "cookie.mode" }, "cookie.bar_position": { "label": "Position", "description": "The bar at the top pushes the content down while the bar at the bottom is fixed above the content.", "type": "select", "options": { "Top": "top", "Bottom": "bottom" }, "show": "cookie.type == 'bar'", "enable": "cookie.mode" }, "cookie.bar_style": { "label": "Style", "type": "select", "options": { "Default": "default", "Muted": "muted", "Primary": "primary", "Secondary": "secondary" }, "show": "cookie.type == 'bar'", "enable": "cookie.mode" }, "cookie.notification_position": { "label": "Position", "type": "select", "options": { "Bottom Left": "bottom-left", "Bottom Center": "bottom-center", "Bottom Right": "bottom-right" }, "show": "cookie.type == 'notification'", "enable": "cookie.mode" }, "cookie.notification_style": { "label": "Style", "type": "select", "options": { "Default": "", "Primary": "primary", "Warning": "warning", "Danger": "danger" }, "show": "cookie.type == 'notification'", "enable": "cookie.mode" }, "cookie.message": { "label": "Content", "description": "Enter the cookie consent message. The default text serves as illustration. Please adjust it according to the cookie laws of your country.", "type": "editor", "editor": "visual", "enable": "cookie.mode" }, "cookie.button_consent_style": { "label": "Consent Button Style", "type": "select", "options": { "Close Icon": "icon", "Button Default": "default", "Button Primary": "primary", "Button Secondary": "secondary", "Button Text": "text" }, "enable": "cookie.mode" }, "cookie.button_consent_text": { "label": "Consent Button Text", "description": "Enter the text for the button.", "enable": "cookie.mode && cookie.button_consent_style != 'icon'" }, "cookie.button_reject_style": { "label": "Reject Button Style", "type": "select", "options": { "Button Default": "default", "Button Primary": "primary", "Button Secondary": "secondary", "Button Text": "text" }, "enable": "cookie.mode == 'consent'" }, "cookie.button_reject_text": { "label": "Reject Button Text", "description": "Enter the text for the button.", "enable": "cookie.mode == 'consent'" }, "cookie.custom_js": { "label": "Cookie Scripts", "description": "Add custom JavaScript which sets cookies. It will be loaded after consent is given. The <code><script></code> tag is not needed.", "type": "editor", "editor": "code", "mode": "javascript", "enable": "cookie.mode == 'consent'" } } } } } PK պ�\]��^� � config/theme.jsonnu �[��� { "defaults": { "cookie": { "type": "bar", "bar_position": "bottom", "bar_style": "muted", "notification_position": "bottom-center", "message": "By using this website, you agree to the use of cookies as described in our Privacy Policy.", "button_consent_style": "icon", "button_consent_text": "Ok", "button_reject_style": "default", "button_reject_text": "No, Thanks" } } } PK պ�\��_< bootstrap.phpnu �[��� <?php namespace YOOtheme\Theme\Cookie; use YOOtheme\Config; return [ 'theme' => function (Config $config) { return $config->loadFile(__DIR__ . '/config/theme.json'); }, 'events' => ['theme.head' => [Listener\LoadThemeHead::class => '@handle']], ]; PK պ�\' n�Y Y src/Listener/LoadThemeHead.phpnu �[��� PK պ�\ń_�� � � app/cookie.min.jsnu �[��� PK պ�\�.6 6 � config/customizer.jsonnu �[��� PK պ�\]��^� � P"