mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-02-20 12:19:03 +00:00
Updated home.js
* Cache selected album the exact moment "Upload URLs" button is pressed, so that any in progress requests will not have its album id altered. * All URLs will now be displayed in the uploads list (the thing in between upload buttons and footer links) the moment "Upload URLs" button is pressed. Previously it would only show the URLs one by one after each finished request. Brief video: https://i.fiery.me/AByv.mp4.
This commit is contained in:
parent
933fcb8612
commit
4d634196c5
@ -298,6 +298,7 @@ page.uploadUrls = async button => {
|
||||
if (button.classList.contains('is-loading')) { return }
|
||||
button.classList.add('is-loading')
|
||||
|
||||
const albumid = page.album
|
||||
const previewsContainer = tabDiv.getElementsByClassName('uploads')[0]
|
||||
const files = document.getElementById('urls').value
|
||||
.split(/\r?\n/)
|
||||
@ -305,8 +306,9 @@ page.uploadUrls = async button => {
|
||||
const previewTemplate = document.createElement('template')
|
||||
previewTemplate.innerHTML = page.previewTemplate.trim()
|
||||
const previewElement = previewTemplate.content.firstChild
|
||||
previewElement.querySelector('.name').innerHTML = url
|
||||
previewsContainer.appendChild(previewElement)
|
||||
return {
|
||||
name: url,
|
||||
url,
|
||||
previewElement
|
||||
}
|
||||
@ -316,9 +318,6 @@ page.uploadUrls = async button => {
|
||||
const post = async i => {
|
||||
if (i === files.length) { return resolve() }
|
||||
const file = files[i]
|
||||
file.previewElement.querySelector('.name').innerHTML = file.name
|
||||
previewsContainer.appendChild(file.previewElement)
|
||||
|
||||
const response = await axios.post('api/upload',
|
||||
{
|
||||
urls: [file.url]
|
||||
@ -326,7 +325,7 @@ page.uploadUrls = async button => {
|
||||
{
|
||||
headers: {
|
||||
token: page.token,
|
||||
albumid: page.album
|
||||
albumid
|
||||
}
|
||||
})
|
||||
.then(response => response.data)
|
||||
|
@ -12,7 +12,7 @@
|
||||
v1: CSS and JS files.
|
||||
v2: Images and config files (manifest.json, browserconfig.xml, etcetera).
|
||||
#}
|
||||
{% set v1 = "ZIUmml610x" %}
|
||||
{% set v1 = "HrvcYD3KTh" %}
|
||||
{% set v2 = "Ii3JYKIhb0" %}
|
||||
|
||||
{#
|
||||
|
Loading…
Reference in New Issue
Block a user