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>
尋找差異