Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

minor fixes on apps page #601

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions public/apps.js
Original file line number Diff line number Diff line change
@@ -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 = '<h2>Please wait...</h2>';
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
Expand All @@ -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 = '<h2>Please wait...</h2>';
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();
}
21 changes: 7 additions & 14 deletions public/apps/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,13 @@ <h2 class="prog"></h2>
<button class="upl highlighted" onclick="apkField.click()">
<i class="gg-software-upload"></i>Upload APK
</button>
<div>
<input
class="searchBox"
id="search"
type="text"
placeholder="Search for an app..."
/>
</div>
<button
class="shw"
onclick="this.style.display = 'none'; document.querySelector('ul').style.display = 'block';document.querySelector('.prog').style.display = 'none';document.querySelector('.upl').style.display = 'inline-flex'; document.querySelector('.inf').remove();document.getElementById('continue').setAttribute('onClick', 'setApp()');"
>
Back
</button>
<button class="shw" onclick="oldState(this)">Back</button>
<input
class="searchBox"
id="search"
type="text"
placeholder="Search for an app..."
/>
</header>
<div id="content--wrapper">
<div id="content">
Expand Down