From 50171cdd7b3b05a62826d88381e6e11ec22d95f3 Mon Sep 17 00:00:00 2001 From: Alib Date: Tue, 23 Mar 2010 17:23:31 +0100 Subject: added record from channel info --- js/istreamdev.js | 57 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 11 deletions(-) (limited to 'js') diff --git a/js/istreamdev.js b/js/istreamdev.js index cf49cbc..1ce37e9 100644 --- a/js/istreamdev.js +++ b/js/istreamdev.js @@ -56,13 +56,13 @@ $.getJSON("bin/backend.php", rec_path = data.rec_path; video_path = data.video_path; audio_path = data.audio_path; - if (streamdev_server != "") { + if (streamdev_server != "" && streamdev_server != "null") { addVdr(); } - if ( video_path != "" ) { + if ( video_path != "" && video_path != "null") { addVideofiles(); } - if ( audio_path != "" ) { + if ( audio_path != "" && audio_path != "null" ) { addAudiofiles(); } }); @@ -363,6 +363,28 @@ $('#streamchannel span.streamButton a').tap(function(event) { start_broadcast(type,url,mode); return false; }); +$('#streamchannel span.recButton a').tap(function(event) { + event.preventDefault(); + json_start(this); + var id = "new"; + var active= 1; + var name = $("#streamchannel").find('span[class="name_now"]').text(); + name = name.substr(4,name.length); + var channumber = $("#streamchannel").find('span[rel="number"]').text(); + var channame = $("#streamchannel").find('span[rel="channame"]').text(); + date = new Date(); + var rec_year = date.getFullYear(); + var rec_month = date.getMonth()+1; + rec_month = str_pad(rec_month,2,'0','STR_PAD_LEFT'); + var rec_day = date.getDate(); + rec_day = str_pad(rec_day,2,'0','STR_PAD_LEFT'); + var rec_date = rec_year + "-" + rec_month + "-" + rec_day; + var epgtime = $("#streamchannel").find('span[class="epgtime_now"]').text(); + var starttime = epgtime.substr(0,2) + epgtime.substr(3,2); + var endtime = epgtime.substr(6,2) + epgtime.substr(9,2); + gen_edittimer(id,name,active,channumber,channame,rec_date,starttime,endtime); + return false; +}); $('#streamrec span.streamButton a').tap(function(event) { event.preventDefault(); json_start(this); @@ -405,6 +427,8 @@ function gen_streamchannel(channame,channumber) { $("#streamchannel").find('span[class="epgtime_next"]').html( program.next_time ); $("#streamchannel").find('span[rel="url"]').html(streamdev_server + channumber); $("#streamchannel").find('span[rel="type"]').html('tv'); + $("#streamchannel").find('span[rel="number"]').html(channumber); + $("#streamchannel").find('span[rel="channame"]').html(channame); json_complete('#streamchannel','cube'); }); } @@ -796,7 +820,21 @@ function gen_timers(edit) { function gen_edittimer(id,name,active,channumber,channame,date,starttime,endtime) { $('ul[ref="submitbut"]').remove(); if (id) { + if (id=="new") { + $('#edittimer h1').html(' NEW TIMER'); + id=""; + submitbutton = ''; + $('#timer').append(submitbutton); + } + else + { $('#edittimer h1').html(' EDIT TIMER'); + submitbuttons = ''; + $('#timer').append(submitbuttons); + } if (active == 1) { $('#timer_active').attr('checked', true); @@ -825,10 +863,7 @@ function gen_edittimer(id,name,active,channumber,channame,date,starttime,endtime wheelend_m = endtime.substring(2,4); $('#layer_endtime').html(wheelend_h + 'h' + wheelend_m); $('#a_endtime').attr('href', "javascript:openSelectTime('layer_endtime','" + wheelend_h + "','" + wheelend_m + "')"); - submitbuttons = ''; - $('#timer').append(submitbuttons); + } else { $('#edittimer h1').html(' NEW TIMER'); @@ -922,11 +957,11 @@ function checktimerform() { function showStatus( timeout, message ) { if( timeout == 0 ) { - $('#timer_status').html(message); - $('#timer_status').show(); - setTimeout( function() { showStatus( 1, message ); }, 4000 ); + $('#status_box').html(message); + $('#status_box').show(); + setTimeout( function() { showStatus( 1, message ); }, 5000 ); } else if( timeout == 1 ) { - $('#timer_status').hide(); + $('#status_box').hide(); } } // [/TIMER SECTION] -- cgit v1.2.3