Current Path : /storage/v11800/weinfluence-new/public_html/wp-content/plugins/fluentforms-pdf/src/ |
Linux v11800 5.3.0-1023-aws #25~18.04.1-Ubuntu SMP Fri Jun 5 15:19:18 UTC 2020 aarch64
|
Current File : /storage/v11800/weinfluence-new/public_html/wp-content/plugins/fluentforms-pdf/src/admin.js |
jQuery(document).ready(function ($) {
let progress = 0;
const pdfDownloader = {
initDownloadFonts() {
$('#ff_download_fonts').addClass('is-loading').attr('disabled', true);
$('.ff_download_fonts_text').text('Downloading...');
$('.ff_download_loading').html('Please do not close this window when downloading the fonts, After downloading page will auto reload.');
this.ajaxLoadFonts();
},
ajaxLoadFonts() {
if(progress < 95){
progress += 5;
}
$(".ff_download_fonts_bar").animate({
width: progress + '%'
}, 1000);
window.FluentFormsGlobal.$post({
action: 'fluentform_pdf_admin_ajax_actions',
route: 'downloadFonts'
})
.then(response => {
if(response.data.downloaded_files && response.data.downloaded_files.length) {
$('.ff_download_logs').prepend(response.data.downloaded_files.join('<br />')).show();
$('.ff_downlaod_logs').removeClass('hidden');
this.ajaxLoadFonts();
} else {
$(".ff_download_fonts_bar").animate({
width: '100%'
}, 1000);
// All Done
window.location.reload();
}
})
.fail(error => {
window.location.reload();
});
},
init() {
$('#ff_download_fonts').on('click', (e) => {
e.preventDefault();
this.initDownloadFonts();
});
}
};
pdfDownloader.init();
});