diff --git a/_assets/_old/js/common_old.js b/_assets/_old/js/common_old.js index 4b9e8cac..4fc09a5e 100644 --- a/_assets/_old/js/common_old.js +++ b/_assets/_old/js/common_old.js @@ -125,95 +125,6 @@ function logoutEvent (event) { } } -function getHash (event, hash) { - event.preventDefault() - - let request = new window.XMLHttpRequest() - let link - - if (selectedItems.length) { - link = document.getElementById(selectedItems[0]).dataset.url - } else { - link = window.location.pathname - } - - request.open('GET', `${link}?checksum=${hash}`, true) - - request.onload = () => { - if (request.status >= 300) { - console.log(request.statusText) - return - } - event.target.parentElement.innerHTML = request.responseText - } - request.onerror = (e) => console.log(e) - request.send() -} - -function infoEvent (event) { - event.preventDefault() - if (event.currentTarget.classList.contains('disabled')) { - return - } - - let dir = false - let link - - if (selectedItems.length) { - link = document.getElementById(selectedItems[0]).dataset.url - dir = document.getElementById(selectedItems[0]).dataset.dir - } else { - if (document.getElementById('listing') !== null) { - dir = true - } - - link = window.location.pathname - } - - buttons.setLoading('info', false) - - webdav.propfind(link) - .then((text) => { - let parser = new window.DOMParser() - let xml = parser.parseFromString(text, 'text/xml') - let clone = document.importNode(templates.info.content, true) - - let value = xml.getElementsByTagName('displayname') - if (value.length > 0) { - clone.getElementById('display_name').innerHTML = value[0].innerHTML - } else { - clone.getElementById('display_name').innerHTML = xml.getElementsByTagName('D:displayname')[0].innerHTML - } - - value = xml.getElementsByTagName('getcontentlength') - if (value.length > 0) { - clone.getElementById('content_length').innerHTML = value[0].innerHTML - } else { - clone.getElementById('content_length').innerHTML = xml.getElementsByTagName('D:getcontentlength')[0].innerHTML - } - - value = xml.getElementsByTagName('getlastmodified') - if (value.length > 0) { - clone.getElementById('last_modified').innerHTML = value[0].innerHTML - } else { - clone.getElementById('last_modified').innerHTML = xml.getElementsByTagName('D:getlastmodified')[0].innerHTML - } - - if (dir === true || dir === 'true') { - clone.querySelector('.file-only').style.display = 'none' - } - - document.querySelector('body').appendChild(clone) - document.querySelector('.overlay').classList.add('active') - document.querySelector('.prompt').classList.add('active') - buttons.setDone('info', true) - }) - .catch(e => { - buttons.setDone('info', false) - console.log(e) - }) -} - function deleteOnSingleFile () { closePrompt() buttons.setLoading('delete') @@ -279,36 +190,6 @@ function deleteEvent (event) { return false } -function closeHelp (event) { - event.preventDefault() - - document.querySelector('.help').classList.remove('active') - document.querySelector('.overlay').classList.remove('active') -} - -function openHelp (event) { - closePrompt(event) - - document.querySelector('.help').classList.add('active') - document.querySelector('.overlay').classList.add('active') -} - -window.addEventListener('keydown', (event) => { - if (event.keyCode === 27) { - if (document.querySelector('.help.active')) { - closeHelp(event) - } - } - - if (event.keyCode === 46) { - deleteEvent(event) - } - - if (event.keyCode === 112) { - event.preventDefault() - openHelp(event) - } -}) /* * * * * * * * * * * * * * * * * * diff --git a/_assets/_old/js/listing.js b/_assets/_old/js/listing.js index 6b233d90..097b3f65 100644 --- a/_assets/_old/js/listing.js +++ b/_assets/_old/js/listing.js @@ -159,29 +159,6 @@ listing.addDoubleTapEvent = function () { }) } -// Keydown events -window.addEventListener('keydown', (event) => { - if (event.keyCode == 27) { - listing.unselectAll() - - if (document.querySelectorAll('.prompt').length) { - closePrompt(event) - } - } - - if (event.keyCode == 113) { - listing.rename() - } - - if (event.ctrlKey || event.metaKey) { - switch (String.fromCharCode(event.which).toLowerCase()) { - case 's': - event.preventDefault() - window.location = '?download=true' - } - } -}) - listing.selectMoveFolder = function (event) { if (event.target.getAttribute('aria-selected') === 'true') { event.target.setAttribute('aria-selected', false) diff --git a/_assets/_old/templates/templates.tmpl b/_assets/_old/templates/templates.tmpl index a0910314..ebc2e42a 100644 --- a/_assets/_old/templates/templates.tmpl +++ b/_assets/_old/templates/templates.tmpl @@ -11,26 +11,6 @@ - - -
-

Help

- - -

Not available yet

- - - -
- -
-
{{ end }} \ No newline at end of file diff --git a/_assets/index.html b/_assets/index.html index bc1687bb..fe6e4260 100644 --- a/_assets/index.html +++ b/_assets/index.html @@ -33,10 +33,19 @@
diff --git a/_assets/src/App.vue b/_assets/src/App.vue index 137eb2da..fb07443f 100644 --- a/_assets/src/App.vue +++ b/_assets/src/App.vue @@ -1,11 +1,11 @@ diff --git a/_assets/src/components/Help.vue b/_assets/src/components/Help.vue new file mode 100644 index 00000000..0669739b --- /dev/null +++ b/_assets/src/components/Help.vue @@ -0,0 +1,38 @@ + + + + diff --git a/_assets/src/components/InfoButton.vue b/_assets/src/components/InfoButton.vue index 9ea8a7e4..4e101b6d 100644 --- a/_assets/src/components/InfoButton.vue +++ b/_assets/src/components/InfoButton.vue @@ -1,5 +1,5 @@