"use strict"; // Class definition var KTLayoutBuilder = function() { var exporter = { init: function() { }, startLoad: function(options) { $('#builder_export'). addClass('spinner spinner-right spinner-primary'). find('span').text('Exporting...'). closest('.card-footer'). find('.btn'). attr('disabled', true); toastr.info(options.title, options.message); }, doneLoad: function() { $('#builder_export'). removeClass('spinner spinner-right spinner-primary'). find('span').text('Export'). closest('.card-footer'). find('.btn'). attr('disabled', false); }, exportHtml: function(demo) { exporter.startLoad({ title: 'Generate HTML Partials', message: 'Process started and it may take a while.', }); $.ajax('index.php', { method: 'POST', data: { builder_export: 1, export_type: 'partial', demo: demo, theme: 'metronic', }, }).done(function(r) { var result = JSON.parse(r); if (result.message) { exporter.stopWithNotify(result.message); return; } var timer = setInterval(function() { $.ajax('index.php', { method: 'POST', data: { builder_export: 1, builder_check: result.id, }, }).done(function(r) { var result = JSON.parse(r); if (typeof result === 'undefined') return; // export status 1 is completed if (result.export_status !== 1) return; $('