/** * 2010-2022 Webkul. * * NOTICE OF LICENSE * * All right is reserved, * Please go through LICENSE.txt file inside our module * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade this module to newer * versions in the future. If you wish to customize this module for your * needs please refer to CustomizationPolicy.txt file inside our module for more information. * * @author Webkul IN * @copyright 2010-2022 Webkul IN * @license LICENSE.txt */ $('document').ready( function() { $('[data-toggle="tab"]').click(function() { if ($(this).parent().hasClass('active')) { $($(this).attr("href")).toggleClass('active'); setTimeout(() => { $(this).parent().removeClass('active'); }, 0); } }); $('#module_install_form').on('submit', function(e) { e.preventDefault(); let module; initializeUploadPanel(); uploadModule(this).then((response) => { module = response.data.module; if (!module.installed) { checkModuleTrusted(module).then((response) => { if (!response.data.trusted) { return displayWariningIfUntrusted(module); } else { return Promise.resolve(true); } }).then((install) => { if (install) { return installModule(module); } else { if (confirm(remove_uploaded_module_txt)) { return rollBackChanges(module, 'delete'); } else { window.location.href = admin_modules_link + '&conf=18'; } } }).catch((response) => { handleError(response, module); }); } else { updateModule(module).catch((response) => { handleError(response, module); }); } }).catch((response) => { displayErrors(response, module); }).finally(() => { $('#module_install_form').find('button[type="submit"]').attr("disabled", false); }); }); $('#proceed-install-anyway').on('click', function(e) { e.preventDefault(); }) function displayErrors(response, module) { let error_list = $('