From a1832052ff736a5957dd0215759c3cefad0af3f9 Mon Sep 17 00:00:00 2001 From: Alib Date: Wed, 24 Mar 2010 20:29:51 +0100 Subject: added epg menu form , not complete --- js/istreamdev.js | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'js') diff --git a/js/istreamdev.js b/js/istreamdev.js index 16bc9dc..c745381 100644 --- a/js/istreamdev.js +++ b/js/istreamdev.js @@ -58,6 +58,7 @@ $.getJSON("bin/backend.php", audio_path = data.audio_path; if (streamdev_server != "" && streamdev_server != "null") { addVdr(); + gen_formchanlist(); } if ( video_path != "" && video_path != "null") { addVideofiles(); @@ -72,7 +73,7 @@ function addVdr() { vdrmenu += '
  • Watch TV
  • '; vdrmenu += '
  • Recordings
  • '; vdrmenu += '
  • Timers
  • '; - vdrmenu += '
  • Program Guide
  • \n'; + vdrmenu += '
  • Program Guide
  • \n'; $('#home #runningsessions').after(vdrmenu); } function addVideofiles() { @@ -215,6 +216,12 @@ $('#timers_but').tap(function(event) { return false; }); +$('#epg_but').tap(function(event) { + event.preventDefault(); + gen_epgmenu(); + return false; +}); + $('#video_but').tap(function(event) { event.preventDefault(); json_start(this); @@ -732,11 +739,6 @@ function addplayer(button) { // [/BROWSER SECTION] // [TIMER SECTION] -//get fullchannel list onload - -$(document).ready(function(e){ -gen_formchanlist(); -}); // buttons $('#timers li[class="arrow"] a').tap(function(event) { @@ -962,21 +964,45 @@ function showStatus( timeout, message ) { // [/TIMER SECTION] // [EPG SECTION] + +function gen_epgmenu() { + jQT.goTo('#epg','cube'); + gen_epgchanlist(); + gen_epgdatelist(); +} + function gen_epgchanlist() { + $('#epg #epg_chan').html(''); data = $('#jqt').data('channellist'); $.each(data.category, function(i,category){ - $('#epg_chan').append(''); + $('#epg #epg_chan').append(''); var catname = category.name; $.each(category.channel, function(j, channel){ - $('#epg_chan optgroup[label="' + catname +'"]').append(''); + $('#epg #epg_chan optgroup[label="' + catname +'"]').append(''); }); $('#epg_chan').append(''); }); } -// check if chan is slected +// check if chan is selected function epg_selectchan() { selectedchan = $('#epg_chan').val(); } +function gen_epgdatelist() { +var daymax = 8; +var date = new Date(); +var date_year = date.getFullYear(); +var date_month = date.getMonth()+1; +var date_day = date.getDate(); +var date_fulldate = date_year + '-' + str_pad(date_month,2,'0','STR_PAD_LEFT') + '-' + str_pad(date_day,2,'0','STR_PAD_LEFT'); +$('#epg #epg_day').html(''); +var dayname = new Array( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ); + for ( i=0;i' + dayname[date.getDay()] + ' ' + date.getDate() + '/' + (date.getMonth()+1) + ''); + } +} + // [/EPG SECTION] -- cgit v1.2.3