mirror of
https://github.com/pldubouilh/gossa
synced 2025-12-09 18:02:44 +01:00
cleanup upload bar
This commit is contained in:
parent
394040e9f5
commit
8e2f79067e
2 changed files with 10 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ const pageH1 = document.body.querySelector('h1')
|
||||||
const editor = document.getElementById('text-editor')
|
const editor = document.getElementById('text-editor')
|
||||||
const crossIcon = document.getElementById('quitAll')
|
const crossIcon = document.getElementById('quitAll')
|
||||||
const toast = document.getElementById('toast')
|
const toast = document.getElementById('toast')
|
||||||
|
const table = document.querySelector('table')
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
let allA
|
let allA
|
||||||
|
|
@ -43,10 +44,9 @@ manualUpload.addEventListener('change', () => Array.from(manualUpload.files).for
|
||||||
function browseTo (href, flickerDone, skipHistory) {
|
function browseTo (href, flickerDone, skipHistory) {
|
||||||
fetch(href, { credentials: 'include' }).then(r => r.text().then(t => {
|
fetch(href, { credentials: 'include' }).then(r => r.text().then(t => {
|
||||||
const parsed = new DOMParser().parseFromString(t, 'text/html')
|
const parsed = new DOMParser().parseFromString(t, 'text/html')
|
||||||
const table = parsed.querySelectorAll('table')[0].innerHTML
|
table.innerHTML = parsed.querySelector('table').innerHTML
|
||||||
document.body.querySelectorAll('table')[0].innerHTML = table
|
|
||||||
|
|
||||||
const title = parsed.head.querySelectorAll('title')[0].innerText
|
const title = parsed.head.querySelector('title').innerText
|
||||||
// check if is current path - if so skip following
|
// check if is current path - if so skip following
|
||||||
if (pageTitle.innerText !== title) {
|
if (pageTitle.innerText !== title) {
|
||||||
pageTitle.innerText = title
|
pageTitle.innerText = title
|
||||||
|
|
@ -135,6 +135,7 @@ function shouldRefresh () {
|
||||||
totalUploadsSize = 0
|
totalUploadsSize = 0
|
||||||
totalUploadedSize = []
|
totalUploadedSize = []
|
||||||
barDiv.style.display = 'none'
|
barDiv.style.display = 'none'
|
||||||
|
table.classList.remove('uploading-table')
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -151,6 +152,7 @@ function postFile (file, path) {
|
||||||
path = decodeURI(location.pathname).slice(0, -1) + path
|
path = decodeURI(location.pathname).slice(0, -1) + path
|
||||||
window.onbeforeunload = warningMsg
|
window.onbeforeunload = warningMsg
|
||||||
|
|
||||||
|
table.classList.add('uploading-table')
|
||||||
barDiv.style.display = 'block'
|
barDiv.style.display = 'block'
|
||||||
totalUploads += 1
|
totalUploads += 1
|
||||||
totalUploadsSize += file.size
|
totalUploadsSize += file.size
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,10 @@ h1 {
|
||||||
z-index: 101;
|
z-index: 101;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uploading-table {
|
||||||
|
padding-bottom: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
#progress {
|
#progress {
|
||||||
width: 99%;
|
width: 99%;
|
||||||
left: 0.5%;
|
left: 0.5%;
|
||||||
|
|
@ -157,6 +161,7 @@ h1 {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
max-height: 50%;
|
max-height: 50%;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
background-color: #2d3436;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dlBarName {
|
#dlBarName {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue