From 70001d7e5cbba3ded5ff4d8decf2444864667a9d Mon Sep 17 00:00:00 2001 From: Hmmm <102938585+git-Hmmm@users.noreply.github.com> Date: Fri, 16 Dec 2022 18:54:27 +0530 Subject: [PATCH] minor fixes on apps page --- public/apps.js | 35 ++++++++++++++++++++++++----------- public/apps/index.html | 21 +++++++-------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/public/apps.js b/public/apps.js index 50e85d5d..b69c1672 100644 --- a/public/apps.js +++ b/public/apps.js @@ -1,6 +1,19 @@ ws.onopen = () => sendCommand({ event: 'getAppList' }); const apkField = document.getElementById('apkUpload'); +apkField.addEventListener('change', () => { + if (!apkField.value == '') { + postFile(); + const info = document.createElement('div'); + info.className = 'inf'; + info.innerHTML = '

Please wait...

'; + document.getElementById('content').appendChild(info); + } +}); function postFile() { + document.querySelector('ul').style.display = 'none'; + document.querySelector('.upl').style.display = 'none'; + document.querySelector('#search').style.display = 'none'; + document.querySelector('h1').style.display = 'none'; const stat = document.querySelector('.prog'); stat.style.display = 'block'; // stackoverflow @@ -26,14 +39,14 @@ function postFile() { request.timeout = 60 * 10 * 1000; request.send(formdata); } -apkField.addEventListener('change', () => { - if (!apkField.value == '') { - postFile(); - document.querySelector('ul').style.display = 'none'; - document.querySelector('.upl').style.display = 'none'; - const info = document.createElement('div'); - info.className = 'inf'; - info.innerHTML = '

Please wait...

'; - document.getElementById('content').appendChild(info); - } -}); +function oldState(e) { + e.style.display = 'none'; + document.querySelector('ul').style.display = 'block'; + document.querySelector('h1').style.display = 'block'; + document.querySelector('.prog').style.display = 'none'; + document.querySelector('#search').style.display = null; + document.querySelector('.upl').style.display = 'inline-flex'; + document.querySelector('.inf').remove(); + document.getElementById('continue').setAttribute('onClick', 'setApp()'); + document.getElementById('uploadForm').reset(); +} diff --git a/public/apps/index.html b/public/apps/index.html index 648c61e6..01a6f21c 100644 --- a/public/apps/index.html +++ b/public/apps/index.html @@ -24,20 +24,13 @@

-
- -
- + +