updates barring channel icons

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif@172 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-06-14 11:48:55 +00:00
parent 8f3971cf76
commit 240a4d7589
187 changed files with 1065 additions and 265 deletions

182
var/mongoose/cgi-bin/browse.jim Executable file
View File

@ -0,0 +1,182 @@
#!/mod/bin/jimsh
package require cgi
puts "Content-Type: text/html"
puts ""
cgi_input
#cgi_dump
#set _cgi(tsfile) "/media/My Video/Have I Got News for You_20110606_2247.ts"
if {[dict exists $_cgi tsfile]} {
source /mod/var/mongoose/lib/epg.class
set file [dict get $_cgi tsfile]
set a [split [exec /mod/bin/hmt -p $file] "\t"]
# Need to fix 64-bit..
set size "??"
catch {
file stat $file st
set size [expr $st(size) / 1048576]
}
puts "
<table class=keyval>
<tr>
<th>Title</th>
<td>[lindex $a 0]</td>
</tr><tr>
<th>Synopsis</th>
<td>[lindex $a 1]</td>
</tr><tr>
<th>Definition</th>
<td>[lindex $a 2]</td>
</tr><tr>
<th>Channel</th>
<td>[epg channelicon [lindex $a 4] 50 "vertical-align: middle"]
[lindex $a 3] - [lindex $a 4]</td>
</tr><tr>
<th>Start Time</th>
<td>"
puts [clock format [lindex $a 5] -format "%c %Z"]
puts "</td>
</tr><tr>
<th>End Time</th>
<td>"
puts [clock format [lindex $a 6] -format "%c %Z"]
puts "</td>
</tr><tr>
<th>Duration</th>
<td>[expr [expr [lindex $a 6] - [lindex $a 5]] / 60] minute(s).</td>
</tr><tr>
<th>Size</th>
<td>$size MiB</td>
</tr><tr>
<th>Flags</th>
<td>[lindex $a 7]</td>
</tr>
</table>
"
exit
}
if {[dict exists $_cgi dir]} {
set dir [dict get $_cgi dir]
} else {
set dir "/media/My Video"
}
source /mod/var/mongoose/html/lib/header.jim
puts {
<div id=dialogue></div>
<script type=text/javascript>
$(document).ready(function() {
var $dialog = $('#dialogue').dialog({
title: "Recording Details",
modal: false, autoOpen: false,
height: 600, width: 700,
show: 'scale', hide: 'fade',
draggable: true, resizable: true,
buttons: { "Close":
function() {$(this).dialog('close');}},
close: function(e,u) { $('#dialogue').empty().html('<img src="/img/loading.gif" alt="loading">'); }
});
$('a.ts').click(function(e) {
e.preventDefault();
var file = $(this).attr('file');
var url = window.location.pathname + '?tsfile=' +
encodeURIComponent(file);
$('#dialogue').load(url);
$dialog.dialog('open');
});
});
</script>
}
proc tsfile {file bfile} {
puts "
<div style=\"vertical-align: middle\">
<a class=ts file=\"$file\" href=#>
<img style=\"vertical-align: middle\"
border=0 width=45 src=/images/741_1_10_Video_Title.png>
$bfile
</a>
<a class=tsopt file=\"$file\" href=#>
<img style=\"vertical-align: middle\"
border=0 width=45 src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
</div>
"
}
proc genfile {file bfile} {
puts "
<div style=\"vertical-align: middle\">
<a href=#>
<img style=\"vertical-align: middle\"
border=0 width=45 src=/images/743_4_10_Video_Xvid_File.png>
$bfile
</a>
</div>
"
}
puts { <div style="border: 1px solid grey; padding: 1em"> }
puts "<h1>"
set stub ""
foreach part [split $dir /] {
if {$stub eq "/"} { set name $part } else { set name "/$part" }
append stub $name
puts "<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $stub]>$name</a>
}
puts "</h1>"
set parent [join [lrange [split $dir /] 0 end-1] /]
if {$parent ne ""} {
puts "
<div style=\"vertical-align: middle\">
<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $parent]>
<img src=/images/711_3_09_Media_Folder_UP.png
style=\"vertical-align: middle\">
\[parent directory\]</a>
</div>
"
}
regsub -all -- {\/+} "$dir/*" "/" dir
foreach file [lsort [glob -nocomplain "$dir"]] {
set bfile [lindex [split $file /] end]
if {[string index $bfile 0] == "\025"} {
set bfile [string range $bfile 1 end]
}
if [file isdirectory "$file"] {
puts "<div style=\"vertical-align: middle\">"
puts "<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $file]>"
puts "<img border=0
style=\"vertical-align: middle\"
src=/images/711_1_09_Media_Folder.png>"
puts "$bfile</a><br>"
continue
}
regexp -- {\.([^.]+)$} "$file" allmatch ext
switch $ext {
nts { continue }
thm { continue }
hmt { continue }
hmi { continue }
ts { tsfile $file $bfile }
avi { genfile $file $bfile }
mpg { genfile $file $bfile }
wmv { genfile $file $bfile }
mkv { genfile $file $bfile }
}
}
puts "</div>"
source /mod/var/mongoose/html/lib/footer.jim

