summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-03-25 15:13:16 +0100
committerTheTroll <trolldev@gmail.com>2010-03-25 15:13:16 +0100
commit84042aa476d9a89f5e96fec39e41f5eea93aa8d7 (patch)
treef00c45d7c0a80a74e8392c37f0077f4b60d232d3
parent27c05ed330b662cd0956f596bf786d2fa4205c45 (diff)
parentf305e11d4ac9a709aa22513ceb2c3d99776b6ee5 (diff)
downloadistreamdev-84042aa476d9a89f5e96fec39e41f5eea93aa8d7.tar.gz
istreamdev-84042aa476d9a89f5e96fec39e41f5eea93aa8d7.tar.bz2
Merge branch 'jquery' of projects.vdr-developer.org:istreamdev into jquery
* 'jquery' of projects.vdr-developer.org:istreamdev: now show a selector on top depending of content ( channels or category )
-rw-r--r--index.php1
-rw-r--r--js/istreamdev.js37
2 files changed, 30 insertions, 8 deletions
diff --git a/index.php b/index.php
index 24e3c5a..5752648 100644
--- a/index.php
+++ b/index.php
@@ -247,6 +247,7 @@ include ('bin/auth.php');
<a href="#home" id="home_but" class="button">Home</a>
<h1>EPG</h1>
</div>
+ <ul class="rounded"><li id="epg_selector"></li></ul>
<ul class="edgetoedge" id="ul_epglist">
</ul>
</div>
diff --git a/js/istreamdev.js b/js/istreamdev.js
index ecac8b2..565ae69 100644
--- a/js/istreamdev.js
+++ b/js/istreamdev.js
@@ -973,13 +973,13 @@ json_start(this);
channel = $('#epgform #epg_chan').val();
time = $('#epgform #epg_time').val();
day = $('#epgform select##epg_day').val();
- if ( channel == "all" ) {
- programs = 2;
- }
- else if ( time == "" ) {
+ if ( time == "" ) {
programs = "day";
+ }
+ else if ( channel == "all" ) {
+ programs = 2;
} else {
- programs = 20;
+ programs = "day";
}
get_epg(channel,time,day,programs);
$(this).removeClass('active');
@@ -1001,8 +1001,8 @@ function gen_epgmenu() {
function gen_epgchanlist() {
$('#epg #epg_chan').html('<option value="all">All channels</option>');
- data = $('#jqt').data('channellist');
- $.each(data.category, function(i,category){
+ datachanlist = $('#jqt').data('channellist');
+ $.each(datachanlist.category, function(i,category){
$('#epg #epg_chan').append('<optgroup label="' + category.name + '">');
var catname = category.name;
$.each(category.channel, function(j, channel){
@@ -1037,8 +1037,29 @@ var dataString = 'action=getEpg&channel=' + channel + '&time=' + time + '&day='
$.getJSON("bin/backend.php",
dataString,
function(data) {
+ $('#jqt').data("epg",data);
+ $('#epglist #epg_selector').html('');
+ if ( data.category.length > 1 )
+ {
+ $('#epglist #epg_selector').append('<select id="epglist_cat"></select>');
+ $.each(data.category, function(i,category){
+ $('#epglist #epg_selector #epglist_cat').append('<option value="' + i + '">' + category.name + '</option>');
+ });
+ }
+ else {
+ $('#epglist #epg_selector').append('<select id="epglist_chan"></select>');
+ data = $('#jqt').data('channellist');
+ $.each(data.category, function(i,category){
+ $('#epglist #epg_selector #epglist_chan').append('<optgroup label="' + category.name + '">');
+ var catname = category.name;
+ $.each(category.channel, function(j, channel){
+ $('#epglist #epg_selector #epglist_chan optgroup[label="' + catname +'"]').append('<option value="' + channel.number + '">' + channel.name +'</option>');
+ });
+ $('#epg_chan').append('</optgroup>');
+ });
+ }
var k=1;
- $.each(data.channel, function(i,channel){
+ $.each(data.category[0].channel, function(i,channel){
if ( k > 10 ) {
togglestatus = 'toggle';
}