Bedienoberfläche für Webradio
ulrich
2018-01-06 e6c850b5714551cffdc0eaeacbf08703d969fad1
Sender in Bearbeitungsformular übernehmen
3 files modified
46 ■■■■ changed files
app.css 11 ●●●●● patch | view | raw | blame | history
app.js 21 ●●●● patch | view | raw | blame | history
data/tpl/dlg-sender-edit-form.tpl 14 ●●●● patch | view | raw | blame | history
app.css
@@ -109,6 +109,17 @@
  background-color: #f6f6f6; // grau
}
.sender-edit-label {
  display: inline-block;
  width: 3em;
  text-align: right;
}
.sender-eingabe {
  /* display: inline-block; */
  width: 80%;
}
/*
  Close Button
app.js
@@ -35,7 +35,8 @@
/* --- Menüfunktionen --- */
function app_nachricht_test() {
  app_dialog_laden_und_zeigen(templateCache[TPL_DLG_MSG], 'data/msg-test.json');
  app_dialog_laden_und_zeigen(
    templateCache[TPL_DLG_MSG], 'data/msg-test.json');
  app_menu_toggle();
}
@@ -109,14 +110,17 @@
      Mustache.render(templateCache[TPL_SENDER], senderliste));
    $('.sender-kachel').on('click', function() {
      var kachel = $( this );
      var senderId = kachel.attr("sid");
      var senderId = $(kachel).attr("sid");
      var senderName = $(kachel).find(".sender-name").text();
      var senderUrl = $(kachel).attr("data-verweis");
      var senderLogo = $(kachel).find("img").attr("src");
      var s = new Sender(senderId, senderName, senderUrl, senderLogo);
      switch (senderKlickModus) {
          case "1":
            break;
          case "2":
            $(".dlg-behaelter").html(
              Mustache.render(templateCache[TPL_SENDER_EDIT_FORM], '')
              Mustache.render(templateCache[TPL_SENDER_EDIT_FORM], s)
            );
            $('#sender-speichern').on('click', function() {
              $('#sender-speichern').off('click');
@@ -128,7 +132,7 @@
            break;
          default:
            app_meldung_mit_timeout(
              'Sender ' + senderName + ', ID ' + senderId,
              'Sender ' + s.name + ', ID ' + s.id,
              1500
            );
            break;
@@ -165,3 +169,12 @@
    templateCache[tname] = template;
  });
}
/* Objekte */
function Sender(i, n, u, l) {
  this.id = i;
  this.name = n;
  this.url = u;
  this.logo = l;
}
data/tpl/dlg-sender-edit-form.tpl
@@ -1,8 +1,16 @@
<div class="dlg-sender-titel">Sender bearbeiten</div>
<form>
  <input id="sender-name" placeholder="Name" type="text" class="sender-eingabe"></br>
  <input id="sender-logo" placeholder="Logo" type="text" class="sender-eingabe"></br>
  <input id="sender-url" placeholder="URL" type="text" class="sender-eingabe"></br>
  <input value="{{id}}" id="sender-id" name="sender-id" type="hidden"
      class="sender-eingabe"></br>
  <label class="sender-edit-label">Name:</label>
  <input value="{{name}}" id="sender-name" name="sender-name" placeholder="Name"
      type="text" class="sender-eingabe"></br>
  <label class="sender-edit-label">Logo:</label>
  <input value="{{logo}}" id="sender-logo" name="sender-logo" placeholder="Logo"
      type="text" class="sender-eingabe"></br>
  <label class="sender-edit-label">URL:</label>
  <input value="{{url}}" id="sender-url"  name="sender-url" placeholder="URL"
      type="text" class="sender-eingabe"></br>
  <div class="form-button-footer">
    <button type="button" id="sender-speichern">Speichern</button>
  </div>