|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / lib / web / mage / backend / |
Filename | /home/a/home/dev2.destoffenstraat.com/lib/web/mage/backend/bootstrap.js |
Size | 3.31 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 28-Jan-2025 06:45 |
Last accessed | 23-Aug-2025 14:42 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/* global FORM_KEY */
define([
'jquery',
'mage/apply/main',
'mage/backend/notification',
'Magento_Ui/js/lib/knockout/bootstrap',
'mage/mage',
'mage/translate'
], function ($, mage, notification) {
'use strict';
var bootstrap;
$.ajaxSetup({
/*
* @type {string}
*/
type: 'POST',
/**
* Ajax before send callback.
*
* @param {Object} jqXHR - The jQuery XMLHttpRequest object returned by $.ajax()
* @param {Object} settings
*/
beforeSend: function (jqXHR, settings) {
var formKey = typeof FORM_KEY !== 'undefined' ? FORM_KEY : null;
if (!settings.url.match(new RegExp('[?&]isAjax=true',''))) {
settings.url = settings.url.match(
new RegExp('\\?', 'g')) ?
settings.url + '&isAjax=true' :
settings.url + '?isAjax=true';
}
if (!settings.data) {
settings.data = {
'form_key': formKey
};
} else if ($.type(settings.data) === 'string' &&
settings.data.indexOf('form_key=') === -1) {
settings.data += '&' + $.param({
'form_key': formKey
});
} else if ($.isPlainObject(settings.data) && !settings.data['form_key']) {
settings.data['form_key'] = formKey;
}
},
/**
* Ajax complete callback.
*
* @param {Object} jqXHR - The jQuery XMLHttpRequest object returned by $.ajax()
*/
complete: function (jqXHR) {
var jsonObject;
if (jqXHR.readyState === 4) {
try {
jsonObject = $.parseJSON(jqXHR.responseText);
if (jsonObject.ajaxExpired && jsonObject.ajaxRedirect) { //eslint-disable-line max-depth
window.location.replace(jsonObject.ajaxRedirect);
}
} catch (e) {}
}
},
/**
* Error callback.
*/
error: function () {
$('body').notification('clear')
.notification('add', {
error: true,
message: $.mage.__(
'A technical problem with the server created an error. ' +
'Try again to continue what you were doing. If the problem persists, try again later.'
),
/**
* @param {String} message
*/
insertMethod: function (message) {
var $wrapper = $('<div/>').html(message);
$('.page-main-actions').after($wrapper);
}
});
}
});
/**
* Bootstrap application.
*/
bootstrap = function () {
/**
* Init all components defined via data-mage-init attribute
* and subscribe init action on contentUpdated event
*/
mage.apply();
/*
* Initialization of notification widget
*/
notification({}, $('body'));
};
$(bootstrap);
});
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/* global FORM_KEY */
define([
'jquery',
'mage/apply/main',
'mage/backend/notification',
'Magento_Ui/js/lib/knockout/bootstrap',
'mage/mage',
'mage/translate'
], function ($, mage, notification) {
'use strict';
var bootstrap;
$.ajaxSetup({
/*
* @type {string}
*/
type: 'POST',
/**
* Ajax before send callback.
*
* @param {Object} jqXHR - The jQuery XMLHttpRequest object returned by $.ajax()
* @param {Object} settings
*/
beforeSend: function (jqXHR, settings) {
var formKey = typeof FORM_KEY !== 'undefined' ? FORM_KEY : null;
if (!settings.url.match(new RegExp('[?&]isAjax=true',''))) {
settings.url = settings.url.match(
new RegExp('\\?', 'g')) ?
settings.url + '&isAjax=true' :
settings.url + '?isAjax=true';
}
if (!settings.data) {
settings.data = {
'form_key': formKey
};
} else if ($.type(settings.data) === 'string' &&
settings.data.indexOf('form_key=') === -1) {
settings.data += '&' + $.param({
'form_key': formKey
});
} else if ($.isPlainObject(settings.data) && !settings.data['form_key']) {
settings.data['form_key'] = formKey;
}
},
/**
* Ajax complete callback.
*
* @param {Object} jqXHR - The jQuery XMLHttpRequest object returned by $.ajax()
*/
complete: function (jqXHR) {
var jsonObject;
if (jqXHR.readyState === 4) {
try {
jsonObject = $.parseJSON(jqXHR.responseText);
if (jsonObject.ajaxExpired && jsonObject.ajaxRedirect) { //eslint-disable-line max-depth
window.location.replace(jsonObject.ajaxRedirect);
}
} catch (e) {}
}
},
/**
* Error callback.
*/
error: function () {
$('body').notification('clear')
.notification('add', {
error: true,
message: $.mage.__(
'A technical problem with the server created an error. ' +
'Try again to continue what you were doing. If the problem persists, try again later.'
),
/**
* @param {String} message
*/
insertMethod: function (message) {
var $wrapper = $('<div/>').html(message);
$('.page-main-actions').after($wrapper);
}
});
}
});
/**
* Bootstrap application.
*/
bootstrap = function () {
/**
* Init all components defined via data-mage-init attribute
* and subscribe init action on contentUpdated event
*/
mage.apply();
/*
* Initialization of notification widget
*/
notification({}, $('body'));
};
$(bootstrap);
});