checkpoint
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1172 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
6e06f3875a
commit
eb0adb8f29
@ -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 "<td><img src=/images/111_1_00_Cursor_2R_Arrow.png></td>"
|
||||
|
@ -80,8 +80,12 @@ if {[llength $data]} {
|
||||
incr seen($name)
|
||||
|
||||
if {$runmode eq "cgi"} {
|
||||
lappend output "<img class=va src=/images/$icon>
|
||||
<span class=va>$mode <i>$name</i></span>"
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" <img class=va src=/images/$icon>\n" \
|
||||
" <span>$mode <i>$name</i></span>\n" \
|
||||
"</span>\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}]
|
||||
<span class=va>
|
||||
Watching <i>$lcn: $name $prog</i></span>"
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" [epg channelicon $name 30 \
|
||||
{vertical-align: middle; padding: 0 4px 0 2px}]\n" \
|
||||
" <span>Watching <i>$lcn: $name $prog</i></span>\n" \
|
||||
"</span>\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 "<img class=va width=28 style=\"padding: 0 4px\"
|
||||
src=/img/standby.png>
|
||||
<span class=va>System is in standby.</span>"
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n"
|
||||
" <img class=va width=28 style=\"padding: 0 4px\"" \
|
||||
"src=/img/standby.png>\n" \
|
||||
" <span>System is in standby.</span>\n" \
|
||||
"</span>" \
|
||||
]
|
||||
} else {
|
||||
lappend output "System is in standby."
|
||||
}
|
||||
@ -137,7 +148,7 @@ if {[system instandby]} {
|
||||
|
||||
if {[llength $output]} {
|
||||
if {$runmode eq "cgi"} {
|
||||
puts [join $output "<br>"]
|
||||
puts [join $output "\n<br>\n"]
|
||||
} else {
|
||||
puts [join $output "\n"]
|
||||
}
|
||||
|
60
var/mongoose/html/m/channel.jim
Executable file
60
var/mongoose/html/m/channel.jim
Executable file
@ -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 "
|
||||
<div class=va style=\"font-size: 1.2em; padding: 0 0 1em 0\">
|
||||
[$tr channel_icon 40]
|
||||
<span class=va>
|
||||
[$tr get channel_num] - [$tr get channel_name]
|
||||
</span>
|
||||
</div>
|
||||
<ul data-role=listview data-filter=true>
|
||||
"
|
||||
|
||||
foreach e $records {
|
||||
set st [$e get start]
|
||||
set nday [clock format $st -format "%F"]
|
||||
if {$day ne $nday} {
|
||||
set day $nday
|
||||
puts "<li data-role=list-divider>
|
||||
[clock format $st -format "%a %d %b %Y"]
|
||||
</li>"
|
||||
}
|
||||
set et $($st + [$e get duration])
|
||||
puts "
|
||||
<li><a href=event.jim?sid=[$e get service_id]&eid=[$e get event_id]>
|
||||
<h4>[$e get name]</h4>
|
||||
<p style=\"white-space: normal\">[$e get text]</p>
|
||||
"
|
||||
set guidance [$e get warning]
|
||||
if {$guidance ne ""} {
|
||||
puts "<p class=blood style=\"white-space: normal\">
|
||||
$guidance</p>"
|
||||
}
|
||||
puts "
|
||||
<p class=ui-li-aside>
|
||||
[clock format $st -format "%H:%M"] -
|
||||
[clock format $et -format "%H:%M"]
|
||||
</p>
|
||||
</a></li>
|
||||
"
|
||||
}
|
||||
|
||||
puts "</ul>"
|
||||
|
||||
mfooter
|
||||
|
3
var/mongoose/html/m/index.html
Normal file
3
var/mongoose/html/m/index.html
Normal file
@ -0,0 +1,3 @@
|
||||
<html><head>
|
||||
<meta http-equiv=refresh content="0; URL=index.jim">
|
||||
</head></html>
|
38
var/mongoose/html/m/index.jim
Executable file
38
var/mongoose/html/m/index.jim
Executable file
@ -0,0 +1,38 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class plugin
|
||||
|
||||
mheader
|
||||
|
||||
puts "<ul data-role=listview data-inset=true>"
|
||||
|
||||
proc tb {icon txt link {height 80} {width 0}} {
|
||||
if {$width > 0} {
|
||||
set width " width=$width"
|
||||
} else {
|
||||
set width ""
|
||||
}
|
||||
puts -nonewline "<li><a href=\"$link\">
|
||||
<img src=\"$icon\" height=${height}${width} border=0>
|
||||
<h3>$txt</h3>
|
||||
</a></li>"
|
||||
}
|
||||
|
||||
if {[file exists "/mod/bin/ir"]} {
|
||||
tb "/img/remote.png" "Remote" "/plugin/ir/m/index.jim\" rel=\"external"
|
||||
}
|
||||
tb "/images/323_1_10_Menu_Video.png" "Browse" "#"
|
||||
tb "/images/321_1_00_Menu_CHList.png" "Schedule" "#"
|
||||
tb "/images/328_1_26_Menu_TV_Guide.png" "Now/Next" "nownext.jim"
|
||||
tb "/img/spanner.png" "Services" "#"
|
||||
tb "/img/packages.png" "Packages" "#"
|
||||
tb "/images/326_1_00_Menu_Settings.png" "Settings" \
|
||||
"/cgi-bin/settings.jim\" rel=\"external"
|
||||
tb "/img/diagnostics.png" "Diag" "#"
|
||||
#eval_plugins toolbar
|
||||
|
||||
puts "</ul>"
|
||||
|
||||
mfooter
|
||||
|
20
var/mongoose/html/m/lib/footer.jim
Executable file
20
var/mongoose/html/m/lib/footer.jim
Executable file
@ -0,0 +1,20 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
</div>
|
||||
|
||||
<div data-role=footer data-theme=c>
|
||||
}
|
||||
|
||||
if {![catch {
|
||||
set rendertime [expr [expr [clock milliseconds] - $renderstart] / 1000.0]
|
||||
}]} {
|
||||
puts "<font class=footnote>Rendered in: $rendertime seconds</font>"
|
||||
}
|
||||
|
||||
puts {
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
|
54
var/mongoose/html/m/lib/header.jim
Executable file
54
var/mongoose/html/m/lib/header.jim
Executable file
@ -0,0 +1,54 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
puts "Humax [system model] Fox T2 ([system hostname])"
|
||||
|
||||
puts "
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
Humax [system model] Fox T2 ([system hostname])
|
||||
</title>
|
||||
"
|
||||
|
||||
puts {
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width,user-scalable=no,initial-scale=1">
|
||||
<meta name=apple-mobile-web-app-capable content=yes>
|
||||
<meta name=apple-mobile-web-app-status-bar-style content=black>
|
||||
<link rel="stylesheet" href="/lib/jquery.mobile/jquery.mobile.css" />
|
||||
<link rel="stylesheet" href="/m/style.css" type="text/css"/>
|
||||
<script type="text/javascript" src="/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="/lib/jquery.mobile/jquery.mobile.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="/m/script.js"></script>
|
||||
<xlink rel="apple-touch-icon" href="/img/mobile.png" />
|
||||
<xlink rel="apple-touch-icon" sizes="57x57" href="/img/remote_57.png" />
|
||||
<xlink rel="apple-touch-icon" sizes="72x72" href="/img/remote_72.png" />
|
||||
<xlink rel="apple-touch-icon" sizes="114x114" href="/img/remote_114.png" />
|
||||
<xlink rel="apple-touch-icon" sizes="144x144" href="/img/remote_144.png" />
|
||||
</head>
|
||||
}
|
||||
|
||||
puts "
|
||||
<body>
|
||||
|
||||
<div data-role=page data-add-back-btn=true>
|
||||
|
||||
<div class=\"hidden status\"></div>
|
||||
|
||||
<div data-role=header data-theme=b>
|
||||
<a class=ui-btn-right data-theme=b data-icon=home data-iconpos=notext
|
||||
data-direction=reverse href=index.jim></a>
|
||||
<h1>[system model] ([system hostname])</h1>
|
||||
</div>
|
||||
|
||||
<div data-role=content>
|
||||
"
|
||||
|
||||
set renderstart [clock milliseconds]
|
||||
|
62
var/mongoose/html/m/nownext.jim
Executable file
62
var/mongoose/html/m/nownext.jim
Executable file
@ -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 "<ul data-role=listview data-filter=true>"
|
||||
|
||||
set lcn 0
|
||||
set skiplcn 0
|
||||
set entries 0
|
||||
foreach e $records {
|
||||
set chnum [$e get channel_num]
|
||||
if {$chnum == 0} continue
|
||||
if {$chnum == $skiplcn} continue
|
||||
if {$chnum != $lcn} {
|
||||
if {$lcn} {
|
||||
puts "</a></li>";
|
||||
}
|
||||
set lcn $chnum
|
||||
|
||||
puts "<li><a href=channel.jim?sid=[$e get service_id]>
|
||||
[$e channel_icon 80]"
|
||||
|
||||
set entries 0
|
||||
}
|
||||
|
||||
set es [$e get start]
|
||||
set ee [expr $es + [$e get duration]]
|
||||
|
||||
$e process_sched
|
||||
set recopts 1
|
||||
if {[$e get series_crid] ne ""} { set recopts 2 }
|
||||
|
||||
set perc [$e percent]
|
||||
set showing 0
|
||||
if {$perc > 0 && $perc < 100} { set showing 1 }
|
||||
|
||||
set txt "
|
||||
[clock format $es -format "%H:%M"] -
|
||||
[clock format $ee -format "%H:%M"]:
|
||||
[cgi_quote_html [$e get name]]
|
||||
"
|
||||
if {$showing} { append txt " ($perc%)" }
|
||||
|
||||
puts "<p>$txt</p>"
|
||||
|
||||
incr entries
|
||||
if {$entries > 3} { set skiplcn $lcn }
|
||||
}
|
||||
|
||||
puts "</a></li>"
|
||||
puts "</ul>"
|
||||
|
||||
mfooter
|
||||
|
7
var/mongoose/html/m/script.js
Normal file
7
var/mongoose/html/m/script.js
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
$(document).bind('pageinit', function() {
|
||||
$('div.status').last().load('/cgi-bin/status.jim', function() {
|
||||
$(this).slideDown('slow');
|
||||
});
|
||||
});
|
||||
|
27
var/mongoose/html/m/style.css
Normal file
27
var/mongoose/html/m/style.css
Normal file
@ -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;
|
||||
}
|
||||
|
@ -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 (
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user