Download Style Update
This commit is contained in:
@@ -6,43 +6,71 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Kakubovna: Download</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<link rel="stylesheet" href="/css/style-light.css">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Geologica:wght@800&display=swap" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="flex-container">
|
||||
<div id="code-view" class="container vertical" style="display:none">
|
||||
<input id="code" type="text" placeholder="Enter code">
|
||||
<button onclick="checkUpload()">Submit</button>
|
||||
<p id="status"></p>
|
||||
</div>
|
||||
<div id="file-view" class="container vertical file-view" style="display:none">
|
||||
</div>
|
||||
<div id="admin-file-view" class="container vertical" style="display:none">
|
||||
<input id="code" type="text" placeholder="Enter code">
|
||||
<button onclick="checkUpload()">Submit</button>
|
||||
<p id="status"></p>
|
||||
<div class="container">
|
||||
<div class="view-container">
|
||||
<div class="view-nav hidden">
|
||||
<div class="button primary">
|
||||
<p>Download all as zip</p>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div class="link-box">
|
||||
<div class="text-link">
|
||||
<input type="text" readonly="readonly" value="https://test.org">
|
||||
</div>
|
||||
<div class="button-copy" onclick="copyToClipboard(this);">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="copy" viewBox="0 0 512 512">
|
||||
<rect x="128" y="128" width="336" height="336" rx="57" ry="57" fill="none" stroke="currentColor"
|
||||
stroke-linejoin="round" stroke-width="32" />
|
||||
<path d="M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24"
|
||||
fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" />
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="checkmark hidden" viewBox="0 0 512 512">
|
||||
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"
|
||||
d="M416 128L192 384l-96-96" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="file-view">
|
||||
<div class="file-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/script.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/download.js"></script>
|
||||
<script>
|
||||
if (navigator.clipboard == undefined) { document.getElementsByClassName("copy")[0].outerHTML = ''; }
|
||||
|
||||
function test(el) {
|
||||
el.innerHTML = "test";
|
||||
}
|
||||
|
||||
var hash = "";
|
||||
var adminHash = "";
|
||||
handleUrl();
|
||||
function handleUrl() {
|
||||
console.log(document.location.pathname.split("/", 4));
|
||||
path = document.location.pathname.split("/", 4)
|
||||
if(path[2] !== undefined && path[2].length > 10 && path[2] === path[2].toUpperCase()) {
|
||||
if (path[2] !== undefined && path[2].length > 10 && path[2] === path[2].toUpperCase()) {
|
||||
hash = path[2];
|
||||
loadFiles();
|
||||
document.getElementById("file-view").style = "";
|
||||
if(path[3] !== undefined && path[3].length == 10 && path[3] === path[3].toUpperCase()) {
|
||||
loadPage(hash);
|
||||
if (path[3] !== undefined && path[3].length == 10 && path[3] === path[3].toUpperCase()) {
|
||||
adminHash = path[3];
|
||||
document.getElementById("admin-file-view").style = "";
|
||||
console.log("Admin is here!");
|
||||
}
|
||||
} else {
|
||||
document.getElementById("code-view").style = "";
|
||||
}
|
||||
}
|
||||
codeInput = document.getElementById("code");
|
||||
@@ -69,28 +97,6 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
function loadFiles() {
|
||||
var fileview = document.getElementById("file-view");
|
||||
fetch('/api/download/' + hash)
|
||||
.then(
|
||||
response => response.json()
|
||||
).then(jsonResponse => {
|
||||
console.log(jsonResponse);
|
||||
|
||||
if (jsonResponse.code == 200) {
|
||||
table = "<table class=\"file-table\"><tbody class=\"files\">";
|
||||
var i = 0
|
||||
jsonResponse.result.files.forEach(file => {
|
||||
table += "<tr id=\"file\"><td id=\"name\"><p title=\""+file.filename+"\">"+shortString(file.filename, 20)+"</p></td><td id=\"actions\"><div class=\"action-box\"><img id=\"img-download\" src=\"/img/cloud-download-outline-white.svg\" alt=\"Download\"><a target=\”_blank\” href='"+document.location.protocol+"//"+document.location.host+"/download/"+hash+"/index/"+i+"'></a></div></td></tr>";
|
||||
i++;
|
||||
});
|
||||
table += "</tbody></table>";
|
||||
fileview.innerHTML = table;
|
||||
} else {
|
||||
fileview.innerHTML = "<h1>Not Found</h1>";
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user