From 95ae5cd3a1b3572d48c8eaae8708866de8c235e5 Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Sat, 20 Sep 2014 01:07:11 +0000
Subject: show selection works now


diff --git a/index.html b/index.html
index 6110def..7d31438 100644
--- a/index.html
+++ b/index.html
@@ -51,6 +51,17 @@
     weekday[5] = "Freitag";
     weekday[6] = "Samstag";
 
+
+    function showSelectedShow() {
+      var id = $('#show-selector option:selected').attr('value');
+      var show = $.grep(shows_list, function(elem) { return elem.id == id; })[0];
+      $('#show-title').text(show.title);
+      $('#show-dow').text(weekday[show.dow]);
+      $('#show-rhythm').text(show.rhythm);
+      $('#show-starttime').text(show.starttime);
+      $('#show-length').text(show.length + ' Min.');
+    }
+
     function updateShowsList(data, status, req) {
       shows_list = [];
       $('#show-selector').find('option').remove();
@@ -78,6 +89,7 @@
           }
         }
       )
+      showSelectedShow()
     }
 
     var shows_list = [];
@@ -87,6 +99,9 @@
       $.post("/listshows.cgi", data, updateShowsList, "xml")
     }
 
+
+
+
     function selectApp(app) {
        switch(app) {
          case "musicpools":
@@ -224,7 +239,7 @@
           <div class="span10">
             <form class="well form-inline">
               <label class="control-label" for="select-dropbox"><h3>Sendung auswählen</h3></label>&nbsp;&nbsp;
-              <select id="show-selector">
+              <select id="show-selector" onchange="showSelectedShow()">
               </select>
             </form>
           </div>
-- 
cgit v0.10.2