From 15b2be158ac0147982dd30382251b3ce83e219c7 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 11 May 2020 19:46:30 +0200 Subject: Generate download link for files --- plugins/webbox/TODO | 2 +- plugins/webbox/html/webbox.css | 2 ++ plugins/webbox/html/webbox.js | 26 +++++++++++++++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) (limited to 'plugins/webbox') diff --git a/plugins/webbox/TODO b/plugins/webbox/TODO index ffa32db..108b645 100644 --- a/plugins/webbox/TODO +++ b/plugins/webbox/TODO @@ -1,7 +1,7 @@ Prio 1 (for next version) ====== -generate download link for selected file +provide index for nested directories, also if requested via url gallery Info if not selected: all Copy function diff --git a/plugins/webbox/html/webbox.css b/plugins/webbox/html/webbox.css index 71e3673..6ea5147 100644 --- a/plugins/webbox/html/webbox.css +++ b/plugins/webbox/html/webbox.css @@ -248,10 +248,12 @@ table.list td.name { } /* Tooltip container */ +/* .tooltip { position: relative; display: inline-block; } +*/ /* Tooltip text */ /* diff --git a/plugins/webbox/html/webbox.js b/plugins/webbox/html/webbox.js index c25b039..e056c16 100644 --- a/plugins/webbox/html/webbox.js +++ b/plugins/webbox/html/webbox.js @@ -41,25 +41,41 @@ function loadContents(dir) { } else { for (var i = 0; i < listElements.length; i++) { var type = listElements[i].getAttribute("type"); + var filename = listElements[i].textContent; + var mouse_click = + "onclick=\"entryMouse('" + filename + "')\""; + + var full_path = currentDir + "/" + filename; + if (full_path.substr(0, 2) == "//") { + full_path = full_path.substr(1); + } + + // make relative path + while (full_path.substr(0, 1) == "/") { + full_path = full_path.substr(1); + } + + var name_td; if (type == "file") { type = ""; + name_td = "
" + filename + "
"; } else if (type == "dir") { type = ""; + name_td = "" + filename + ""; } else { type = ""; } var selector = ""; - if (listElements[i].textContent != "..") { - selector = "☐"; + if (filename != "..") { + selector = "☐"; } - var mouse_click = - "onclick=\"entryMouse('" + listElements[i].textContent + "')\""; result += "" + selector + "" + type + "" + - "" + listElements[i].textContent + ""; + name_td + + ""; } } -- cgit v1.2.3