114 lines
2.7 KiB
HTML
114 lines
2.7 KiB
HTML
|
<!doctype html>
|
||
|
<html lang="de">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<link href="/misc/font.css" rel="stylesheet">
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
|
||
|
<div id="Ordner"></div>
|
||
|
|
||
|
|
||
|
<script src="/misc/jquery.min.js"></script>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
|
||
|
$(document).ready(function() {
|
||
|
|
||
|
var Orderdirekt = getUrlParameter('dir');
|
||
|
|
||
|
if(Orderdirekt==undefined)
|
||
|
{
|
||
|
// Wenn kein Ordner übergeben wurde, dann zeigen wir die Startseite an
|
||
|
ShowHomePage();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
// Wenn ein Order übergeben wurde, wollen wir diesen anzeigen
|
||
|
ShowFolderPics(Orderdirekt);
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
function ShowHomePage() {
|
||
|
|
||
|
$("#Ordner").empty();
|
||
|
|
||
|
$.ajax({
|
||
|
method: "GET",
|
||
|
contentType:'application/json; charset=utf-8',
|
||
|
url: '/folder/',
|
||
|
dataType: "json",
|
||
|
data: "",
|
||
|
success: function(content){
|
||
|
|
||
|
//http://127.0.0.1:8000/img/2019-11-15/IMG_4186.JPG
|
||
|
for ( var i = 0, l = content.length; i < l; i++ ) {
|
||
|
var ObjInhalt = content[i];
|
||
|
$("#Ordner").append(""+
|
||
|
"<span style=\"color: gray; font-size: 30pt\" class=\"icon-folder\"></span> | "+
|
||
|
"<a href=\"#\" onclick=\"ShowFolderPics('"+ObjInhalt+"')\">"+
|
||
|
ObjInhalt+"</a><hr>");
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
function ShowFolderPics(folder) {
|
||
|
|
||
|
// Ordner div leeren
|
||
|
$("#Ordner").empty();
|
||
|
|
||
|
var Orderdirekt = getUrlParameter('dir');
|
||
|
if(Orderdirekt==undefined) {
|
||
|
$("#Ordner").append('<a href="#" onclick=ShowHomePage()>Zurück</a><hr>');
|
||
|
}
|
||
|
|
||
|
$.ajax({
|
||
|
method: "GET",
|
||
|
contentType:'application/json; charset=utf-8',
|
||
|
url: '/folder/'+folder,
|
||
|
dataType: "json",
|
||
|
data: "",
|
||
|
success: function(content){
|
||
|
|
||
|
//http://127.0.0.1:8000/img/2019-11-15/IMG_4186.JPG
|
||
|
for ( var i = 0, l = content.length; i < l; i++ ) {
|
||
|
var ObjInhalt = content[i];
|
||
|
$("#Ordner").append(""+
|
||
|
"<img src=\"/thumb/"+folder+"/"+ObjInhalt+"\" width=200>"+
|
||
|
"<a href=\"/imgdl/"+folder+"/"+ObjInhalt+"\">"+
|
||
|
ObjInhalt+"</a><hr>");
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
//--------------------------------------------------------------------------
|
||
|
// Hilfsfunktionen
|
||
|
//--------------------------------------------------------------------------
|
||
|
|
||
|
function getUrlParameter(sParam) {
|
||
|
var sPageURL = window.location.search.substring(1),
|
||
|
sURLVariables = sPageURL.split('&'),
|
||
|
sParameterName,
|
||
|
i;
|
||
|
|
||
|
for (i = 0; i < sURLVariables.length; i++) {
|
||
|
sParameterName = sURLVariables[i].split('=');
|
||
|
|
||
|
if (sParameterName[0] === sParam) {
|
||
|
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|