summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlib <aliboba@free.fr>2010-03-25 00:21:23 +0100
committerAlib <aliboba@free.fr>2010-03-25 00:21:23 +0100
commit498a9fd1d4fdd300555fbc30648679e0a7b1b01b (patch)
tree5c254fa7af45b44575e16c1325d46eca68029317
parenta02c43d36c20990ae5f6e1bcf29441269fba3177 (diff)
downloadistreamdev-498a9fd1d4fdd300555fbc30648679e0a7b1b01b.tar.gz
istreamdev-498a9fd1d4fdd300555fbc30648679e0a7b1b01b.tar.bz2
working on epg
-rw-r--r--index.php7
-rw-r--r--js/functions.js16
-rw-r--r--js/istreamdev.js52
3 files changed, 59 insertions, 16 deletions
diff --git a/index.php b/index.php
index a994049..25a5c6e 100644
--- a/index.php
+++ b/index.php
@@ -223,15 +223,18 @@ include ('bin/auth.php');
<a href="#" class="back">Home</a>
<h1>EPG</h1>
</div>
+ <form name="epgform" id="epgform" action="#">
<ul class="rounded">
<li><span class="timertitle">Select Channel:</span></li>
<li><select id="epg_chan"><option value="all">All channels</option></select></li>
<li><span class="timertitle">Select Day:</span></li>
<li><select id="epg_day"><option value="today">Today</option></select>
<li><span class="timertitle">Select Time:</span></li>
- <li class="arrow"><a onclick="$('#timer_starttime_error').hide();" href="javascript:openSelectTime('layer_epgtime')" class="abutton" id="a_starttime"><span id="layer_epgtime" class="menuname">Now</span></a></li>
+ <li class="arrow"><a href="javascript:openSelectTime('layer_epgtime')" class="abutton" id="a_starttime"><span id="layer_epgtime" class="menuname">Now</span></a></li>
</ul>
- <ul class="rounded" ref="submitbut"><li><center><a href="#" class="submit_form">Get Programs</a></center></li></ul>
+ <input name="epg_time" type="hidden" id="epg_time" value="" />
+ <ul class="rounded" ref="submitbut"><li><center><a href="#" class="submit_epg">Get Programs</a></center></li></ul>
+ </form>
</div>
<div id="now">
diff --git a/js/functions.js b/js/functions.js
index 5db31a3..eefbca9 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -67,11 +67,23 @@ function openSelectTime(layer,timer_hour,timer_minute) {
}
SpinningWheel.addSlot(hours, 'right', now_hour);
- //SpinningWheel.addSlot({ separator: 'h' }, 'readonly shrink');
SpinningWheel.addSlot(minutes, '', now_minute);
SpinningWheel.setCancelAction( function() { $('a').removeClass('active');} );
- SpinningWheel.setDoneAction(function () {var results = SpinningWheel.getSelectedValues(); document.getElementById(layer).innerHTML = results.values.join('h');if ( layer == 'layer_starttime' ) { var forminput = 'timer_starttime'; } else { var forminput = 'timer_endtime'; }; eval ("document.timer." + forminput + ".value = results.values.join('')");$('a').removeClass('active'); });
+ SpinningWheel.setDoneAction( function () {
+ var results = SpinningWheel.getSelectedValues();
+ $('#'+layer).html(results.values.join('h'));
+ if ( layer == 'layer_starttime' ) {
+ var forminput = 'timer_starttime';
+ } else if ( layer == 'layer_endtime' ) {
+ var forminput = 'timer_endtime';
+ } else if ( layer == 'layer_epgtime' ) {
+ var forminput = 'epg_time';
+ }
+ //eval ("document.timer." + forminput + ".value = results.values.join('')");
+ $('#'+forminput).val(results.values.join(''));
+ $('a').removeClass('active');
+ });
SpinningWheel.open();
}
diff --git a/js/istreamdev.js b/js/istreamdev.js
index c745381..3cd0c50 100644
--- a/js/istreamdev.js
+++ b/js/istreamdev.js
@@ -112,9 +112,9 @@ function json_start(button) {
$('#loader').css("top", window.pageYOffset);
}
function json_complete(destination,effect) {
- $('#loader').removeClass("loader");
- $('a').removeClass('active');
jQT.goTo(destination,effect);
+ //$('#loader').removeClass("loader");
+ $('a').removeClass('active');
}
function hide_loader() {
$('#loader').removeClass("loader");
@@ -133,6 +133,7 @@ function reinitDivs() {
$(document).ready(function(e){
$('div').bind('pageAnimationEnd', function(event, info){
if (info.direction == 'in') {
+ $('#loader').removeClass("loader");
$('li[rel="toggle"]').show();
}
@@ -151,7 +152,7 @@ $('a[class="back"]').tap(function(event) {
// show active sessions
$(document).ready(function(e){
getRunningSessions();
-//preloadLogos();
+preloadLogos();
});
//reinit RunningSessions when going to Home:
@@ -218,6 +219,7 @@ $('#timers_but').tap(function(event) {
$('#epg_but').tap(function(event) {
event.preventDefault();
+ json_start(this);
gen_epgmenu();
return false;
});
@@ -964,11 +966,29 @@ function showStatus( timeout, message ) {
// [/TIMER SECTION]
// [EPG SECTION]
+//buttons
+$('.submit_epg').tap(function(event) {
+ event.preventDefault();
+ channel = $('#epgform #epg_chan').val();
+ time = $('#epgform #epg_time').val();
+ day = $('#epgform select##epg_day').val();
+ if ( channel == "all" ) {
+ programs = 2;
+ }
+ else {
+ programs = 10;
+ }
+ get_epg(channel,time,day,programs);
+ $(this).removeClass('active');
+ });
+
+
+//functions
function gen_epgmenu() {
- jQT.goTo('#epg','cube');
gen_epgchanlist();
gen_epgdatelist();
+ json_complete('#epg','cube');
}
function gen_epgchanlist() {
@@ -984,25 +1004,33 @@ function gen_epgchanlist() {
});
}
-// 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('<option value="' + date_fulldate + '">Today</option>');
+var date_hour = str_pad(date.getHours(),2,'0','STR_PAD_LEFT');
+var date_min = str_pad(date.getMinutes(),2,'0','STR_PAD_LEFT');
+$('#epg #epg_time').val(date_hour + '' + date_min);
+//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('<option value="0">Today</option>');
var dayname = new Array( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" );
- for ( i=0;i<daymax;i++ ) {
+ for ( i=1;i<daymax;i++ ) {
date_milli=date.getTime();
date.setTime(date_milli+86400000);
- $('#epg #epg_day').append('<option value="' + date.getFullYear() + '-' + str_pad(date.getMonth()+1,2,'0','STR_PAD_LEFT') + '-' + str_pad(date.getDate(),2,'0','STR_PAD_LEFT') + '">' + dayname[date.getDay()] + ' ' + date.getDate() + '/' + (date.getMonth()+1) + '</option>');
+ $('#epg #epg_day').append('<option value="' + i + '">' + dayname[date.getDay()] + ' ' + date.getDate() + '/' + (date.getMonth()+1) + '</option>');
}
}
+function get_epg(channel,time,day,programs) {
+var dataString = 'action=getEpg&channel=' + channel + '&time=' + time + '&day=' + day + '&programs=' + programs;
+ $.getJSON("bin/backend.php",
+ dataString,
+ function(data) {
+ $.each(data.channel, function(i,channel){
+ //TODO
+ });
+}
// [/EPG SECTION]