update to 0.6.3, show alternate showings

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@280 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg
2011-07-18 19:26:58 +00:00
parent 301336b778
commit d764969b8f
6 changed files with 155 additions and 82 deletions

View File

@@ -16,11 +16,24 @@ set event 0
catch { set event [dict get $_cgi event] }
if {! [dict exists $_cgi bare]} { header }
#set service 8384
#set event 25293
#set service 8448
#set event 30843
set record [lindex [epg fetch dump -service $service -event $event] 0]
$record get_channel_info
set others [$record othertimes]
puts {
<style type=text/css>
font.also
{
font-size: 0.9em;
font-style: italic;
color: #333;
background: transparent;
}
</style>
}
puts "
<table class=keyval>
@@ -32,7 +45,29 @@ puts "
<td>[$record get text]</td>
</tr><tr>
<th>Start</th>
<td>[clock format [$record get start] -format {%c %Z}]</td>
<td>[clock format [$record get start] -format {%c %Z}]
"
foreach o $others {
if {[$o ended]} { continue }
$o get_channel_info
$o process_sched
if {[$o get series_crid] eq ""} { set ro 1 } else { set ro 2 }
puts -nonewline "<br><font class=also>&nbsp;&nbsp;&nbsp;&nbsp;"
puts -nonewline "Also: "
puts -nonewline "<a class=event href=# xs=[$o get service_id] "
puts -nonewline "xe=[$o get event_id] "
puts -nonewline "sch=[$o get sched_type] rec=$ro>"
puts -nonewline "[clock format [$o get start] -format {%c %Z}]"
puts -nonewline " on "
puts -nonewline [$o channel_icon 16]
puts -nonewline "[$o get channel_name] "
puts "</a>"
puts "</font>"
}
puts "
</td>
</tr><tr>
<th>Duration</th>
<td>[clock format [$record get duration] -format %T]
@@ -60,8 +95,13 @@ if {[$record get warning] != ""} {
if {[$record get event_crid] != ""} {
puts "
<tr>
<th>CRID</th>
<td>[$record get channel_crid][$record get event_crid]</td>
<th>CRID</th><td>
<a href=/cgi-bin/epg_search.jim?crid=[$record get event_crid]>
<img border=0 height=14
src=/images/421_1_00_CH_Title_2R_Arrow.png>
[$record get channel_crid][$record get event_crid]
</a>
</td>
</tr>
"
}

View File

@@ -95,9 +95,14 @@ foreach record [lsort -command rsort $records] {
}
altrow
$record get_channel_info
puts "<td nowrap>
set ended [$record ended]
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>"}
puts "
[clock format [$record get start] -format "%a %d %b %Y"]<br>
[clock format [$record get start] -format "%H:%M %Z"]</td>"
[clock format [$record get start] -format "%H:%M %Z"]"
puts "</td>"
puts "<td>[$record get channel_num]</td>"
puts "<td>[$record channel_icon 50]</td>"
puts "<td nowrap>

View File

@@ -20,10 +20,7 @@ cgi_input
require epg_popup
set service 0
set service 4351
catch { set service [dict get $_cgi service] }
set service [cgi_get service 4351]
set records [epg fetch dump -service $service]
set tr [lindex $records 0]
@@ -55,13 +52,14 @@ set i 0
foreach record $records {
altrow
$record get_channel_info
set ended [$record ended]
if {[$record showing]} {
puts "<td><img src=/images/111_1_00_Cursor_2R_Arrow.png></td>"
} else { puts "<td></td>" }
puts "<td nowrap>
[clock format [$record get start] -format "%a %d %b %Y"]</td>"
puts "<td nowrap>
[clock format [$record get start] -format "%H:%M"]</td>"
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
puts "[clock format [$record get start] -format "%a %d %b %Y"]</td>"
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
puts "[clock format [$record get start] -format "%H:%M"]</td>"
puts [$record cell]
puts "<td>[$record get text]</td>"
puts "<td>[$record get warning]</td>"

View File

@@ -70,8 +70,15 @@ epg method percent {} {
}
epg method showing {} {
set percent [$self percent]
if {$percent > 0 && $percent < 100} { return 1 } else { return 0 }
set now [clock seconds]
if {$start > $now} { return 0 }
if {$start + $duration < $now} { return 0 }
return 1
}
epg method ended {} {
if {$start + $duration < [clock seconds]} { return 1 }
return 0
}
epg method elapsed {} {
@@ -152,15 +159,7 @@ epg method get_rsv {} {
}
}
epg method icon_set {{height 0}} {
if {$height > 0} { set height "height=$height" } else { set height "" }
set icon [$self type_icon]
set set ""
if {$icon != ""} {
lappend set "<img src=$icon $height
alt=\"$content_type\" title=\"$content_type\">"
}
epg method process_sched {} {
set sched_type 0
if {$event_crid ne "" && "$channel_hsvc$event_crid" in $::rsvlookup} {
set sched_type 1
@@ -170,6 +169,18 @@ epg method icon_set {{height 0}} {
"$channel_hsvc$series_crid" in $::rsvlookup} {
set sched_type 2
}
}
epg method icon_set {{height 0}} {
if {$height > 0} { set height "height=$height" } else { set height "" }
set icon [$self type_icon]
set set ""
if {$icon != ""} {
lappend set "<img src=$icon $height
alt=\"$content_type\" title=\"$content_type\">"
}
$self process_sched
if {$sched_type == 2} {
lappend set \
@@ -240,6 +251,18 @@ epg method recommended {} {
return $rec
}
epg method othertimes {} {
if {$event_crid eq ""} { return "" }
set others ""
foreach other [epg fetch dump -crid $event_crid] {
if {[$other get service_id] == $service_id &&
[$other get event_id] == $event_id} { continue }
lappend others $other
}
return $others
}
proc {epg parse} {line} {
set e [epg new]
$e _parse $line

View File

@@ -1,63 +1,70 @@
puts {
<div id=dialogue></div>
<script type=text/javascript>
$(document).ready(function() {
function doschedule(type)
{
$('#epginfo_extra').load('/cgi-bin/epg_schedule.jim?' +
'service=' +
encodeURIComponent($('#dialogue').attr('xs')) +
'&event=' +
encodeURIComponent($('#dialogue').attr('xe')) +
'&type=' + type, function() {
$('#restart_block')
.load('/cgi-bin/restartblock.jim');
});
$(":button:contains('Record')").fadeOut('slow');
}
var $buttons1 = {
"Close" : function() {$(this).dialog('close');}
};
var $buttons2 = $.extend(
{"Record Programme": function() { doschedule(1) }},
$buttons1);
var $buttons3 = $.extend(
{"Record Series": function() { doschedule(2) }},
$buttons2);
$(document).ready(function() {
function doschedule(type)
{
$('#epginfo_extra').load('/cgi-bin/epg_schedule.jim?' +
'service=' +
encodeURIComponent($('#dialogue').attr('xs')) +
'&event=' +
encodeURIComponent($('#dialogue').attr('xe')) +
'&type=' + type, function() {
$('#restart_block')
.load('/cgi-bin/restartblock.jim');
});
$(":button:contains('Record')").fadeOut('slow');
}
var $dialog = $('#dialogue').dialog({
title: "Programme Details",
modal: false, autoOpen: false,
height: 500, width: 700,
show: 'scale', hide: 'fade',
draggable: true, resizable: true,
buttons: $buttons1,
close: function(e,u) { $('#dialogue').empty().html(
'<img src="/img/loading.gif" alt="loading">'); }
});
$('a.event').click(function(e) {
e.preventDefault();
var sch = $(this).attr('sch');
var rec = $(this).attr('rec');
if (sch != 0)
$dialog.dialog("option", "buttons", $buttons1);
else if (rec == 2)
$dialog.dialog("option", "buttons", $buttons3);
else if (rec == 1)
$dialog.dialog("option", "buttons", $buttons2);
else
$dialog.dialog("option", "buttons", $buttons1);
var url = '/cgi-bin/epg_info.jim?service=' +
$(this).attr('xs') + '&event=' +
$(this).attr('xe') + '&bare=1';
$('#dialogue').load(url);
$('#dialogue')
.attr('xs', $(this).attr('xs'))
.attr('xe', $(this).attr('xe'));
$dialog.dialog('open');
});
var $buttons1 = {
"Close" : function() {$(this).dialog('close');}
};
var $buttons2 = $.extend(
{"Record Programme": function() { doschedule(1) }},
$buttons1);
var $buttons3 = $.extend(
{"Record Series": function() { doschedule(2) }},
$buttons2);
var $dialog = $('#dialogue').dialog({
title: "Programme Details",
modal: false, autoOpen: false,
height: 500, width: 700,
show: 'scale', hide: 'fade',
draggable: true, resizable: true,
buttons: $buttons1,
close: function(e,u) { $('#dialogue').empty().html(
'<img src="/img/loading.gif" alt="loading">'); }
});
function epgpopup(e, o)
{
e.preventDefault();
var sch = o.attr('sch');
var rec = o.attr('rec');
if (sch != 0)
$dialog.dialog("option", "buttons", $buttons1);
else if (rec == 2)
$dialog.dialog("option", "buttons", $buttons3);
else if (rec == 1)
$dialog.dialog("option", "buttons", $buttons2);
else
$dialog.dialog("option", "buttons", $buttons1);
var url = '/cgi-bin/epg_info.jim?service=' +
o.attr('xs') + '&event=' +
o.attr('xe') + '&bare=1';
$('#dialogue').load(url, function() {
$('#dialogue a.event').click(function(e) {
epgpopup(e, $(this));
});
});
$('#dialogue')
.attr('xs', o.attr('xs'))
.attr('xe', o.attr('xe'));
$dialog.dialog('open');
}
$('a.event').click(function(e) { epgpopup(e, $(this)) });
});
</script>
}