This commit is contained in:
2025-04-01 00:38:54 +02:00
parent d4d4c0c09d
commit 87da06293a
22351 changed files with 5168854 additions and 7538 deletions

View File

@@ -0,0 +1,157 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a trade license awared by
* Garamo Online L.T.D.
*
* Any use, reproduction, modification or distribution
* of this source file without the written consent of
* Garamo Online L.T.D It Is prohibited.
*
* @author ReactionCode <info@reactioncode.com>
* @copyright 2015-2020 Garamo Online L.T.D
* @license Commercial license
*/
(function() {
'use strict';
// Initialize all user events when DOM ready
document.addEventListener('DOMContentLoaded', initCommonForm, false);
function initCommonForm() {
var formTabs;
var inputsWithSelectInput;
var inputsWithSelectMenu;
formTabs = document.querySelector('#js-form-tabs');
if (formTabs) {
formTabs.addEventListener('click', toggleTabs, false);
}
inputsWithSelectInput = document.querySelectorAll('.js-inputwithselect-input');
if (inputsWithSelectInput) {
inputsWithSelectInput.forEach(function (inputWithSelectNode) {
if (inputWithSelectNode.min || inputWithSelectNode.max) {
inputWithSelectNode.addEventListener('change', inputWithSelectInput, false);
}
});
}
inputsWithSelectMenu = document.querySelectorAll('.js-inputwithselect-menu');
if (inputsWithSelectMenu) {
inputsWithSelectMenu.forEach(function (inputWithSelectNode) {
inputWithSelectNode.addEventListener('click', inputWithSelectMenu, false);
});
}
}
// toggle form tabs
function toggleTabs(event) {
var tabSelectors = ['.js-tab-item'];
var target = delegateEvents(tabSelectors, event.target);
var targetClassList;
var tabsList;
var tabsContent;
if (event.button === 0 && target) {
targetClassList = target.classList;
if (targetClassList.contains('reachable') && !targetClassList.contains('active')) {
tabsList = document.querySelectorAll('.js-tab-item');
tabsContent = document.querySelectorAll('.js-tab-content');
// handle tab column
tabsList.forEach(function (tab) {
if (tab.id === target.id) {
tab.classList.add('active');
} else {
tab.classList.remove('active');
}
});
// handle form values
tabsContent.forEach(function (content) {
if (content.id !== 'js-tab-content-' + target.id) {
content.classList.add('hidden');
} else {
content.classList.remove('hidden');
}
});
}
}
}
// handle imputs with select options
function inputWithSelectMenu(event) {
var optionSelector = ['.js-inputwithselect-option'];
var target = delegateEvents(optionSelector, event.target);
var mainSelector = ['.input-group-btn'];
var mainNode;
var inputNode;
var labelNode;
if (event.button === 0 && target) {
event.preventDefault();
mainNode = delegateEvents(mainSelector, target);
inputNode = mainNode.querySelector('input');
inputNode.value = target.dataset.value;
labelNode = mainNode.querySelector('.js-inputwithselect-label');
labelNode.innerText = target.innerText.trim();
}
}
// handle input limits
function inputWithSelectInput(event) {
var winnerInputNode = event.target;
if (winnerInputNode.max) {
if (Number(winnerInputNode.value) > Number(winnerInputNode.max)) {
winnerInputNode.value = winnerInputNode.max;
}
}
if (winnerInputNode.min) {
if (Number(winnerInputNode.value) < Number(winnerInputNode.min)) {
winnerInputNode.value = winnerInputNode.min;
}
}
}
// JS TOOLS - LIKE JQ CLOSEST
function delegateEvents(selectors, target) {
var matchMode;
if (target) {
// get available browser matches function
matchMode = target.matches || target.webkitMatchesSelector || target.msMatchesSelector;
// get function name (general browsers || iE9)
matchMode = matchMode.name || /function\s+([\w\$]+)\s*\(/.exec(matchMode.toString());
// on iE9 get the name value, empty value on anonymous fn
if (typeof matchMode !== 'string') {
matchMode = matchMode ? matchMode[1] : '';
}
// continue only if we get matches selector function
if (matchMode) {
while (target.parentNode !== null) {
if (target.nodeType === 1) {
// iterate all selectors
for (var i = 0; i < selectors.length; i++) {
// compare if node match with selector
if (target[matchMode](selectors[i])) {
// if match return target
return target;
}
}
}
// if no match or nodeType !== 1 go to parent
target = target.parentNode;
}
}
}
}
})();

View File

@@ -0,0 +1,68 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a trade license awared by
* Garamo Online L.T.D.
*
* Any use, reproduction, modification or distribution
* of this source file without the written consent of
* Garamo Online L.T.D It Is prohibited.
*
* @author ReactionCode <info@reactioncode.com>
* @copyright 2015-2020 Garamo Online L.T.D
* @license Commercial license
*/
(function(){
'use strict';
// Initialize all user events when DOM ready
document.addEventListener('DOMContentLoaded', initConfigForm, false);
function initConfigForm() {
var hidingTimeNode;
var eventValueNodes;
hidingTimeNode = document.querySelector('#RC_PGANALYTICS_SSSR');
hidingTimeNode.addEventListener('input', validateSiteSpeedSampleRate);
eventValueNodes = document.querySelectorAll('.js-event-value');
eventValueNodes.forEach(function(eventValueNode) {
eventValueNode.addEventListener('input', validateEventValue);
});
}
function validateSiteSpeedSampleRate(event) {
var min = 1;
var max = 100;
var isNumber = /^\d+$/;
var inputValue = event.target.value;
if (isNumber.test(inputValue)) {
if (Number(inputValue) > max) {
event.target.value = max;
} else if (Number(inputValue) < min) {
event.target.value = min;
}
} else {
event.target.value = min;
}
}
function validateEventValue(event) {
var min = 0;
var isNumber = /^\d+$/;
var inputValue = event.target.value;
if (isNumber.test(inputValue)) {
if (Number(inputValue) < min) {
event.target.value = min;
}
} else {
event.target.value = min;
}
}
})();

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,185 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a trade license awared by
* Garamo Online L.T.D.
*
* Any use, reproduction, modification or distribution
* of this source file without the written consent of
* Garamo Online L.T.D It Is prohibited.
*
* @author ReactionCode <info@reactioncode.com>
* @copyright 2015-2020 Garamo Online L.T.D
* @license Commercial license
*/
(function() {
'use strict';
// Initialize all user events when DOM ready
document.addEventListener('DOMContentLoaded', initRcGaContentOrder, false);
function initRcGaContentOrder() {
var orderDetailNode;
var detailSentNode;
var detailByNode;
var stStatusMessageNode;
var notSendMessageNode;
var sendButtonNode;
var removeButtonNode;
orderDetailNode = document.querySelector('.js-rcga-order-detail');
detailSentNode = document.querySelector('.js-rcga-detail-sent');
detailByNode = document.querySelector('.js-rcga-detail-by');
stStatusMessageNode = document.querySelector('.js-rcga-st-status');
notSendMessageNode = document.querySelector('.js-rcga-not-send');
sendButtonNode = document.querySelector('.js-rcga-send');
removeButtonNode = document.querySelector('.js-rcga-remove');
// bind action on node to handle it on event method
sendButtonNode.action = 'forceTransaction';
// bind event listener to button node
sendButtonNode.addEventListener('click', rcAjaxAction, false);
removeButtonNode.action = 'deleteFromControlTable';
removeButtonNode.addEventListener('click', rcAjaxAction, false);
// handle display depending actual status
if (rcTrackingReport) {
orderDetailNode.classList.remove('hidden');
detailSentNode.innerText = rcTrackingReport.sent_at;
detailByNode.innerText = rcTrackingStatuses[rcTrackingReport.sent_from];
removeButtonNode.classList.remove('hidden');
if (rcTrackingReport.sent_from === 'st') {
stStatusMessageNode.classList.remove('hidden');
}
} else {
notSendMessageNode.classList.remove('hidden');
sendButtonNode.classList.remove('hidden');
}
}
function rcAjaxAction(event) {
var req = new XMLHttpRequest();
var url = rcGaModuleUrl + 'rc_pganalytics-ajax.php';
var action = event.target.action;
var data = {
'action': action,
'id_order': rcOrderId,
'id_shop': rcOrderIdShop
};
var formData;
formData = new FormData();
formData.append('data', JSON.stringify(data));
formData.append('token', rcGaToken);
animateIcon('refresh');
req.open('POST', url, true);
req.onreadystatechange = function () {
var response;
var type;
if (req.readyState === 4 && req.status === 200) {
type = req.getResponseHeader('Content-Type');
if (type === 'application/json') {
response = JSON.parse(req.responseText);
if (typeof response === 'object') {
if (action === 'deleteFromControlTable') {
afterDeleteInControlTable(response);
} else if (action === 'forceTransaction') {
afterForceTransaction(response);
}
}
}
}
};
req.send(formData);
}
function animateIcon(action) {
var iconNode;
iconNode = document.querySelector('.js-rcga-icon i');
if (action === 'refresh') {
iconNode.className = 'icon-refresh icon-spin';
} else if (action === 'ok') {
iconNode.className = 'icon-check-circle';
} else if (action === 'ko') {
iconNode.className = 'icon-times-circle';
}
}
function afterDeleteInControlTable(response) {
var orderDetailNode;
var detailSentNode;
var detailByNode;
var stStatusMessageNode;
var notSendMessageNode;
var sendButtonNode;
var removeButtonNode;
if (response && response.result) {
// get all nodes
orderDetailNode = document.querySelector('.js-rcga-order-detail');
detailSentNode = document.querySelector('.js-rcga-detail-sent');
detailByNode = document.querySelector('.js-rcga-detail-by');
stStatusMessageNode = document.querySelector('.js-rcga-st-status');
notSendMessageNode = document.querySelector('.js-rcga-not-send');
sendButtonNode = document.querySelector('.js-rcga-send');
removeButtonNode = document.querySelector('.js-rcga-remove');
// wipe old data from detail
detailSentNode.innerText = '';
detailByNode.innerText = '';
// hidden all other nodes
orderDetailNode.classList.add('hidden');
stStatusMessageNode.classList.add('hidden');
removeButtonNode.classList.add('hidden');
// display required nodes
notSendMessageNode.classList.remove('hidden');
sendButtonNode.classList.remove('hidden');
animateIcon('ko');
}
}
function afterForceTransaction(response) {
var orderDetailNode;
var detailSentNode;
var detailByNode;
var stStatusMessageNode;
var notSendMessageNode;
var sendButtonNode;
var removeButtonNode;
if (response) {
// get all nodes
orderDetailNode = document.querySelector('.js-rcga-order-detail');
detailSentNode = document.querySelector('.js-rcga-detail-sent');
detailByNode = document.querySelector('.js-rcga-detail-by');
stStatusMessageNode = document.querySelector('.js-rcga-st-status');
notSendMessageNode = document.querySelector('.js-rcga-not-send');
sendButtonNode = document.querySelector('.js-rcga-send');
removeButtonNode = document.querySelector('.js-rcga-remove');
// wipe old data from detail
detailSentNode.innerText = response.sent_at;
detailByNode.innerText = rcTrackingStatuses[response.sent_from];
// hidden all other nodes
notSendMessageNode.classList.add('hidden');
sendButtonNode.classList.add('hidden');
stStatusMessageNode.classList.add('hidden');
// display required nodes
orderDetailNode.classList.remove('hidden');
removeButtonNode.classList.remove('hidden');
animateIcon('ok');
}
}
})();

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;