forked from hummypkg/webif
Compare commits
3 Commits
master
...
df-epgpopu
Author | SHA1 | Date |
---|---|---|
df | 2fb25a22c4 | |
df | cc3a79ca4a | |
df | 479510760c |
|
@ -104,8 +104,16 @@ proc slink {e} {
|
||||||
} else {
|
} else {
|
||||||
set ro 1
|
set ro 1
|
||||||
}
|
}
|
||||||
|
set perc [$e percent]
|
||||||
|
if {$perc >= 100} {
|
||||||
|
set state 2
|
||||||
|
} elseif {$perc > 0} {
|
||||||
|
set state 1
|
||||||
|
} else {
|
||||||
|
set state 0
|
||||||
|
}
|
||||||
set st [$e scheduled]
|
set st [$e scheduled]
|
||||||
return "<a class=event href=# xs=$service xe=[$e get event_id] sch=$st rec=$ro>"
|
return "<a class=event href=# xs=$service xe=[$e get event_id] sch=$st rec=$ro st=$state>"
|
||||||
}
|
}
|
||||||
|
|
||||||
proc prog {e {cont 0} {hour 99}} {
|
proc prog {e {cont 0} {hour 99}} {
|
||||||
|
|
|
@ -22,13 +22,6 @@ function doschedule(type)
|
||||||
var $buttons1 = {
|
var $buttons1 = {
|
||||||
"Close" : function() {$(this).dialog('close');}
|
"Close" : function() {$(this).dialog('close');}
|
||||||
};
|
};
|
||||||
var $buttons2 = $.extend(
|
|
||||||
{"Record Programme": function() { doschedule(1) }},
|
|
||||||
{"Set Reminder": function() { doschedule(3) }},
|
|
||||||
$buttons1);
|
|
||||||
var $buttons3 = $.extend(
|
|
||||||
{"Record Series": function() { doschedule(2) }},
|
|
||||||
$buttons2);
|
|
||||||
|
|
||||||
var $dialog = $('#epgpopup_dialogue').dialog({
|
var $dialog = $('#epgpopup_dialogue').dialog({
|
||||||
title: "Programme Details",
|
title: "Programme Details",
|
||||||
|
@ -46,17 +39,35 @@ function epgpopup(e, o)
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var sch = o.attr('sch');
|
var sch = o.attr('sch');
|
||||||
var rec = o.attr('rec');
|
var rec = o.attr('rec');
|
||||||
$dialog.dialog("option", "buttons", $buttons1);
|
var state = o.attr('st');
|
||||||
|
|
||||||
|
var $buttons2 = $.extend(
|
||||||
|
{"Record Series": function() { doschedule(2) }},
|
||||||
|
{"Record Programme": function() { doschedule(1) }},
|
||||||
|
{"Set Reminder": function() { doschedule(3) }},
|
||||||
|
{"Watch Now": function() { doschedule(3) }},
|
||||||
|
$buttons1);
|
||||||
|
|
||||||
if (sch != 0)
|
if (sch != 0)
|
||||||
$buttons = $buttons1;
|
$buttons = $buttons1;
|
||||||
else if (rec == 2)
|
else if (rec == 2 || rec == 1)
|
||||||
$buttons = $buttons3;
|
{
|
||||||
else if (rec == 1)
|
|
||||||
$buttons = $buttons2;
|
$buttons = $buttons2;
|
||||||
|
if (rec == 1) delete $buttons["Watch Now"];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$buttons = $buttons1;
|
$buttons = $buttons1;
|
||||||
|
|
||||||
|
if (state >= 1) {
|
||||||
|
delete $buttons["Record Programme"];
|
||||||
|
delete $buttons["Set Reminder"];
|
||||||
|
}
|
||||||
|
if (state == 0 || state == 2)
|
||||||
|
delete $buttons["Watch Now"];
|
||||||
|
}
|
||||||
|
|
||||||
|
$dialog.dialog("option", "buttons", $buttons);
|
||||||
|
|
||||||
var url = '/cgi-bin/epg/info.jim?service=' +
|
var url = '/cgi-bin/epg/info.jim?service=' +
|
||||||
o.attr('xs') + '&event=' +
|
o.attr('xs') + '&event=' +
|
||||||
o.attr('xe') + '&bare=1';
|
o.attr('xe') + '&bare=1';
|
||||||
|
|
|
@ -296,6 +296,8 @@ foreach e $records {
|
||||||
set showing 0
|
set showing 0
|
||||||
if {$perc > 0 && $perc < 100} { set showing 1 }
|
if {$perc > 0 && $perc < 100} { set showing 1 }
|
||||||
|
|
||||||
|
set state $($perc >= 100 ? 2: $showing)
|
||||||
|
|
||||||
set txt "[cgi_quote_html [$e get name]] <span>([\
|
set txt "[cgi_quote_html [$e get name]] <span>([\
|
||||||
clock format $es -format "%H:%M"] - [\
|
clock format $es -format "%H:%M"] - [\
|
||||||
clock format $ee -format "%H:%M"])"
|
clock format $ee -format "%H:%M"])"
|
||||||
|
@ -321,7 +323,7 @@ foreach e $records {
|
||||||
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
|
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
|
||||||
<a class=event href=# xs=[$e get service_id]
|
<a class=event href=# xs=[$e get service_id]
|
||||||
xe=[$e get event_id] sch=[$e get sched_type]
|
xe=[$e get event_id] sch=[$e get sched_type]
|
||||||
rec=$recopts>"
|
rec=$recopts st=$state>"
|
||||||
puts $txt
|
puts $txt
|
||||||
puts "</a>"
|
puts "</a>"
|
||||||
puts "</div>"
|
puts "</div>"
|
||||||
|
|
Loading…
Reference in New Issue