diff --git a/var/mongoose/cgi-bin/epg/service.jim b/var/mongoose/cgi-bin/epg/service.jim index 396efc8..05195cc 100755 --- a/var/mongoose/cgi-bin/epg/service.jim +++ b/var/mongoose/cgi-bin/epg/service.jim @@ -53,7 +53,7 @@ puts { set i 0 foreach record $records { altrow - $record get_channel_info + #$record get_channel_info set ended [$record ended] if {[$record showing]} { puts "" diff --git a/var/mongoose/cgi-bin/status.jim b/var/mongoose/cgi-bin/status.jim index 5c08be1..639f746 100755 --- a/var/mongoose/cgi-bin/status.jim +++ b/var/mongoose/cgi-bin/status.jim @@ -80,8 +80,12 @@ if {[llength $data]} { incr seen($name) if {$runmode eq "cgi"} { - lappend output " - $mode $name" + lappend output [concat \ + "\n" \ + " \n" \ + " $mode $name\n" \ + "\n" \ + ] } else { lappend output "$mode $name" } @@ -115,10 +119,13 @@ if {![system instandby] && $play < 1} { } if {$runmode eq "cgi"} { - lappend output "[epg channelicon $name 30 \ - {vertical-align: middle; padding: 0 4px 0 2px}] - - Watching $lcn: $name $prog" + lappend output [concat \ + "\n" \ + " [epg channelicon $name 30 \ + {vertical-align: middle; padding: 0 4px 0 2px}]\n" \ + " Watching $lcn: $name $prog\n" \ + "\n" \ + ] } else { lappend output "Watching $lcn: $name $prog" } @@ -127,9 +134,13 @@ if {![system instandby] && $play < 1} { if {[system instandby]} { if {$runmode eq "cgi"} { - lappend output " - System is in standby." + lappend output [concat \ + "\n" + " \n" \ + " System is in standby.\n" \ + "" \ + ] } else { lappend output "System is in standby." } @@ -137,7 +148,7 @@ if {[system instandby]} { if {[llength $output]} { if {$runmode eq "cgi"} { - puts [join $output "
"] + puts [join $output "\n
\n"] } else { puts [join $output "\n"] } diff --git a/var/mongoose/html/m/channel.jim b/var/mongoose/html/m/channel.jim new file mode 100755 index 0000000..d189cc5 --- /dev/null +++ b/var/mongoose/html/m/channel.jim @@ -0,0 +1,60 @@ +#!/mod/bin/jimsh + +package require cgi +source /mod/webif/lib/setup +require epg.class + +cgi_input + +set sid [cgi_get sid 0] + +mheader + +set records [epg dbfetch dump -service $sid -after [clock seconds]] +set tr [lindex $records 0] +$tr get_channel_info + +set day 0 +puts " +
+ [$tr channel_icon 40] + + [$tr get channel_num] - [$tr get channel_name] + +
+" + +mfooter + diff --git a/var/mongoose/html/m/index.html b/var/mongoose/html/m/index.html new file mode 100644 index 0000000..480bdea --- /dev/null +++ b/var/mongoose/html/m/index.html @@ -0,0 +1,3 @@ + + + diff --git a/var/mongoose/html/m/index.jim b/var/mongoose/html/m/index.jim new file mode 100755 index 0000000..f940802 --- /dev/null +++ b/var/mongoose/html/m/index.jim @@ -0,0 +1,38 @@ +#!/mod/bin/jimsh + +source /mod/webif/lib/setup +require settings.class plugin + +mheader + +puts "" + +mfooter + diff --git a/var/mongoose/html/m/lib/footer.jim b/var/mongoose/html/m/lib/footer.jim new file mode 100755 index 0000000..dc463ab --- /dev/null +++ b/var/mongoose/html/m/lib/footer.jim @@ -0,0 +1,20 @@ +#!/mod/bin/jimsh + +puts { + + +
+} + +if {![catch { + set rendertime [expr [expr [clock milliseconds] - $renderstart] / 1000.0] + }]} { + puts "Rendered in: $rendertime seconds" +} + +puts { +
+ + +} + diff --git a/var/mongoose/html/m/lib/header.jim b/var/mongoose/html/m/lib/header.jim new file mode 100755 index 0000000..32e7300 --- /dev/null +++ b/var/mongoose/html/m/lib/header.jim @@ -0,0 +1,54 @@ +#!/mod/bin/jimsh + +source /mod/webif/lib/setup +require system.class + +puts "Humax [system model] Fox T2 ([system hostname])" + +puts " + + + + + Humax [system model] Fox T2 ([system hostname]) + +" + +puts { + + + + + + + + + + + + + + + +} + +puts " + + +
+ +
+ +
+ +

[system model] ([system hostname])

+
+ +
+" + +set renderstart [clock milliseconds] + diff --git a/var/mongoose/html/m/nownext.jim b/var/mongoose/html/m/nownext.jim new file mode 100755 index 0000000..5e4d941 --- /dev/null +++ b/var/mongoose/html/m/nownext.jim @@ -0,0 +1,62 @@ +#!/mod/bin/jimsh + +package require cgi +source /mod/webif/lib/setup +require epg.class + +mheader + +set stt [clock seconds] +set ett $($stt + 14400) +set records [epg dbfetch dump -trange "$stt:$ett"] + +puts "" + +mfooter + diff --git a/var/mongoose/html/m/script.js b/var/mongoose/html/m/script.js new file mode 100644 index 0000000..119a33e --- /dev/null +++ b/var/mongoose/html/m/script.js @@ -0,0 +1,7 @@ + +$(document).bind('pageinit', function() { + $('div.status').last().load('/cgi-bin/status.jim', function() { + $(this).slideDown('slow'); + }); +}); + diff --git a/var/mongoose/html/m/style.css b/var/mongoose/html/m/style.css new file mode 100644 index 0000000..6dbd436 --- /dev/null +++ b/var/mongoose/html/m/style.css @@ -0,0 +1,27 @@ +.va +{ + vertical-align: middle; +} + +.hidden +{ + display: none; +} + +div.status +{ + font-size: 0.7em; + text-align: center; + vertical-align: middle; + display: none; + width: 100%; + background: blue; + color: white; +} + +.blood +{ + color: #ff4000; + background: transparent; +} + diff --git a/var/mongoose/lib/epg.class b/var/mongoose/lib/epg.class index 42edf98..1642e2b 100644 --- a/var/mongoose/lib/epg.class +++ b/var/mongoose/lib/epg.class @@ -368,6 +368,8 @@ proc {epg dbfetch} {mode args} { "and e.event_id = $v " } -time { append q \ "and e.start < $v and e.end > $v " } + -after { append q \ + "and e.end >= $v " } -trange { lassign [split $v :] stt ett append q "and ( diff --git a/var/mongoose/lib/setup b/var/mongoose/lib/setup index 2df6623..3fc06f8 100644 --- a/var/mongoose/lib/setup +++ b/var/mongoose/lib/setup @@ -17,6 +17,14 @@ if {![exists -proc require]} { uplevel source /mod/webif/html/lib/footer.jim } + proc mheader {} { + uplevel source /mod/webif/html/m/lib/header.jim + } + + proc mfooter {} { + uplevel source /mod/webif/html/m/lib/footer.jim + } + # Replace the built-in jim {file copy} command with one that is # largefile safe.