| | |
| | | }); |
| | | } else { |
| | | // Pfad listen |
| | | self.http_get('..' + self.ortPfad + '/' + self.mediaPfad + '/', function(responseText) { |
| | | console.log("vorher ortPfad: " + self.ortPfad); |
| | | console.log("vorher mediaPfad: " + self.mediaPfad); |
| | | //self.http_get('..' + self.ortPfad + '/' + self.mediaPfad + '/', function(responseText) { |
| | | var url = '..' + self.ortPfad + self.mediaPfad; |
| | | if(!url.endsWith('/')) { |
| | | url = url + '/'; |
| | | } |
| | | console.log("url: " + url); |
| | | self.http_get(url, function(responseText) { |
| | | //console.log(responseText); |
| | | self.vorlage_laden_und_fuellen("data/tpl/katalog_inhalt_liste.tpl", JSON.parse(responseText), function (html) { |
| | | document.querySelector(".zentraler-inhalt").innerHTML = html; |
| | | console.log("mediaPfad bei Anzeige: " + self.mediaPfad); |
| | | self.addEvtListener('.entity-eintrag', 'click', function (event) { |
| | | var t = event.target; |
| | | //console.log(t.textContent); |
| | | var tx = t.textContent; |
| | | console.log("tx: " + tx); |
| | | console.log("mediaPfad nach Auswahl: " + self.mediaPfad); |
| | | if(t.classList.contains("entity-typ-folder")) { |
| | | self.mediaPfad = self.mediaPfad + '/' + t.textContent; |
| | | if(self.mediaPfad.endsWith('/')) { |
| | | self.mediaPfad = self.mediaPfad + tx; |
| | | } else { |
| | | self.mediaPfad = self.mediaPfad + '/' + tx; |
| | | } |
| | | //self.mediaPfad = self.mediaPfad + t.textContent; |
| | | console.log("mediaPfad neu: " + self.mediaPfad); |
| | | self.media_liste(); |
| | | } else { |
| | | console.log("Media-Inhalt auswaehlen oder abspielen"); |
| | |
| | | self.ortPfad = '/'; |
| | | } else { |
| | | var pos = self.mediaPfad.lastIndexOf('/'); |
| | | var parent = self.mediaPfad.substring(0, pos); |
| | | //console.log("Parent: " + parent); |
| | | var parent; |
| | | if(pos > 1) { |
| | | parent = self.mediaPfad.substring(0, pos); |
| | | } else { |
| | | parent = '/'; |
| | | } |
| | | console.log("Parent: " + parent); |
| | | self.mediaPfad = parent; |
| | | } |
| | | self.media_liste(); |