View File

@ -21,6 +21,7 @@ if {! [dict exists $_cgi bare]} {
#set event 25293
set record [lindex [epg fetch dump -service $service -event $event] 0]
$record get_channel_info
puts "
<table class=keyval>
@ -91,7 +92,7 @@ if {[$record get rec_crid] != ""} {
puts "
<tr>
<td colspan=2 valign=top>
[$record channel_icon]
[$record channel_icon 70]
[join [$record icon_set] "&nbsp;"]
</td>
</tr>

View File

@ -107,6 +107,8 @@ if {$ct > 0 } {
set records [epg fetch $cmd -extra $term]
}
set favlist [epg favlist]
puts {
<table class=borders id=results style="clear: both;margin: 0.5em 0 0 0">
<tr>
@ -126,10 +128,13 @@ proc rsort {v1 v2} {
return -1
}
set i 0
foreach record [lsort -command rsort $records] {
if {$favlist != "" && [$record get service_id] ni $favlist} {
continue
}
altrow
$record get_channel_info
puts "<td nowrap>
[clock format [$record get start] -format "%a %d %b %Y"]<br>
[clock format [$record get start] -format "%H:%M %Z"]</td>"

View File

@ -29,12 +29,13 @@ catch { set service [dict get $_cgi service] }
set records [epg fetch dump -service $service]
set tr [lindex $records 0]
$tr get_channel_info
set channel_num [$tr get channel_num]
set channel_name [$tr get channel_name]
puts "
<div style=\"margin: 0 1em 1em 1em\">
[$tr channel_icon 0 {vertical-align:middle}]
[$tr channel_icon 80 {vertical-align:middle}]
<span style=\"vertical-align: middle\">
$channel_num - $channel_name
</span>

View File

@ -1,5 +1,6 @@
#!/mod/bin/jimsh
source /mod/var/mongoose/lib/settings.class
package require cgi
puts "Content-Type: text/html"
@ -8,33 +9,42 @@ puts ""
cgi_input
#cgi_dump
# Set variables
set settings [settings new]
if {[catch {set fd [open "/var/lib/humaxtv/hostname" r]}]} {
set hostname "humax"
} else {
set hostname [string trim [read $fd]]
close $fd
}
set hostname [$settings hostname]
set channel_group [$settings channel_group]
# Handle updates
if {[dict exists $_cgi hostname]} {
set nhostname [string trim [dict get $_cgi hostname]]
if {$nhostname eq $hostname} {
puts "Hostname is already '$hostname'."
} elseif [string is alnum -strict $hostname] {
set fd [open "/var/lib/humaxtv/hostname" w]
puts $fd $nhostname
close $fd
exec hostname -F /var/lib/humaxtv/hostname
puts "Hostname successfully updated, reboot recommended."
} else {
puts "Invalid hostname."
proc _handle_update {class var old text} {
global _cgi
global settings
if {[dict exists $_cgi $var]} {
set new [string trim [dict get $_cgi $var]]
if {$new == $old} {
puts "$text unchanged."
} elseif [string is $class -strict $new] {
$settings $var $new
puts "$text updated."
} else {
puts "Invalid value for $var."
}
exit
}
exit
}
proc handle_int_update {var old {text "Value"}} {
_handle_update digit $var $old $text
}
proc handle_str_update {var old {text "Value"}} {
_handle_update alnum $var $old $text
}
handle_str_update hostname $hostname Hostname
handle_int_update channel_group $channel_group "Channel Group"
source /mod/var/mongoose/html/lib/header.jim
puts {<script type="text/javascript" src="/js/jquery.form.js"></script>}
@ -60,16 +70,48 @@ puts {
puts "
<h1>Settings</h1>
<form id=hostname method=get action=$env(REQUEST_URI)>
<table class=keyval>
<tr>
<form id=hostname method=get action=$env(REQUEST_URI)>
<th>Hostname</th>
<td><input name=hostname value=\"$hostname\"
length=20 maxlength=50>
<input id=hostname_submit value=\"change\" type=submit>
<div id=hostname_output></div>
</td>
</form>
</tr>
"
puts "
<tr>
<form id=channel_group method=get action=$env(REQUEST_URI)>
<th>Channel Group for EPG</th>
<td><select id=channel_group name=channel_group
value=[$settings channel_group]>
"
set i 0
puts "<option value=0>-- None --"
foreach grp [$settings channel_groups] {
incr i
puts -nonewline "<option value=$i"
if {$channel_group == $i} {
puts -nonewline " selected"
}
puts ">$grp"
}
puts "
</select>
<input name=channel_group value=\"change\" type=submit>
<div id=channel_group_output></div>
</td>
</form>
</tr>
"
puts "
</table>
</form>
<br>

View File

@ -1 +0,0 @@
freeview/BBC-RED-BUTTON_logo.jpg

View File

@ -1 +0,0 @@
freeview/4-MUSIC_logo.jpg

View File

@ -1 +0,0 @@
freeview/5-USA_logo.jpg

View File

@ -1 +0,0 @@
freeview/Five_logo.jpg

View File

@ -1 +0,0 @@
freeview/Absolute_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-RADIO-6-music_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-RADIO-A_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-FOUR_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-HD_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-NEWS_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-one_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-1-HD_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-PARLIAMENT_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-Radio-1Xtra_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-RADIO-5-live_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-RADIO-5-live-sports_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-Radio-1_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-Radio-2_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-RADIO-3_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-Radio-4-Extra_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-RADIO-4_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-three_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-two_logo.jpg

View File

@ -1 +0,0 @@
freeview/BBC-WORLD-SERVICE_logo.jpg

View File

@ -1 +0,0 @@
freeview/Big-Deal_logo.jpg

View File

@ -1 +0,0 @@
freeview/cbbc_logo.jpg

View File

@ -1 +0,0 @@
freeview/CBeebies_logo.jpg

View File

@ -1 +0,0 @@
freeview/Citv_logo.jpg

View File

@ -1 +0,0 @@
freeview/community-channel_logo.jpg

View File

@ -1 +0,0 @@
freeview/Capital-Radio_logo.jpg

View File

@ -1 +0,0 @@
freeview/Challenge-TV_logo.jpg

View File

@ -1 +0,0 @@
freeview/4HD_logo.jpg

View File

@ -1 +0,0 @@
freeview/channel-4-1_logo.jpg

View File

@ -1 +0,0 @@
freeview/channel-4_logo.jpg

View File

@ -1 +0,0 @@
freeview/five_logo.jpg

View File

@ -1 +0,0 @@
freeview/S4C-Clirlun_logo.jpg

View File

@ -1 +0,0 @@
freeview/Create-and-Craft_logo.jpg

View File

@ -1 +0,0 @@
freeview/Dave-Ja-Vu_logo.jpg

View File

@ -1 +0,0 @@
freeview/Dave_logo.jpg

View File

@ -1 +0,0 @@
freeview/Daystar_logo.jpg

View File

@ -1 +0,0 @@
freeview/E4-1_logo.jpg

View File

@ -1 +0,0 @@
freeview/E4_logo.jpg

View File

@ -1 +0,0 @@
cam/espn.jpg

View File

@ -1 +0,0 @@
freeview/FILM-4_logo.jpg

View File

@ -1 +0,0 @@
freeview/logo_tn_gems.gif

View File

@ -1 +0,0 @@
Gems TV.gif

View File

@ -1 +0,0 @@
freeview/heart-Radio_logo.jpg

View File

@ -1 +0,0 @@
cam/home_uktv.jpg

View File

@ -1 +0,0 @@
freeview/ITV1-1_logo.jpg

View File

@ -1 +0,0 @@
freeview/ITV1-HD_logo.jpg

View File

@ -1 +0,0 @@
freeview/itv-1_logo.jpg

View File

@ -1 +0,0 @@
freeview/itv-2-1_logo.jpg

View File

@ -1 +0,0 @@
freeview/itv-2_logo.jpg

View File

@ -1 +0,0 @@
freeview/itv-3_logo.jpg

View File

@ -1 +0,0 @@
freeview/itv-4_logo.jpg

View File

@ -1 +0,0 @@
freeview/ideal-WORLD_logo.jpg

View File

@ -1 +0,0 @@
freeview/KERRAND!-Radio_logo.jpg

View File

@ -1 +0,0 @@
freeview/KISS-Radio_logo.jpg

View File

@ -1 +0,0 @@
freeview/magic-Radio_logo.jpg

View File

@ -1 +0,0 @@
freeview/MORE-4_logo.jpg

View File

@ -1 +0,0 @@
freeview/Pick-TV_logo.jpg

View File

@ -1 +0,0 @@
freeview/Pick-TV_logo.jpg

View File

@ -1 +0,0 @@
freeview/Premier-CHRISTIAN-RADIO_logo.jpg

View File

@ -1 +0,0 @@
freeview/Q-Radio_logo.jpg

View File

@ -1 +0,0 @@
freeview/Quest_logo.jpg

View File

@ -1 +0,0 @@
freeview/QVC-Beauty_logo.jpg

View File

@ -1 +0,0 @@
freeview/QVC_logo.jpg

View File

@ -1 +0,0 @@
cam/rocks_and_co.jpg

View File

@ -1 +0,0 @@
freeview/Russia-Today_logo.jpg

View File

@ -1 +0,0 @@
freeview/S4-C_logo.jpg

View File

@ -1 +0,0 @@
freeview/smooth-RADIO_logo.jpg

View File

@ -1 +0,0 @@
freeview/SKY-NEWS_logo.jpg

View File

@ -1 +0,0 @@
cam/harmonyOne_88X150_SkySportsOne.jpg

View File

@ -1 +0,0 @@
cam/harmonyOne_88X150_SkySportsTwo.jpg

View File

@ -1 +0,0 @@
freeview/skytext_logo.jpg

View File

@ -1 +0,0 @@
freeview/smash!-Radio_logo.jpg

View File

@ -1 +0,0 @@
freeview/Teletext-holidays_logo.jpg

View File

@ -1 +0,0 @@
freeview/logo_tn_tvx.jpg

View File

@ -1 +0,0 @@
freeview/the-hits_logo.jpg

View File

@ -1 +0,0 @@
freeview/U105.8_logo.jpg

View File

@ -1 +0,0 @@
freeview/VIVA_logo.jpg

View File

@ -1 +0,0 @@
freeview/Yesterday_logo.jpg

View File

@ -1 +0,0 @@
freeview/bid-tv_logo.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Some files were not shown because too many files have changed in this diff Show More