From 38ca22c1b216b75fa725bbe8d0da89384fee4294 Mon Sep 17 00:00:00 2001 From: Alib Date: Wed, 17 Mar 2010 15:29:56 +0100 Subject: running session in home --- js/istreamdev.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'js/istreamdev.js') diff --git a/js/istreamdev.js b/js/istreamdev.js index 53963bc..a5e33fb 100644 --- a/js/istreamdev.js +++ b/js/istreamdev.js @@ -68,6 +68,7 @@ $.getJSON("bin/backend.php", //Goto home $('#home_but').tap(function(event) { event.preventDefault(); + getRunningSessions(); jQT.goTo('#home','flip'); }); @@ -128,6 +129,35 @@ $('#audio_but').tap(function(event) { gen_browser(audio_path,browser,"Audio","aud"); return false; }); +// show active sessions +$(document).ready(function(e){ +getRunningSessions(); +}); + +function getRunningSessions() { +var dataString = "action=getRunningSessions"; + $('#home #runningsessions').html(''); + //Json call to get category array + $.getJSON("bin/backend.php", + dataString, + function(data){ + $('#home #runningsessions').append('
  • SESSIONS
  • '); + if ( data.broadcast[0].session ) { + $.each(data.broadcast, function(i,broadcast){ + session = broadcast.session; + name = broadcast.name; + type = broadcast.type; + if (type == 'tv') { var pic='tv.png'; } + else if (type == 'rec') { var pic='record.png'; } + else if (type == 'vid') { var pic='video.png'; } + $('#home #runningsessions').append('
  • *Live: ' + name + '
  • '); + }); + } + else { + $('#home #runningsessions').append('
  • No running session
  • '); + } + }); +} // [/HOME SECTION] // [TV SECTION] -- cgit v1.2.3