<!-----------------------------------------------------------------------------
Copyright 2014-2025 Jesper Larsson
This file is part of Klipspringer, <https://klipspringer.avadeaux.net/>
Klipspringer is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
Klipspringer is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Klipspringer. If not, see <https://www.gnu.org/licenses/>.
--------------------------------------------------------------------------->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>$(klipstyle.css:file)</style>
<title>$(path)</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
$(klipicons.html:file)
</head>
<body>
<div id="content" class="choices browse">Loading...</div>
<script>
'use strict';
const content = document.getElementById("content");
const replaceContent = (text) => {
const pre = document.createElement("pre");
pre.appendChild(document.createTextNode(text));
content.innerHTML = "";
content.appendChild(pre);
}
const rejectError = (resp) => resp.body ? resp.text().then(text => Promise.reject(text)) : Promise.reject(text);
fetch("/dir?source=$(source)&path="+ encodeURIComponent("$(path)"))
.then(resp => resp.ok ? resp.json() : rejectError(resp))
.then(dir => {
content.innerHTML = "";
for (const x of dir) {
const a = document.createElement('a');
a.setAttribute('href', "/choice?source=$(source)&path="+encodeURIComponent("$(pathprefix)"+x));
a.appendChild(document.createTextNode(x.replace(/_/g, " ")));
content.appendChild(a);
content.appendChild(document.createElement('br'));
}
})
.catch(err => { replaceContent(err.toString()) });
</script>
</body>
</html>
Version: v4.3.2.2 (2026-05-16T17:03:34+02:00)
Raw file
Source code overview
Klipspringer home