Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
cookies.phtml
创建于
3年前
差异永不过期
清除
导出
分享
解释
1 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
75 行
全部复制
1 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
75 行
全部复制
<?php
<?php
/**
/**
* Hyvä Themes - https://hyva.io
* Hyvä Themes - https://hyva.io
* Copyright © Hyvä Themes 2020-present. All rights reserved.
* Copyright © Hyvä Themes 2020-present. All rights reserved.
* This product is licensed per Magento install
* This product is licensed per Magento install
* See https://hyva.io/license
* See https://hyva.io/license
*/
*/
declare(strict_types=1);
declare(strict_types=1);
/** @var \Magento\Framework\View\Element\Template $block */
/** @var \Magento\Framework\View\Element\Template $block */
?>
?>
<script>
<script>
'use strict';
'use strict';
function dispatchMessages(messages, hideAfter) {
function dispatchMessages(messages, hideAfter) {
const messagesEvent = new CustomEvent("messages-loaded", {
const messagesEvent = new CustomEvent("messages-loaded", {
detail: {
detail: {
messages: messages,
messages: messages,
hideAfter: hideAfter
hideAfter: hideAfter
}
}
});
});
window.dispatchEvent(messagesEvent);
window.dispatchEvent(messagesEvent);
}
}
<?php
<?php
/**
/**
* The `hyva` JS namespace is being set by Hyva_Theme/src/view/frontend/templates/page/js/hyva.phtml
* The `hyva` JS namespace is being set by Hyva_Theme/src/view/frontend/templates/page/js/hyva.phtml
* and should be included through Hyva_Theme/src/view/frontend/layout/default_hyva.xml
* and should be included through Hyva_Theme/src/view/frontend/layout/default_hyva.xml
*/
*/
?>
?>
if (typeof hyva === 'undefined' || (!hyva.getBrowserStorage || !hyva.getCookie || !hyva.setCookie)) {
if (typeof hyva === 'undefined' || (!hyva.getBrowserStorage || !hyva.getCookie || !hyva.setCookie)) {
console.warn("Hyvä helpers are not loaded yet. Make sure they are included before this script");
console.warn("Hyvä helpers are not loaded yet. Make sure they are included before this script");
}
}
(function( hyva, undefined ) {
(function( hyva, undefined ) {
hyva.initFormKey = () => {
hyva.initFormKey = () => {
const inputSelector = 'input[name="form_key"]',
const inputSelector = 'input[name="form_key"]',
formKey = hyva.getFormKey();
formKey = hyva.getFormKey();
Array.from(document.querySelectorAll(inputSelector)).map(function (input) {
Array.from(document.querySelectorAll(inputSelector)).map(function (input) {
input.value = formKey
input.value = formKey
});
});
}
}
hyva.initMessages = () => {
hyva.initMessages = () => {
try {
try {
const messages = hyva.getCookie('mage-messages');
const messages = hyva.getCookie('mage-messages');
window.mageMessages = messages ? JSON.parse(decodeURIComponent(messages).replace(/\+/g, ' ')) : [];
window.mageMessages = messages ? JSON.parse(decodeURIComponent(messages).replace(/\+/g, ' ')) : [];
dispatchMessages(window.mageMessages);
dispatchMessages(window.mageMessages);
<?php
<?php
/**
/**
* In \Magento\Theme\Controller\Result\MessagePlugin::setCookie
* In \Magento\Theme\Controller\Result\MessagePlugin::setCookie
* the cookie-domain is not set. Therefore, we need to skip it
* the cookie-domain is not set. Therefore, we need to skip it
* here as well.
* here as well.
*/
*/
?>
?>
// empty `mage-messages` cookie
// empty `mage-messages` cookie
const skipSetDomain = true;
const skipSetDomain = true;
hyva.setCookie('mage-messages','', -1, skipSetDomain);
hyva.setCookie('mage-messages','', -1, skipSetDomain);
} catch (error) {
} catch (error) {
console.warn('Error parsing Cookie Messages:', error);
console.warn('Error parsing Cookie Messages:', error);
}
}
}
}
window.addEventListener('DOMContentLoaded', hyva.initFormKey);
window.addEventListener('DOMContentLoaded', hyva.initFormKey);
复制
已复制
复制
已复制
window.addEventListener('
load
', hyva.initMessages);
window.addEventListener('
alpine:initialized
', hyva.initMessages);
}( window.hyva = window.hyva || {} ));
}( window.hyva = window.hyva || {} ));
</script>
</script>
已保存差异
原始文本
打开文件
<?php /** * Hyvä Themes - https://hyva.io * Copyright © Hyvä Themes 2020-present. All rights reserved. * This product is licensed per Magento install * See https://hyva.io/license */ declare(strict_types=1); /** @var \Magento\Framework\View\Element\Template $block */ ?> <script> 'use strict'; function dispatchMessages(messages, hideAfter) { const messagesEvent = new CustomEvent("messages-loaded", { detail: { messages: messages, hideAfter: hideAfter } }); window.dispatchEvent(messagesEvent); } <?php /** * The `hyva` JS namespace is being set by Hyva_Theme/src/view/frontend/templates/page/js/hyva.phtml * and should be included through Hyva_Theme/src/view/frontend/layout/default_hyva.xml */ ?> if (typeof hyva === 'undefined' || (!hyva.getBrowserStorage || !hyva.getCookie || !hyva.setCookie)) { console.warn("Hyvä helpers are not loaded yet. Make sure they are included before this script"); } (function( hyva, undefined ) { hyva.initFormKey = () => { const inputSelector = 'input[name="form_key"]', formKey = hyva.getFormKey(); Array.from(document.querySelectorAll(inputSelector)).map(function (input) { input.value = formKey }); } hyva.initMessages = () => { try { const messages = hyva.getCookie('mage-messages'); window.mageMessages = messages ? JSON.parse(decodeURIComponent(messages).replace(/\+/g, ' ')) : []; dispatchMessages(window.mageMessages); <?php /** * In \Magento\Theme\Controller\Result\MessagePlugin::setCookie * the cookie-domain is not set. Therefore, we need to skip it * here as well. */ ?> // empty `mage-messages` cookie const skipSetDomain = true; hyva.setCookie('mage-messages','', -1, skipSetDomain); } catch (error) { console.warn('Error parsing Cookie Messages:', error); } } window.addEventListener('DOMContentLoaded', hyva.initFormKey); window.addEventListener('load', hyva.initMessages); }( window.hyva = window.hyva || {} )); </script>
更改后文本
打开文件
<?php /** * Hyvä Themes - https://hyva.io * Copyright © Hyvä Themes 2020-present. All rights reserved. * This product is licensed per Magento install * See https://hyva.io/license */ declare(strict_types=1); /** @var \Magento\Framework\View\Element\Template $block */ ?> <script> 'use strict'; function dispatchMessages(messages, hideAfter) { const messagesEvent = new CustomEvent("messages-loaded", { detail: { messages: messages, hideAfter: hideAfter } }); window.dispatchEvent(messagesEvent); } <?php /** * The `hyva` JS namespace is being set by Hyva_Theme/src/view/frontend/templates/page/js/hyva.phtml * and should be included through Hyva_Theme/src/view/frontend/layout/default_hyva.xml */ ?> if (typeof hyva === 'undefined' || (!hyva.getBrowserStorage || !hyva.getCookie || !hyva.setCookie)) { console.warn("Hyvä helpers are not loaded yet. Make sure they are included before this script"); } (function( hyva, undefined ) { hyva.initFormKey = () => { const inputSelector = 'input[name="form_key"]', formKey = hyva.getFormKey(); Array.from(document.querySelectorAll(inputSelector)).map(function (input) { input.value = formKey }); } hyva.initMessages = () => { try { const messages = hyva.getCookie('mage-messages'); window.mageMessages = messages ? JSON.parse(decodeURIComponent(messages).replace(/\+/g, ' ')) : []; dispatchMessages(window.mageMessages); <?php /** * In \Magento\Theme\Controller\Result\MessagePlugin::setCookie * the cookie-domain is not set. Therefore, we need to skip it * here as well. */ ?> // empty `mage-messages` cookie const skipSetDomain = true; hyva.setCookie('mage-messages','', -1, skipSetDomain); } catch (error) { console.warn('Error parsing Cookie Messages:', error); } } window.addEventListener('DOMContentLoaded', hyva.initFormKey); window.addEventListener('alpine:initialized', hyva.initMessages); }( window.hyva = window.hyva || {} )); </script>
查找差异