diff --git a/_embed/public/css/styles.css b/_embed/public/css/styles.css index 01f2ee86..eb9d8a5b 100644 --- a/_embed/public/css/styles.css +++ b/_embed/public/css/styles.css @@ -45,7 +45,6 @@ button { padding: .5em 1em; margin-left: .5em; border-radius: .1em; - background-color; cursor: pointer; background: #2196f3; color: #fff; @@ -376,10 +375,6 @@ header>div div { position: relative; } -header .actions { - /* margin-left: auto; */ -} - #logout { border-radius: 0; margin-left: auto; @@ -1010,6 +1005,10 @@ header .actions { padding: .3em; } +.prompt code { + word-wrap: break-word; +} + .prompt div, .help div { margin-top: 1em; diff --git a/_embed/public/js/common.js b/_embed/public/js/common.js index ae84d237..395e1c58 100644 --- a/_embed/public/js/common.js +++ b/_embed/public/js/common.js @@ -302,17 +302,40 @@ function openEvent (event) { return false } +function getHash (event, hash) { + event.preventDefault() + + let request = new window.XMLHttpRequest() + request.open('GET', `${window.location.pathname}?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 } @@ -326,6 +349,10 @@ function infoEvent (event) { clone.getElementById('content_length').innerHTML = xml.getElementsByTagName('getcontentlength')[0].innerHTML clone.getElementById('last_modified').innerHTML = xml.getElementsByTagName('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') diff --git a/_embed/templates/base.tmpl b/_embed/templates/base.tmpl index 85d68686..4913ffc2 100644 --- a/_embed/templates/base.tmpl +++ b/_embed/templates/base.tmpl @@ -215,6 +215,14 @@
Display Name:
Content Length: Bytes
Last Modified:
+ +MD5: show
SHA1: show
SHA256: show
SHA512: show