summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-02-19 00:20:47 +0100
committerache <ache@ache.one>2019-02-19 00:20:47 +0100
commit634e16fb14036a86f0841fe47910ed5621ff867b (patch)
tree908caf60dcf02df2ef99e38c092c6c628fef9226
parentNormalise Name (diff)
Use table to show information
-rw-r--r--dir.html24
1 files changed, 16 insertions, 8 deletions
diff --git a/dir.html b/dir.html
index a0767ec..1f8a700 100644
--- a/dir.html
+++ b/dir.html
@@ -6,15 +6,22 @@
<body>
<h1>Index of {{ .Name }}</h1><br>
<section id="main">
-<pre>{{range .ListFiles}}
- <a href="{{ .Path }}">{{ .Name }}</a>{{ .Size }}{{end}}
-</pre>
+<table>
+ <tbody>
+ {{range .ListFiles}}
+ <tr><td><a href="{{ .Path }}">{{ .Name }}</a></td><td>{{ .Size }}</td></tr>
+ {{end}}
+ </tbody>
+</table>
</section>
<section id="nav">
<h2>List of directories</h2>
-<pre>{{range .ListCols}}
- <a href="{{ .Path }}">{{ .Name }}</a>{{end}}
-</pre>
+<table>
+ <tbody>
+ {{range .ListCols}}
+ <tr><td><a href="{{ .Path }}">{{ .Name }}</a></td></tr>
+ {{end}}
+</table>
</section>
<section id="dav">
<div class="uploadDiv">
@@ -94,20 +101,21 @@ const deleteMethode = url => {
};
const onPageLoad = () => {
- console.log("🦊");
const as = Array.from(document.getElementsByTagName('a'));
as.forEach( e => {
const a = document.createElement('a');
+ const td = document.createElement('td');
a.appendChild(document.createTextNode('X'));
a.classList.add('delete');
a.href = "#";
a.onclick = () => false;
+ td.appendChild(a);
a.addEventListener('click', () => {
deleteMethode('/' + e.href.split('/').slice(3).join('/'))
return false;
}, false);
- e.parentNode.insertBefore(a, e.nextSibling);
+ e.parentNode.parentNode.appendChild(td);
});
}