| | |
| | | document.querySelector(".zentraler-inhalt").innerHTML = html; |
| | | self.addEvtListener('.entity-eintrag', 'click', function (event) { |
| | | var t = event.target; |
| | | self.meldung_mit_timeout(t.textContent, 1500); |
| | | //self.meldung_mit_timeout(t.textContent, 1500); |
| | | self.http_get('../api/store/Ablageort/' + t.textContent, function(responseText){ |
| | | ablageort = JSON.parse(responseText); |
| | | self.ablageort_form(ablageort); |
| | | }); |
| | | }); |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | this.ablageort_neu = function () { |
| | | self.vorlage_laden_und_fuellen("data/tpl/form_ablageort.tpl", "", function (html) { |
| | | /* |
| | | * Ablageort-Formular anzeigen |
| | | * |
| | | * {"name":"Katalog 2","ort":"/home/ulrich/Videos","url":"/media/kat2"}: |
| | | * |
| | | * @param {type} ablageort der Ablageort, der bearbeitet werden soll, leer fuer neuen Ort |
| | | * @returns {undefined} kein Rueckgabewert |
| | | */ |
| | | this.ablageort_form = function(ort) { |
| | | self.vorlage_laden_und_fuellen("data/tpl/form_ablageort.tpl", ort, function (html) { |
| | | document.querySelector(".zentraler-inhalt").innerHTML = html; |
| | | self.addEvtListener('#ok-btn', 'click', function () { |
| | | var a = new Ablageort( |
| | |
| | | document.querySelector('#ablageort-url').value |
| | | ); |
| | | var daten = JSON.stringify(a); |
| | | if(typeof ort === "undefined") { |
| | | self.http_post('../api/store/Ablageort', daten, function (responseText) { |
| | | // hier die Antwort verarbeiten |
| | | }); |
| | | } else { |
| | | self.http_put('../api/store/Ablageort', daten, function (responseText) { |
| | | // hier die Antwort verarbeiten |
| | | }); |
| | | } |
| | | }); |
| | | self.addEvtListener('#cancel-btn', 'click', function () { |
| | | document.querySelector(".zentraler-inhalt").innerHTML = ''; |
| | |
| | | self.dialog_laden_und_zeigen('data/tpl/dlg-loeschen.tpl', dlgdata, function() { |
| | | self.addEvtListener('#nein-btn', 'click', self.dialog_schliessen); |
| | | self.addEvtListener('#ja-btn', 'click', function() { |
| | | // hier loeschen |
| | | self.http_delete('../api/store/Ablageort/' + aoname, '', function (responseText) { |
| | | // hier die Antwort verarbeiten |
| | | }); |
| | | }); |
| | | }); |
| | | }); |
| | |
| | | self.http_call('POST', u, data, cb); |
| | | }; |
| | | |
| | | this.http_put = function (u, data, cb) { |
| | | self.http_call('PUT', u, data, cb); |
| | | }; |
| | | |
| | | this.http_delete = function (u, data, cb) { |
| | | self.http_call('DELETE', u, data, cb); |
| | | }; |