From 8fabf77b2a7720a357c63817c07035a9908818a0 Mon Sep 17 00:00:00 2001 From: Gitea Date: Wed, 10 Nov 2021 17:53:50 +0100 Subject: Update --- Neutron-trunk/resources/js/setup-ui.js.php | 171 ----------------------------- 1 file changed, 171 deletions(-) delete mode 100644 Neutron-trunk/resources/js/setup-ui.js.php (limited to 'Neutron-trunk/resources/js/setup-ui.js.php') diff --git a/Neutron-trunk/resources/js/setup-ui.js.php b/Neutron-trunk/resources/js/setup-ui.js.php deleted file mode 100644 index d6183aa..0000000 --- a/Neutron-trunk/resources/js/setup-ui.js.php +++ /dev/null @@ -1,171 +0,0 @@ - -/**/ -setTimeout(() => { - switchPage("01-loader", "02-check") - document.title = ' - '; - $.ajax({ - url: "/api/setup/check.php", - dataType: 'html', - cache: false, - contentType: false, - processData: false, - type: 'get', - success: function (data) { - setTimeout(() => { - if (data != "ok") { - document.getElementById('00-error-title').innerHTML = "Environnement incorrect" - document.getElementById('00-error-message').innerHTML = data - switchPage("02-check", "00-error") - document.title = ' - '; - window.onbeforeunload = undefined; - } else { - switchPage("02-check", "03-welcome") - document.title = ' - '; - } - }, 1000) - } - }) -}, 1000) - -function validateName() { - document.getElementById('04-name-tip').classList.remove('tip-orange') - document.getElementById('04-name-tip').classList.remove('tip-green') - document.getElementById('04-name-tip').classList.remove('tip-red') - document.getElementById('04-name-tip').innerHTML = "..."; - setTimeout(() => { - name = document.getElementById('04-name-field').value - if (name.trim() == "") { - document.getElementById('04-name-tip').classList.add('tip-red') - document.getElementById('04-name-tip').innerHTML = ""; - return; - } - if (name.includes("<") || name.includes(">") || name.includes("#") || name.includes("@") || name.includes("}") || name.includes("{") || name.includes("|")) { - document.getElementById('04-name-tip').classList.add('tip-red') - document.getElementById('04-name-tip').innerHTML = ""; - return; - } - if (name.length > 75) { - document.getElementById('04-name-tip').classList.add('tip-red') - document.getElementById('04-name-tip').innerHTML = ""; - return; - } - if (name.length < 4) { - document.getElementById('04-name-tip').classList.add('tip-orange') - document.getElementById('04-name-tip').innerHTML = ""; - return; - } - if (name.length > 30) { - document.getElementById('04-name-tip').classList.add('tip-orange') - document.getElementById('04-name-tip').innerHTML = ""; - return; - } - document.getElementById('04-name-tip').classList.add('tip-green') - document.getElementById('04-name-tip').innerHTML = ""; - return; - }, 100) -} - -function Name_ChangeIfOk() { - name = document.getElementById('04-name-field').value - if (name.trim() == "" || name.includes("<") || name.includes(">") || name.includes("#") || name.includes("@") || name.includes("}") || name.includes("{") || name.includes("|") || name.length > 75) {return;} - switchPage("04-name", "05-icon") - document.title = ' - '; -} - -function Icon_UploadFile() { - $("#05-icon-file").trigger('click'); - Icon_Validate() -} - -function Icon_Validate() { - if (document.getElementById('05-icon-file').value != "") { - document.getElementById('05-icon-img').src = "/resources/image/config_file_replace.svg" - } else { - document.getElementById('05-icon-img').src = "/resources/image/config_file_import.svg" - } -} - -function Icon_Validate_Delayed() { - setTimeout(() => { - if (document.getElementById('05-icon-file').value != "") { - document.getElementById('05-icon-img').src = "/resources/image/config_file_replace.svg" - } else { - document.getElementById('05-icon-img').src = "/resources/image/config_file_import.svg" - } - }, 1000) -} - -document.getElementById('04-name-field').value = "" -document.getElementById('05-icon-file').value = "" -setInterval(Icon_Validate, 100) - -function upload() { - document.title = ' - '; - switchPage("07-finish", "08-checking") - setTimeout(() => { - switchPage("08-checking", "09-uploading") - var formData = new FormData(); - if (typeof $('#05-icon-file')[0].files[0] != "undefined") { - formData.append("file", $('#05-icon-file')[0].files[0]); - } - formData.append("upload_file", true); - formData.append("sitename", document.getElementById('04-name-field').value); - formData.append("language", lang); - $.ajax({ - type: "POST", - dataType: 'html', - url: "/api/setup/push.php", - success: function (data) { - if (data == "ok") { - setTimeout(() => { - switchPage("09-uploading", "10-summing") - setTimeout(() => { - switchPage("10-summing", "11-performance") - setTimeout(() => { - switchPage("11-performance", "12-done") - document.title = ' - '; - window.onbeforeunload = undefined; - }, 3000) - }, 2000) - }, 3000) - } else { - document.getElementById('00-error-title').innerHTML = `` - document.getElementById('00-error-message').innerHTML = data - document.title = ` - `; - setTimeout(() => { - switchPage("09-check", "00-error") - $("#09-uploading").fadeOut(200); - $("#09-uploading")[0].style.display = "none"; - }, 1000) - window.onbeforeunload = undefined; - } - }, - error: function (error) { - document.title = ' - '; - document.getElementById('00-error-title').innerHTML = `` - document.getElementById('00-error-message').innerHTML = `` - setTimeout(() => { - switchPage("09-check", "00-error") - $("#09-uploading").fadeOut(200); - $("#09-uploading")[0].style.display = "none"; - }, 1000) - window.onbeforeunload = undefined; - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); - }, 1000) -} - -document.title = ' - '; - -function switchPage(from, to) { - $("#" + from).fadeOut(200); - $("#" + to).fadeIn(200); -} - -function reloadPage() { - location.reload(); -} \ No newline at end of file -- cgit