var TOKEN = document.location.href.split('&token=')[1].split('&')[0].replace('#', ''); $(function () { $(document).on('click', '.copy-config-btn', function () { id = $(this).attr('id'); txt = $('#' + id + '-txt').html(); fancyMsgBox(txt); }); $(document).on('click', 'a.showLoader', function () { $('.full-screen-loader').fadeIn(); $('.bootstrap#footer').hide(); }); $(document).on('click', 'a.uploadConfigFile', function (e) { e.preventDefault(); var form = '
'; fancyMsgBox(form, 'Upload configuration file'); return false; }); $(document).on('click', 'a.ajaxClearLog', function (e) { e.preventDefault(); var filename = $(this).attr('data-filename'); $.ajax({ url: 'ajax-tab.php', dataType: 'json', method: 'POST', data: 'token=' + TOKEN + '&controller=PShowImporterMain&filename=' + filename + '&clearLog=1' }).done(function (result) { console.log(result); if (result === 'ok') { showSuccessMessage('Log cleared.'); } else { showErrorMessage(result); } }); return false; }); updateUploadAuthInfo(); $(document).on('change', 'input[name="auth_req"]', function () { updateUploadAuthInfo(); }); }); function updateUploadAuthInfo() { if ($('input[name="auth_req"]:checked').val() === '1') { $('.form-upload-auth').show("slow"); } else { $('.form-upload-auth').hide("slow"); } }