| Server IP : 43.153.74.48 / Your IP : 216.73.216.175 Web Server : LiteSpeed System : Linux VM-0-13-ubuntu 5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 User : www ( 1002) PHP Version : 8.1.29 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/stainlesstint.com/wp-content/themes/woodmart/inc/admin/assets/js/ |
Upload File : |
/* global woodmartConfig */
(function($) {
'use strict';
$(document).on('click', '.xts-patch-apply', function (e) {
e.preventDefault();
var $this = $(this);
var patchesMap = $this.data('patches-map');
var fileMap = [];
for(var i = 0; i < patchesMap.length; i++) {
fileMap[i] = 'woodmart/' + patchesMap[i];
}
var confirmation = confirm( 'These files will be updated: \r\r\n' + fileMap.join('\r\n') );
if ( ! confirmation ) {
return;
}
addLoading();
cleanNotice();
$.ajax({
url : woodmartConfig.ajaxUrl,
data : {
action : 'woodmart_patch_action',
security : woodmartConfig.patcher_nonce,
id : $this.data('id'),
},
timeout: 1000000,
error : function() {
printNotice('error', 'Something wrong with removing data. Please, try to remove data manually or contact our support center for further assistance.');
},
success: function(response) {
if ( 'undefined' !== typeof response.message ) {
printNotice(response.status, response.message);
}
if ( 'undefined' !== typeof response.status && 'success' === response.status ) {
$this.parents('.xts-patch-item').addClass('xts-applied');
updatePatcherCounter();
}
removeLoading();
}
});
});
// Helpers.
function printNotice(type, message) {
$('.xts-notices-wrapper').append(`
<div class="xts-notice xts-${type}">
${message}
</div>
`);
setTimeout(function(){
$('.xts-notice').addClass('xts-hidden');
}, 7000);
}
function cleanNotice() {
$('.xts-notices-wrapper').text('');
}
function addLoading() {
$('.xts-box-content').addClass('xts-loading');
}
function removeLoading() {
$('.xts-box-content').removeClass('xts-loading');
}
function updatePatcherCounter() {
var $counter = $('.xts-patcher-counter');
if ($counter.length) {
var $count = parseInt($counter.find('.patcher-count').text());
if ( 1 === $count ) {
$counter.hide();
} else {
$counter.find('.patcher-count').text(--$count);
}
}
}
})(jQuery);