From a480d0c3c82ddf4efa2b82b8f95bf336299ec40f Mon Sep 17 00:00:00 2001 From: ulrich <not disclosed> Date: Tue, 02 Jan 2018 13:16:55 +0000 Subject: [PATCH] Sender lesen berichtigt --- app.js | 12 +++++++++++- tpl/sender.tpl | 24 ++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app.js b/app.js index 1d258d7..0967f49 100644 --- a/app.js +++ b/app.js @@ -11,12 +11,22 @@ //app_get_template('tpl/prefs.tpl', 'prefs'); $('.sued').text('Bereit.'); setTimeout(function() { - $("#sender").html(Mustache.render(templateCache[TPL_SENDER], '')); + app_get_sender(); }, 200); } /* --- Ajax-Aufrufe --- */ +function app_get_sender() { + $.ajax({ + url: "api/sender.json", + type: "GET", + dataType : "json" + }).done(function( senderliste ) { + $("#sender").html(Mustache.render(templateCache[TPL_SENDER], senderliste)); + }); +} + /* Ein Template vom Server in den Cache laden template_url - home.tpl, prefs.tpl, sender.tpl diff --git a/tpl/sender.tpl b/tpl/sender.tpl index 3b3bc7d..5fcedd0 100644 --- a/tpl/sender.tpl +++ b/tpl/sender.tpl @@ -1,16 +1,8 @@ -<div class="sender-kachel"> - <div class="sender-name">hr info</div> - <div class="sender-bild-behaelter"><img class="sender-bild" src="../bilder/hr-info.png"></div> -</div> -<div class="sender-kachel"> - <div class="sender-name">radiobob</div> - <div class="sender-bild-behaelter"><img class="sender-bild" src="../bilder/radio-bob-logo-80.png"></div> -</div> -<div class="sender-kachel"> - <div class="sender-name">hr3</div> - <div class="sender-bild-behaelter"><img class="sender-bild" src="../bilder/hr3.png"></div> -</div> -<div class="sender-kachel"> - <div class="sender-name">FFH</div> - <div class="sender-bild-behaelter"><img class="sender-bild" src="../bilder/ffh.svg"></div> -</div> +{{#senderliste}} + {{#inhalt}} + <div class="sender-kachel" data-verweis="{{senderurl}}"> + <div class="sender-name">{{sendername}}</div> + <div class="sender-bild-behaelter"><img class="sender-bild" src="{{senderlogo}}"></div> + </div> + {{/inhalt}} +{{/senderliste}} -- Gitblit v1.9.3