aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
Diffstat (limited to 'assets')
-rw-r--r--assets/admin.css36
-rw-r--r--assets/cargohold.css35
-rw-r--r--assets/cargohold.js22
3 files changed, 85 insertions, 8 deletions
diff --git a/assets/admin.css b/assets/admin.css
index 4fdc5fb..bfa854c 100644
--- a/assets/admin.css
+++ b/assets/admin.css
@@ -26,20 +26,44 @@ div.entry {
vertical-align: center;
}
-div.entry a.button {
+.info, .permission {
padding: 0.5em;
background-color: #c8e;
- text-decoration: none;
- margin-left: 0.5em;
- display: block;
border-radius: 0.5em;
+ margin-left: 0.5em;
+ text-decoration: none;
+ color: #453;
}
-a.delete {
+.button.delete {
background-color: #f79 !important;
}
-a.directory {
+.button.active {
+ background-color: #569;
+}
+
+.permission {
+ background-color: #366;
+ color: #acb;
+}
+
+.permission.disabled {
+ text-decoration: line-through;
+ background-color: #636;
+}
+
+a.entry {
text-decoration: none;
color: #aade88;
}
+
+span.dirname {
+ font-weight: bold;
+ font-style: italic;
+}
+
+#topmenu, #action {
+ display: inline-flex;
+ margin: 1em;
+}
diff --git a/assets/cargohold.css b/assets/cargohold.css
index 747b916..eddd1c7 100644
--- a/assets/cargohold.css
+++ b/assets/cargohold.css
@@ -56,7 +56,7 @@ html {
}
#dirlisting {
- padding: 2em;
+ padding: 0 2em 2em 2em;
}
#storage {
@@ -98,9 +98,14 @@ html {
background-color: #728;
padding: 0.5em;
text-align: left;
+}
+
+#header h1 {
font-size: 120%;
font-weight: bold;
font-family: sans;
+ display: inline-block;
+ margin: 0;
}
#container {
@@ -108,6 +113,24 @@ html {
width: 85%;
}
+a.button {
+ padding: 0.5em;
+ background-color: #c8e;
+ text-decoration: none;
+ margin-left: 0.5em;
+ border-radius: 0.5em;
+}
+
+.buttonrow {
+ display: block;
+ text-align: right;
+ padding: 0.5em;
+}
+
+.buttonrow > a {
+ display: inline-block;
+}
+
.tab-wrap > input {
display: none;
}
@@ -167,3 +190,13 @@ html {
border-radius: 1em;
background-color: #8885;
}
+
+.footer, .footer a {
+ text-align: right;
+ text-decoration: none;
+ color: #777;
+}
+
+.footer {
+ padding: 1em;
+}
diff --git a/assets/cargohold.js b/assets/cargohold.js
index 18dbeae..ea882fa 100644
--- a/assets/cargohold.js
+++ b/assets/cargohold.js
@@ -7,7 +7,6 @@
var running = false;
var queue = [];
-
function queue_work(){
let i = 0;
for(; i < queue.length; i++){
@@ -118,6 +117,7 @@ function interface_update(access){
function listing_add(file, style = "default"){
let link = node("a", "listing-entry", file.name);
link.href = "file/" + encodeURIComponent(file.name);
+ link.setAttribute("data-filename", file.name)
if(style == "gallery"){
let image = node("img", "preview");
@@ -139,14 +139,34 @@ function listing_update(){
for(let i = 0; i < data.files.length; i++){
listing_add(data.files[i], data.display);
}
+
+ element("download-all").innerText = "Download all (" + data.files.length + " Files, " + (data.total / 1024 /1024) + "MB)";
};
req.open("GET", "listing");
req.send();
}
+function download_all(ev){
+ let links = document.getElementsByClassName("listing-entry");
+ var current = 0;
+ var interval = setInterval(function(){
+ if(current < links.length){
+ link = links[current];
+ link.download = link.getAttribute("data-filename");
+ link.click();
+ link.removeAttribute("download");
+ current++;
+ }
+ else{
+ clearInterval(interval);
+ }
+ }, 1000);
+}
+
function init(){
element("file-submit").style.display = "none";
element("files").onchange = upload_start;
+ element("download-all").onclick = download_all;
listing_update();
}