aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-19 13:09:53 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit6442dad71030737b218758838378d1ea26214c4d (patch)
tree11a2102de19ea207709f0d066c52a239cb2684ba
parent09ae2f7593a66817f86fdb4f65076b24d9b2ff40 (diff)
downloadscummvm-rg350-6442dad71030737b218758838378d1ea26214c4d.tar.gz
scummvm-rg350-6442dad71030737b218758838378d1ea26214c4d.tar.bz2
scummvm-rg350-6442dad71030737b218758838378d1ea26214c4d.zip
CLOUD: Add "breadcrumbs" in "/filesAJAX"
-rw-r--r--backends/networking/wwwroot.zipbin239682 -> 240788 bytes
-rw-r--r--backends/networking/wwwroot/.filesAJAX.html44
-rw-r--r--backends/networking/wwwroot/style.css3
3 files changed, 44 insertions, 3 deletions
diff --git a/backends/networking/wwwroot.zip b/backends/networking/wwwroot.zip
index 7aa7df39ec..fc627d50ca 100644
--- a/backends/networking/wwwroot.zip
+++ b/backends/networking/wwwroot.zip
Binary files differ
diff --git a/backends/networking/wwwroot/.filesAJAX.html b/backends/networking/wwwroot/.filesAJAX.html
index d1d077fc66..aab2a0414a 100644
--- a/backends/networking/wwwroot/.filesAJAX.html
+++ b/backends/networking/wwwroot/.filesAJAX.html
@@ -86,6 +86,46 @@
listDirectory(path, items);
}
+ function makeBreadcrumb(name, path) {
+ var a = createElementWithContents("a", name);
+ a.onclick = function () { showDirectory(path); };
+ a.href = "javascript:onclick();";
+ return a;
+ }
+
+ function makeBreadcrumbs(path) {
+ var b = document.createElement("b");
+ b.className = "directory_name";
+
+ b.appendChild(createElementWithContents("span", "{index_of}"));
+ var slashes = true;
+ var crumb = "";
+ var currentPath = "";
+ path += ' '; //so the last slash is added
+ for (var i=0; i<path.length; ++i) {
+ if (path[i] == '/' || path[i] == '\\') {
+ if (!slashes) {
+ currentPath += crumb;
+ b.appendChild(makeBreadcrumb(crumb, currentPath+'/'));
+ slashes = true;
+ }
+ } else {
+ if (slashes) {
+ currentPath += "/";
+ if (currentPath == "/") { //make special '/' crumb here
+ b.appendChild(makeBreadcrumb('/', '/'));
+ } else {
+ b.appendChild(createElementWithContents("span", "/"));
+ }
+ slashes = false;
+ crumb = "";
+ }
+ crumb += path[i];
+ }
+ }
+ return b;
+ }
+
function listDirectory(path, items) {
// cleanup the list
var files_list = document.getElementById("files_list");
@@ -97,9 +137,7 @@
var tr = document.createElement("tr");
tr.appendChild(createElementWithContents("td", ""));
var td = document.createElement("td");
- var b = createElementWithContents("b", "{index_of}" + path.replace(new RegExp("\\\\", 'g'), '/'));
- b.className = "directory_name";
- td.appendChild(b);
+ td.appendChild(makeBreadcrumbs(path));
tr.appendChild(td);
tr.appendChild(createElementWithContents("td", ""));
tbody.appendChild(tr);
diff --git a/backends/networking/wwwroot/style.css b/backends/networking/wwwroot/style.css
index cc3a859137..c1bc14d652 100644
--- a/backends/networking/wwwroot/style.css
+++ b/backends/networking/wwwroot/style.css
@@ -93,3 +93,6 @@ td img { vertical-align: middle; height: 20px; }
display: block;
padding-bottom: 6px;
}
+
+.directory_name a { color: black; }
+.directory_name a:hover { color: blue; }