various updates

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1210 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2012-11-06 22:58:17 +00:00
parent c208e186c3
commit d05632e8d3
5 changed files with 106 additions and 24 deletions

View File

@ -1,9 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 0.10.0
Version: 0.10.0-1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.3),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2)
Depends: webif-channelicons(>=1.0.3),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools
Suggests: ffmpeg
Description: An evolving web interface for the Humax.

View File

@ -11,19 +11,23 @@ require epg.class spinner.class altrow epg_search totop
cgi_input
puts {<link type="text/css" href="/css/xepg.css" rel="Stylesheet" />}
puts {
<link type="text/css" href="/css/xepg.css" rel="Stylesheet" />
<script type=text/javascript src=/js/enadis.js></script>
}
[spinner new {
text "Loading Now/Next Information..."
text "Loading EPG Information..."
size "1.2em"
style "margin: 1em;"
}] start
require epg_popup
set stt [cgi_get stt [clock seconds]]
if {$stt <= [clock seconds]} {
set stt [clock seconds]
set now [clock seconds]
set stt [cgi_get stt $now]
if {$stt <= $now} {
set stt $now
set current 1
} else {
set current 0
@ -40,7 +44,7 @@ set stt [expr int($stt / 1800.0) * 1800]
set ett $(int($stt + $seconds))
set offset $(($ostt - $stt) / 1800.0)
set chanpx 120
set chanpx 160
set eventpx 1000
set totalpx $($chanpx + $eventpx)
set contwidth $($totalpx + 50)
@ -64,21 +68,40 @@ if {$::qepg} {
}
set got [clock milliseconds]
puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
if {$stt > [clock seconds]} {
puts "<button id=earlier>&lt;&lt;&lt; Earlier</button>"
proc but {label time {active 1}} {
puts -nonewline "<button style=\"margin-right: 2em\" tt=$time"
if {$active} {
puts -nonewline " class=nav"
} else {
puts -nonewline " disabled class=\"nav ui-state-disabled\""
}
puts " active=$active>$label</button>"
}
puts "<button id=later>Later &gt;&gt;&gt;</button>"
puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
but "&lt&lt; -1 Week" $($stt - 3600 * 24 * 7) $($stt - $now >= 3600 * 24 * 7)
but "&lt&lt; -1 Day" $($stt - 3600 * 24) $($stt - $now >= 3600 * 24)
but "&lt;&lt; Earlier", $($stt - 3600 * 4) $($stt > $now)
but "&lt; Now &gt;" $now $($current == 0)
but "&gt;&gt; Later" $ett;
but "&gt;&gt; +1 Day" $($stt + 3600 * 24) $($stt < $now + 8 * 3600 * 24)
but "&gt;&gt; +1 Week" $($stt + 3600 * 24 * 7) $($stt < $now + 8 * 3600 * 24)
puts "</div>"
puts "
<script type=text/javascript>
\$('button.nav').button();
</script>
<div id=xepg style=\"min-width: ${contwidth}px; overflow: auto\">
<div id=xepgnow></div>
<div id=xegrid>
"
puts "<div id=epgdate style=\"width: ${eventpx}px; margin-left: ${chanpx}px;\">"
puts [clock format $stt -format {%a %D}]
puts [clock format $stt -format {%a %d/%m/%Y}]
puts "<input type=hidden id=xepg_dp stt=$stt>"
puts "</div>"
puts "<div class=xechan style=\"width: ${chanpx}px;\">&nbsp;</div>"
@ -173,6 +196,9 @@ puts "
Switch to standard now/next display.
</button></small>
</div>
"
puts "
<script type=text/javascript>
\$(document).ready(function() {
@ -180,12 +206,37 @@ puts "
\$('#epgswitch').button().click(function() {
window.location = '/epg.shtml';
});
\$('#earlier').button().click(function() {
window.location = '/cgi-bin/xepg.jim?stt=$earlier';
\$('button.nav').click(function() {
window.location = '/cgi-bin/xepg.jim?stt=' + \$(this).attr('tt') +
'&pos=' + \$('#xegrid').scrollTop();
});
\$('#later').button().click(function() {
window.location = '/cgi-bin/xepg.jim?stt=$ett';
\$('#xepg_dp').datepicker({
buttonImage: '/img/cal.gif',
buttonImageOnly: true,
showOn: 'button',
dateFormat: '@',
minDate: '[expr $now * 1000]',
maxDate: '[expr ($now + 7 * 86400) * 1000]',
onSelect: function(val, sel) {
var stt = \$(this).attr('stt');
// Extract date part
dval = ~~(val / 86400000);
// Extract current time part
var tm = ~~(stt % 86400);
var ret = dval * 86400 + tm;
window.location = '/cgi-bin/xepg.jim?stt=' + ret;
}
});
\$('img.ui-datepicker-trigger').hover(
function() { \$(this).css('cursor', 'pointer'); },
function() { \$(this).css('cursor', 'auto'); }
);
"
if {$current} {

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

View File

@ -13,6 +13,7 @@ set dir [cgi_get dir [system mediaroot]]
set model [system model]
set dustbin [system dustbin 1]
set order [[settings new] sortorder]
proc icon {img {hover ""} {extra ""} {class "va"}} {
puts -nonewline "<img src=$img class=\"$class\" height=21 $extra"
@ -173,8 +174,38 @@ puts "
directory [join [lrange [split $dir /] 0 end-1] /] "\[parent directory\]" \
_parent "/images/711_3_09_Media_Folder_UP.png"
proc s_time {a b} {
global dir
set a "$dir/$a"
set b "$dir/$b"
set ad [file isdirectory $a]
set bd [file isdirectory $b]
if {$ad && !$bd} { return -1 }
if {$bd && !$ad} { return 1 }
if {$ad && $bd} {
if {$a < $b} { return -1 }
if {$a > $b} { return 1 }
return 0
}
if {[catch {file stat $a l}]} { return 0}
set at $l(ctime)
if {[catch {file stat $b l}]} { return 0}
set bt $l(ctime)
if {$at < $bt} { return -1 }
if {$at > $bt} { return 1 }
return 0
}
set files [readdir -nocomplain $dir]
set files [lsort $files]
switch $order {
1 { set files [lsort -command s_time $files] }
default { set files [lsort $files] }
}
foreach file $files { entry "$dir/$file" }

View File

@ -90,15 +90,15 @@ proc eventrow {event {table TBL_RESERVATION}} {
set e $($s + $d)
set n [clock seconds]
set ds "[clock format $s -format "%a %d %b %Y"]<br>
[clock format $s -format "%H:%M %Z"]"
if {$n > $e && [$event get ersvtype] <= 3} {
puts "<td nowrap class=va
alt=\"$ds\" title=\"$ds\">
--- -- --- ----<br>--:--"
set ds "[clock format $s -format {%a %d %b %Y %H:%M}]"
puts "<td nowrap class=va>
--- -- --- ---- --:--<br>
<span class=footnote>(Last: $ds)</span>"
puts "</td><td>--:--:--</td>"
} else {
set ds "[clock format $s -format "%a %d %b %Y"]<br>
[clock format $s -format "%H:%M %Z"]"
puts "<td nowrap class=\"va"
if {$n > $e} { puts " blood" }
puts "\">$ds"