Über den Parameter "dir" (z.B. ?dir=2019-11-20) kann ein Ordner nun direkt aufgerufen werden
This commit is contained in:
parent
c746f0bae5
commit
32867955ff
@ -16,15 +16,26 @@
|
|||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
ShowHomePage();
|
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() {
|
function ShowHomePage() {
|
||||||
|
|
||||||
$("#Ordner").empty();
|
$("#Ordner").empty();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
contentType:'application/json; charset=utf-8',
|
contentType:'application/json; charset=utf-8',
|
||||||
@ -37,7 +48,7 @@
|
|||||||
for ( var i = 0, l = content.length; i < l; i++ ) {
|
for ( var i = 0, l = content.length; i < l; i++ ) {
|
||||||
var ObjInhalt = content[i];
|
var ObjInhalt = content[i];
|
||||||
$("#Ordner").append(""+
|
$("#Ordner").append(""+
|
||||||
"<img src=\""+ServerAPI+"/qr/"+ServerAPI+"/dir/"+ObjInhalt+"\" width=150 height=150>"+
|
"<img src=\""+ServerAPI+"/qr/"+encodeURIComponent(ServerAPI+"/?dir="+ObjInhalt)+"\" width=150 height=150>"+
|
||||||
"<a href=\"#\" onclick=\"ShowFolderPics('"+ObjInhalt+"')\">"+
|
"<a href=\"#\" onclick=\"ShowFolderPics('"+ObjInhalt+"')\">"+
|
||||||
ObjInhalt+"</a><hr>");
|
ObjInhalt+"</a><hr>");
|
||||||
}
|
}
|
||||||
@ -72,6 +83,26 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// 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>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user