finnally doooo and close #11
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -215,6 +215,14 @@
|
||||
<p><strong>Display Name:</strong> <span id="display_name"></span></p>
|
||||
<p><strong>Content Length:</strong> <span id="content_length"></span> Bytes</p>
|
||||
<p><strong>Last Modified:</strong> <span id="last_modified"></span></p>
|
||||
|
||||
<section class="file-only">
|
||||
<p><strong>MD5:</strong> <code id="md5"><a href="#" onclick="getHash(event, 'md5')">show</a></code></p>
|
||||
<p><strong>SHA1:</strong> <code id="sha1"><a href="#" onclick="getHash(event, 'sha1')">show</a></code></p>
|
||||
<p><strong>SHA256:</strong> <code id="sha256"><a href="#" onclick="getHash(event, 'sha256')">show</a></code></p>
|
||||
<p><strong>SHA512:</strong> <code id="sha512"><a href="#" onclick="getHash(event, 'sha512')">show</a></code></p>
|
||||
</section>
|
||||
|
||||
<div>
|
||||
<button type="submit" onclick="closePrompt(event);" class="ok">OK</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user