diff --git a/_assets/_old/js/common_old.js b/_assets/_old/js/common_old.js
index 24807bbc..4473cd7c 100644
--- a/_assets/_old/js/common_old.js
+++ b/_assets/_old/js/common_old.js
@@ -105,72 +105,6 @@ function logoutEvent (event) {
}
}
-function deleteOnSingleFile () {
- closePrompt()
- buttons.setLoading('delete')
-
- webdav.delete(window.location.pathname)
- .then(() => {
- window.location.pathname = removeLastDirectoryPartOf(window.location.pathname)
- })
- .catch(e => {
- buttons.setDone('delete', false)
- console.log(e)
- })
-}
-
-function deleteOnListing () {
- closePrompt()
- buttons.setLoading('delete')
-
- let promises = []
-
- for (let id of selectedItems) {
- promises.push(webdav.delete(document.getElementById(id).dataset.url))
- }
-
- Promise.all(promises)
- .then(() => {
- listing.reload()
- buttons.setDone('delete')
- })
- .catch(e => {
- console.log(e)
- buttons.setDone('delete', false)
- })
-}
-
-// Handles the delete button event
-function deleteEvent (event) {
- let single = false
-
- if (!selectedItems.length) {
- selectedItems = ['placeholder']
- single = true
- }
-
- let clone = document.importNode(templates.question.content, true)
- clone.querySelector('h3').innerHTML = 'Delete files'
-
- if (single) {
- clone.querySelector('form').addEventListener('submit', deleteOnSingleFile)
- clone.querySelector('p').innerHTML = `Are you sure you want to delete this file/folder?`
- } else {
- clone.querySelector('form').addEventListener('submit', deleteOnListing)
- clone.querySelector('p').innerHTML = `Are you sure you want to delete ${selectedItems.length} file(s)?`
- }
-
- clone.querySelector('input').remove()
- clone.querySelector('.ok').innerHTML = 'Delete'
-
- document.body.appendChild(clone)
- document.querySelector('.overlay').classList.add('active')
- document.querySelector('.prompt').classList.add('active')
-
- return false
-}
-
-
/* * * * * * * * * * * * * * * *
* *
* BOOTSTRAP *
@@ -208,6 +142,5 @@ document.addEventListener('DOMContentLoaded', function (event) {
})
})
- setupSearch()
return false
})
diff --git a/_assets/_old/js/listing.js b/_assets/_old/js/listing.js
index e6610a2b..733fab6c 100644
--- a/_assets/_old/js/listing.js
+++ b/_assets/_old/js/listing.js
@@ -1,84 +1,5 @@
'use strict'
-var listing = {
- selectMultiple: false,
- reload: function (callback) {
- let request = new window.XMLHttpRequest()
-
- request.open('GET', window.location)
- request.setRequestHeader('Minimal', 'true')
- request.send()
- request.onreadystatechange = function () {
- if (request.readyState === 4) {
- if (request.status === 200) {
- document.querySelector('body main').innerHTML = request.responseText
- listing.addDoubleTapEvent()
-
- if (typeof callback === 'function') {
- callback()
- }
- }
- }
- }
- },
- rename: function (event) {
- if (!selectedItems.length || selectedItems.length > 1) {
- return false
- }
-
- let item = document.getElementById(selectedItems[0])
-
- if (item.classList.contains('disabled')) {
- return false
- }
-
- let link = item.dataset.url
- let field = item.querySelector('.name')
- let name = field.innerHTML
-
- let submit = (event) => {
- event.preventDefault()
-
- let newName = event.currentTarget.querySelector('input').value
- let newLink = removeLastDirectoryPartOf(link) + '/' + newName
-
- closePrompt(event)
- buttons.setLoading('rename')
-
- webdav.move(link, newLink).then(() => {
- listing.reload(() => {
- newName = btoa(newName)
- selectedItems = [newName]
- document.getElementById(newName).setAttribute('aria-selected', true)
- listing.handleSelectionChange()
- })
-
- buttons.setDone('rename')
- }).catch(error => {
- field.innerHTML = name
- buttons.setDone('rename', false)
- console.log(error)
- })
-
- return false
- }
-
- let clone = document.importNode(templates.question.content, true)
- clone.querySelector('h3').innerHTML = 'Rename'
- clone.querySelector('input').value = name
- clone.querySelector('.ok').innerHTML = 'Rename'
- clone.querySelector('form').addEventListener('submit', submit)
-
- document.querySelector('body').appendChild(clone)
- document.querySelector('.overlay').classList.add('active')
- document.querySelector('.prompt').classList.add('active')
-
- return false
- },
- handleFiles: function (files, base) {
- }
-}
-
listing.redefineDownloadURLs = function () {
let files = ''
@@ -321,12 +242,6 @@ document.addEventListener('DOMContentLoaded', event => {
listing.updateColumns()
listing.addDoubleTapEvent()
- buttons.rename = document.getElementById('rename')
- buttons.upload = document.getElementById('upload')
- buttons.new = document.getElementById('new')
- buttons.download = document.getElementById('download')
- buttons.move = document.getElementById('move')
-
document.getElementById('multiple-selection-activate').addEventListener('click', event => {
listing.selectMultiple = true
clickOverlay.click()
diff --git a/_assets/src/App.vue b/_assets/src/App.vue
index a24a751a..996a10ba 100644
--- a/_assets/src/App.vue
+++ b/_assets/src/App.vue
@@ -6,9 +6,9 @@
Are you sure you want to delete this file/folder?
+Are you sure you want to delete {{ listing.selected.length }} file(s)?
+Insert a new name for {{ oldName() }}
: