Compare commits
76 Commits
0.64@180
...
0.7.1@2148
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbb64a2e9f | ||
|
|
ff322fdc39 | ||
|
|
d29ed50f7f | ||
|
|
7113208940 | ||
|
|
0b566bca72 | ||
|
|
f235b05026 | ||
|
|
af87e1a66e | ||
|
|
ed225ca751 | ||
|
|
cfb12b7da6 | ||
|
|
1d44efdcdc | ||
|
|
0eb305c32c | ||
|
|
6797ee4416 | ||
|
|
510c6c7407 | ||
|
|
f6bf03691d | ||
|
|
b378ec1b9c | ||
|
|
df85584352 | ||
|
|
b7310e9765 | ||
|
|
3f02bf8365 | ||
|
|
1d6917a782 | ||
|
|
0852c70891 | ||
|
|
981c8312cd | ||
|
|
3559a430ab | ||
|
|
945c6d1b4b | ||
|
|
81c3ef4f73 | ||
|
|
2c61281b09 | ||
|
|
d5b27acd46 | ||
|
|
767021557f | ||
|
|
4f900f47b4 | ||
|
|
8383651367 | ||
|
|
d764969b8f | ||
|
|
301336b778 | ||
|
|
1b8761b8f3 | ||
|
|
b2f5f2c48a | ||
|
|
64b73ee14b | ||
|
|
dbc3d21807 | ||
|
|
d1267cbd1e | ||
|
|
7643a92550 | ||
|
|
b1176d9f64 | ||
|
|
ded9495595 | ||
|
|
2a224c1055 | ||
|
|
33a72aa43f | ||
|
|
ca6129abef | ||
|
|
42b5805c45 | ||
|
|
88ada938d1 | ||
|
|
15040206ab | ||
|
|
4861459aec | ||
|
|
5523ec6a43 | ||
|
|
5f6c7a843c | ||
|
|
e712f38bb1 | ||
|
|
61d879e90a | ||
|
|
638d2dedb3 | ||
|
|
d1cfff8899 | ||
|
|
9116c6e8a9 | ||
|
|
6efcb5bde0 | ||
|
|
444ca7370b | ||
|
|
a44be5f1ae | ||
|
|
4e42dcf655 | ||
|
|
43db44d742 | ||
|
|
050cb611bf | ||
|
|
d068d93073 | ||
|
|
7025cf09f5 | ||
|
|
32db0c900b | ||
|
|
d7dcb79dad | ||
|
|
04453c1815 | ||
|
|
3bc9f5217b | ||
|
|
8d67bb82bb | ||
|
|
9faac3c8fe | ||
|
|
0c858b3410 | ||
|
|
1cd0f96bf4 | ||
|
|
8e839121de | ||
|
|
7400437a1f | ||
|
|
26e90143bf | ||
|
|
884e17b3a7 | ||
|
|
7202b7e4f8 | ||
|
|
087532136c | ||
|
|
700306b3a8 |
@@ -1,10 +1,11 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 0.5.1
|
||||
Version: 0.7.1
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends: mongoose(>=2.11-4),jim-sqlite3,jim-cgi,service-control,busybox,lsof,jim-oo,epg(>=1.0.2)
|
||||
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.3),hmt(>=1.0.6),ssmtp
|
||||
Replaces: af123-webif
|
||||
Conflicts: af123-webif
|
||||
Description: A web interface for the Humax. In development.
|
||||
Suggests: ffmpeg,webif-iphone
|
||||
Description: An evolving web interface for the Humax.
|
||||
|
||||
75
var/mongoose/cgi-bin/backup/backup.jim
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
|
||||
require rsv.class
|
||||
|
||||
set dir /mod/var/backup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
if {![dict exists $_cgi file]} {
|
||||
puts "No filename supplied."
|
||||
exit
|
||||
}
|
||||
|
||||
set file [file tail [dict get $_cgi file]]
|
||||
set ffile "/$dir/$file.rbk"
|
||||
|
||||
if {[file exists $ffile]} {
|
||||
puts "Backup file <i>$file</i> already exists."
|
||||
exit
|
||||
}
|
||||
|
||||
if {[catch { set fd [open $ffile w] } msg]} {
|
||||
puts "Error creating backup file. - $msg"
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Backing up scheduled recordings and events..."
|
||||
|
||||
set events [rsv list]
|
||||
|
||||
set fields [lsort [[rsv] vars]]
|
||||
|
||||
#puts $fd "# [join $fields "\t"]"
|
||||
|
||||
foreach event $events {
|
||||
puts " Backing up scheduled event '[$event name]'"
|
||||
puts -nonewline $fd "event\t"
|
||||
|
||||
foreach f $fields {
|
||||
if {$f eq "aulEventToRecordInfo"} { continue }
|
||||
puts -nonewline $fd "[$event get $f]\t"
|
||||
}
|
||||
puts $fd ""
|
||||
}
|
||||
puts "Done."
|
||||
|
||||
puts "Backing up channel favourites..."
|
||||
|
||||
set grp 0
|
||||
foreach res [$rsvdb query {
|
||||
select eFavGroup,
|
||||
TBL_FAV.eSvcType,
|
||||
substr(szSvcName, 2) as szSvcName
|
||||
from TBL_FAV join TBL_SVC using (hSvc)
|
||||
order by eFavGroup
|
||||
}] {
|
||||
if {$res(eFavGroup) != $grp} {
|
||||
set grp $res(eFavGroup)
|
||||
puts " Group $grp"
|
||||
}
|
||||
puts " $res(szSvcName)"
|
||||
puts $fd "fav\t$res(eFavGroup)\t$res(eSvcType)\t$res(szSvcName)"
|
||||
}
|
||||
puts "Done."
|
||||
|
||||
close $fd
|
||||
rsv cleanup
|
||||
|
||||
59
var/mongoose/cgi-bin/backup/backup.js
Executable file
@@ -0,0 +1,59 @@
|
||||
|
||||
function refresh_files()
|
||||
{
|
||||
$('#backup_files').load('/cgi-bin/backup/files.jim', function() {
|
||||
$('input.restore').change(function() {
|
||||
$('#restore_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
$('#delete_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('button').button();
|
||||
|
||||
refresh_files();
|
||||
|
||||
$('#backup_button').click(function() {
|
||||
$('#backup_working').slideDown();
|
||||
$('#results').load('/cgi-bin/backup/backup.jim?' +
|
||||
$('#backup_name').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
$('#backup_working').slideUp();
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#delete_button').click(function() {
|
||||
var backup = $('input.restore').val();
|
||||
if (confirm('Confirm deletion of ' + backup))
|
||||
{
|
||||
$('#results').load('/cgi-bin/backup/delete.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#restore_button').click(function() {
|
||||
var backup = $('input.restore').val();
|
||||
if (confirm('!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE CONFIRM !!!!!!!!!!!!!!!!!!!!!!!!!\n\nAre you sure you wish to erase all scheduled recordings and favourite channels and then restore them from\n' + backup + '?'))
|
||||
{
|
||||
$('#restore_working').slideDown();
|
||||
$('#results').load('/cgi-bin/backup/restore.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
$('#restore_working').slideUp();
|
||||
refresh_files();
|
||||
$('#restore_warning').slideDown();
|
||||
$('#restart_block').load(
|
||||
'/cgi-bin/restartblock.jim');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
31
var/mongoose/cgi-bin/backup/delete.jim
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
|
||||
set dir /mod/var/backup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts "Pragma: no-cache"
|
||||
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
if {![dict exists $_cgi restore_file]} {
|
||||
puts "No filename supplied."
|
||||
exit
|
||||
}
|
||||
|
||||
set file [file tail [dict get $_cgi restore_file]]
|
||||
set ffile "/$dir/$file.rbk"
|
||||
|
||||
if {![file exists $ffile]} {
|
||||
puts "Backup file <i>$file</i> does not exist."
|
||||
} elseif {[catch { file delete $ffile } msg]} {
|
||||
puts "Deletion failed: $msg"
|
||||
} else {
|
||||
puts "Successfully deleted <i>$file</i>"
|
||||
}
|
||||
|
||||
39
var/mongoose/cgi-bin/backup/files.jim
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts "Pragma: no-cache"
|
||||
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
|
||||
puts ""
|
||||
|
||||
set dir "/mod/var/backup"
|
||||
|
||||
proc empty {} {
|
||||
puts "<font style=\"color: grey\">
|
||||
<i>No current backup files.</i>
|
||||
</font>"
|
||||
}
|
||||
|
||||
if {![file isdirectory $dir]} {
|
||||
empty
|
||||
exit
|
||||
}
|
||||
|
||||
set backups [glob -nocomplain "$dir/*.rbk"]
|
||||
|
||||
if {![llength $backups]} {
|
||||
empty
|
||||
exit
|
||||
}
|
||||
|
||||
foreach backup $backups {
|
||||
set b [file rootname [file tail $backup]]
|
||||
puts "<input name=restore_file class=restore
|
||||
type=radio value=\"$b\">$b <font class=footnote>(
|
||||
[clock format [file mtime $backup] -format {%c %Z}]
|
||||
)</font></input>
|
||||
<br>
|
||||
"
|
||||
}
|
||||
|
||||
128
var/mongoose/cgi-bin/backup/restore.jim
Executable file
@@ -0,0 +1,128 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
|
||||
require rsv.class findhsvc system.class
|
||||
|
||||
set dir /mod/var/backup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(restore_file) "backup-2011-Jul-09-20:37"
|
||||
|
||||
if {![dict exists $_cgi restore_file]} {
|
||||
puts "No filename supplied."
|
||||
exit
|
||||
}
|
||||
|
||||
set file [file tail [dict get $_cgi restore_file]]
|
||||
set ffile "/$dir/$file.rbk"
|
||||
|
||||
if {![file exists $ffile]} {
|
||||
puts "Backup file <i>$file</i> does not exist."
|
||||
exit
|
||||
}
|
||||
|
||||
if {[catch { set fd [open $ffile r] } msg]} {
|
||||
puts "Error opening <i>$file</i> - $msg"
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Restoring scheduled events from <i>$file</i>..."
|
||||
|
||||
$rsvdb query {begin transaction;}
|
||||
$rsvdb query {delete from TBL_RESERVATION;}
|
||||
|
||||
set fields [lsort [[rsv] vars]]
|
||||
|
||||
set data [split [read $fd] "\n"]
|
||||
|
||||
foreach line $data {
|
||||
set vals [split $line "\t"]
|
||||
if {[lindex $vals 0] ne "event"} { continue }
|
||||
set vars {}
|
||||
set i 0
|
||||
foreach f $fields {
|
||||
if {$f eq "aulEventToRecordInfo"} { continue }
|
||||
incr i
|
||||
lappend vars $f [lindex $vals $i]
|
||||
}
|
||||
|
||||
set rsv [rsv new $vars]
|
||||
|
||||
# Need to fix up channel and CRID mappings in case something has
|
||||
# changed during a channel scan.
|
||||
|
||||
puts " Restoring [$rsv name]"
|
||||
|
||||
set bad 0
|
||||
# First, the service number
|
||||
set ohsvc [$rsv get hsvc]
|
||||
if {$ohsvc > 0} {
|
||||
set hsvc [$rsv fix_hsvc]
|
||||
if {$hsvc == 0} {
|
||||
puts " Cannot find channel, restore failed."
|
||||
set bad 1
|
||||
} elseif {$hsvc != $ohsvc} {
|
||||
puts -nonewline " Service number has "
|
||||
puts "changed $ohsvc -> $hsvc, fixing."
|
||||
} else {
|
||||
puts " No change in channel service."
|
||||
}
|
||||
}
|
||||
|
||||
if {!$bad} {
|
||||
if {[catch {$rsv insert pending 1} msg]} {
|
||||
puts " Error inserting event, $msg"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$rsvdb query {commit transaction;}
|
||||
|
||||
puts "Restoring favourite channels..."
|
||||
$rsvdb query {begin transaction;}
|
||||
$rsvdb query {delete from channel.TBL_FAV}
|
||||
|
||||
set grp 0
|
||||
foreach line $data {
|
||||
set vals [split $line "\t"]
|
||||
if {[lindex $vals 0] ne "fav"} { continue }
|
||||
|
||||
set group [lindex $vals 1]
|
||||
set type [lindex $vals 2]
|
||||
set chan [lindex $vals 3]
|
||||
set hsvc [get_channel_attr $chan]
|
||||
|
||||
if {$grp != $group} {
|
||||
set grp $group
|
||||
puts " Group $grp"
|
||||
}
|
||||
|
||||
puts " $chan"
|
||||
|
||||
if {!$hsvc} {
|
||||
puts " Cannot map channel name to service."
|
||||
continue
|
||||
}
|
||||
|
||||
set query "
|
||||
insert into channel.TBL_FAV(hSvc, eFavGroup, eSvcType)
|
||||
values($hsvc, $group, $type);
|
||||
"
|
||||
|
||||
$rsvdb query $query
|
||||
}
|
||||
|
||||
$rsvdb query {commit transaction;}
|
||||
|
||||
system restartpending
|
||||
|
||||
close $fd
|
||||
rsv cleanup
|
||||
|
||||
@@ -1,73 +1,33 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
set ignore {nts thm hmt hmi}
|
||||
set standard {avi mpg wmv mkv}
|
||||
set ignore {.nts .thm .hmt .hmi}
|
||||
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov}
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(tsfile) "/media/My Video/Family Guy/2.19._Excellence_in_Broadcasting.ts"
|
||||
#set _cgi(action) "lock"
|
||||
#set env(REQUEST_URI) ''
|
||||
|
||||
proc tsfile {file bfile} {{i 0}} {
|
||||
set ts [ts fetch $file]
|
||||
puts "
|
||||
<div class=\"va tsfile\" id=[incr i]>
|
||||
<a class=ts file=\"$file\" href=#>
|
||||
<img class=va border=0 width=45
|
||||
src=/images/741_1_10_Video_Title.png>
|
||||
$bfile
|
||||
</a>
|
||||
"
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
puts "<img class=va src=/images/172_1_00_HD.png height=21>"
|
||||
} else {
|
||||
puts "<img class=va src=/images/172_1_26_SD.png height=21>"
|
||||
}
|
||||
if {[$ts flag "Locked"] > 0} {
|
||||
puts "<img class=va src=/images/178_1_00_Icon_Lock.png
|
||||
height=21>"
|
||||
|
||||
}
|
||||
|
||||
puts "
|
||||
<a class=tsopt file=\"$file\" href=#>
|
||||
<img class=\"opt va\" border=0 width=45 did=$i
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
</div>
|
||||
"
|
||||
}
|
||||
|
||||
proc genfile {file bfile} {
|
||||
puts "
|
||||
<div class=va>
|
||||
<a href=#>
|
||||
<img class=va border=0 width=45 style=\"padding: 0.3em 0\"
|
||||
src=/images/743_4_10_Video_Xvid_File.png>
|
||||
$bfile
|
||||
</a>
|
||||
</div>
|
||||
"
|
||||
}
|
||||
#set _cgi(dir) "/media/My Video/Chuggington"
|
||||
|
||||
proc directory {file bfile} {
|
||||
regsub -all " +" $bfile "" tbfile
|
||||
puts "<div class=va>"
|
||||
puts "<a href=$::env(REQUEST_URI)?dir=[cgi_quote_url $file]>"
|
||||
puts "<img border=0 class=va src=/images/711_1_09_Media_Folder.png>"
|
||||
puts "$bfile</a></div>"
|
||||
puts "<img border=0 class=va id=\"img$tbfile\"
|
||||
src=/images/711_1_09_Media_Folder.png>"
|
||||
puts "$bfile</a><span class=filesize id=\"$tbfile\">
|
||||
</span></div>"
|
||||
}
|
||||
|
||||
proc entry {file} {
|
||||
set bfile [lindex [split $file /] end]
|
||||
proc entry {file} {{i 0}} {
|
||||
set bfile [file tail $file]
|
||||
if {[string index $bfile 0] == "\025"} {
|
||||
set bfile [string range $bfile 1 end]
|
||||
}
|
||||
@@ -75,95 +35,98 @@ proc entry {file} {
|
||||
directory $file $bfile
|
||||
continue
|
||||
}
|
||||
regexp -- {\.([^.]+)$} "$file" allmatch ext
|
||||
if {$ext eq "ts"} {
|
||||
tsfile $file $bfile
|
||||
continue
|
||||
}
|
||||
if {$ext in $::ignore} { continue }
|
||||
if {$ext in $::standard} {
|
||||
genfile $file $bfile
|
||||
continue
|
||||
}
|
||||
}
|
||||
set ext [file extension $file]
|
||||
if {$ext in $::ignore || $ext ni $::include} { continue }
|
||||
|
||||
if {[dict exists $_cgi tsfile]} {
|
||||
set file [dict get $_cgi tsfile]
|
||||
set ts [ts fetch $file]
|
||||
file stat $file st
|
||||
set sz [pretty_size $st(size)]
|
||||
|
||||
if {[dict exists $_cgi action]} {
|
||||
switch [dict get $_cgi action] {
|
||||
entry {
|
||||
entry $file
|
||||
}
|
||||
delete {
|
||||
if {[$ts delete]} {
|
||||
puts "Successfully deleted $file."
|
||||
} else {
|
||||
puts "Problem deleting $file, [$ts get error]"
|
||||
}
|
||||
}
|
||||
lock {
|
||||
set action lock
|
||||
if {[$ts flag "Locked"]} { set action unlock }
|
||||
if {[$ts $action]} {
|
||||
puts "Successfully [set action]ed $file."
|
||||
} else {
|
||||
puts "Problem [set action]ing $file,
|
||||
[$ts get error]"
|
||||
}
|
||||
}
|
||||
}
|
||||
exit
|
||||
set base [file rootname $file]
|
||||
|
||||
if {$ext eq ".ts" && [file exists "${base}.nts"]} {
|
||||
set type ts
|
||||
set ts [ts fetch $file 1]
|
||||
set img Video_TS
|
||||
} else {
|
||||
set type gen
|
||||
set ts 0
|
||||
set img Video_Other
|
||||
}
|
||||
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td>[$ts get title]</td>
|
||||
</tr><tr>
|
||||
<th>Synopsis</th>
|
||||
<td>[$ts get synopsis]</td>
|
||||
</tr><tr>
|
||||
<th>Definition</th>
|
||||
<td>
|
||||
<div class=\"va bf\" id=[incr i]>
|
||||
<a class=bf file=\"$file\" type=$type href=#>
|
||||
"
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
puts "<img class=va src=/images/172_1_00_HD.png height=21>"
|
||||
|
||||
set new 0
|
||||
if {$type eq "ts"} {
|
||||
if {[$ts flag "New"] > 0} { set new 1 }
|
||||
} else {
|
||||
puts "<img class=va src=/images/172_1_26_SD.png height=21>"
|
||||
if {![file exists "[file rootname $file].hmi"]} { set new 1 }
|
||||
}
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Channel</th>
|
||||
<td>[epg channelicon [$ts get channel_name] 50 "vertical-align: middle"]
|
||||
[$ts get channel_num] - [$ts get channel_name]</td>
|
||||
</tr><tr>
|
||||
<th>Start Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get start] -format "%c %Z"]
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>End Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get end] -format "%c %Z"]
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[$ts duration] minute(s).</td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>[$ts size] MiB</td>
|
||||
</tr><tr>
|
||||
<th>Flags</th>
|
||||
<td>[$ts get flags]</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
if {$new} { append img _New }
|
||||
|
||||
puts "<img class=va border=0 src=/img/$img.png>"
|
||||
|
||||
puts "
|
||||
$bfile
|
||||
</a>
|
||||
"
|
||||
exit
|
||||
|
||||
# Size
|
||||
puts "<span class=filesize> ($sz) </span>"
|
||||
|
||||
# Icons
|
||||
|
||||
set locked 0
|
||||
set encd 0
|
||||
set def unknown
|
||||
if {$type eq "ts"} {
|
||||
# HD / SD
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
set def HD
|
||||
set img "172_1_00_HD"
|
||||
} else {
|
||||
set def SD
|
||||
set img "172_1_26_SD"
|
||||
}
|
||||
puts "<img class=va src=/images/$img.png height=21>"
|
||||
|
||||
# Locked
|
||||
if {[$ts flag "Locked"] > 0} {
|
||||
set locked 1
|
||||
puts "<img class=va src=/images/178_1_00_Icon_Lock.png
|
||||
height=21>"
|
||||
}
|
||||
|
||||
# Encrypted
|
||||
if {[$ts flag "Encrypted"] > 0} {
|
||||
set encd 1
|
||||
puts "<img class=va
|
||||
src=/images/749_1_26_Video_Encryption.png
|
||||
height=21>"
|
||||
}
|
||||
|
||||
# Guidance
|
||||
if {[$ts flag "Guidance"] > 0} {
|
||||
puts "<img class=va
|
||||
src=/images/174_1_26_GuidancePolicy.png
|
||||
height=21>"
|
||||
}
|
||||
}
|
||||
|
||||
# Opt+ button
|
||||
|
||||
puts "
|
||||
<a href=#>
|
||||
<img class=\"opt va\" border=0 width=45 type=$type did=$i
|
||||
locked=$locked encd=$encd def=$def new=$new
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
"
|
||||
puts "</div>"
|
||||
}
|
||||
|
||||
if {[dict exists $_cgi dir]} {
|
||||
@@ -172,157 +135,102 @@ if {[dict exists $_cgi dir]} {
|
||||
set dir "/media/My Video"
|
||||
}
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
######################################################################
|
||||
# Render web page
|
||||
|
||||
puts {
|
||||
header
|
||||
|
||||
<link href=/css/jquery.contextMenu.css rel=stylesheet type=text/css />
|
||||
<script type="text/javascript" src="/js/jquery.contextMenu.js"></script>
|
||||
puts {
|
||||
<link href=/css/jquery.contextMenu.css rel=stylesheet type=text/css />
|
||||
<script type="text/javascript" src="/js/jquery.contextMenu.js"></script>
|
||||
|
||||
<ul id=optmenu class=contextMenu>
|
||||
<li><a href=#delete>Delete</a></li>
|
||||
<li><a href=#lock>Toggle Lock</a></li>
|
||||
<li><a href=#rename>Rename</a></li>
|
||||
<li><a href=#title>Change Title</a></li>
|
||||
</ul>
|
||||
<ul id=optmenu class=contextMenu>
|
||||
<li><a href=#delete>Delete</a></li>
|
||||
<li><a href=#lock>Toggle Lock</a></li>
|
||||
<li><a href=#enc>Toggle Enc</a></li>
|
||||
<li><a href=#new>Toggle New</a></li>
|
||||
<li><a href=#rename>Rename</a></li>
|
||||
<li><a href=#download>Download</a></li>
|
||||
</ul>
|
||||
|
||||
<div id=dialogue></div>
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
<div id=renameform title="Rename media file" style="display: none">
|
||||
<form id=renameform_form>
|
||||
<input type=hidden name="renameorig" id="renameorig" value="">
|
||||
<input type=hidden name="titleorig" id="titleorig" value="">
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="rename">
|
||||
<b>New Filename</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="rename" id="rename"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="renametitle" style="padding-top: 0.5em">
|
||||
<b>New EPG Title</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="renametitle" id="renametitle"
|
||||
value="" size=70 maxlength=48
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none" class=tstype>
|
||||
<td colspan=2 id=synopsis style="font-style: italic"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type=text/javascript>
|
||||
<div id=dialogue></div>
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
|
||||
var $confirm = $('#confirm').dialog({
|
||||
modal: true, autoOpen: false,
|
||||
height: 160, width: 500,
|
||||
show: 'fade', hide: 'fade',
|
||||
draggable: false, resizable: false
|
||||
});
|
||||
|
||||
var confirm_action = function(action, callback, ts, id) {
|
||||
var bts = ts.replace(/.*\/|\.[^.]*$/g, '');
|
||||
$confirm.dialog('option', 'buttons', {
|
||||
'Yes': function() { $(this).dialog('close');
|
||||
callback(ts, id); },
|
||||
'No': function() {$(this).dialog('close');}
|
||||
|
||||
});
|
||||
$('#confirm').empty().html(
|
||||
'Are you sure you wish to ' + action + '<br>' +
|
||||
'<i>' + bts + '</i> ?'
|
||||
);
|
||||
$confirm.dialog('open');
|
||||
}
|
||||
|
||||
var delete_callback = function(ts, id) {
|
||||
var el = 'div.tsfile#' + id;
|
||||
var results = el + ' .results';
|
||||
var url = window.location.pathname + '?tsfile=' +
|
||||
encodeURIComponent(ts) + '&action=delete';
|
||||
$(results).load(url, function() {
|
||||
$(el).delay(3000).slideUp(300, function() {
|
||||
$(el).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var lock_callback = function(ts, id) {
|
||||
var el = 'div.tsfile#' + id;
|
||||
var results = el + ' .results';
|
||||
var url = window.location.pathname + '?tsfile=' +
|
||||
encodeURIComponent(ts) + '&action=';
|
||||
|
||||
$(results).load(url + 'lock', function() {
|
||||
$(results).delay(3000).slideUp(150,
|
||||
function() {
|
||||
$(el).load(url + 'entry');
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// Dialogue init
|
||||
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">'); }
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('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');
|
||||
});
|
||||
|
||||
$('img.opt').contextMenu(
|
||||
{
|
||||
menu: 'optmenu',
|
||||
leftButton: true,
|
||||
},
|
||||
function (action, el, pos)
|
||||
{
|
||||
var ts = $(el).parent().prevAll('a.ts').last().attr('file');
|
||||
var did = $(el).attr('did');
|
||||
switch (action)
|
||||
{
|
||||
case 'delete':
|
||||
confirm_action('delete', delete_callback, ts, did);
|
||||
break;
|
||||
|
||||
case 'lock':
|
||||
confirm_action('change the lock on', lock_callback, ts, did);
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
<script type=text/javascript src=/cgi-bin/browse/browse.js></script>
|
||||
}
|
||||
|
||||
puts { <div style="border: 1px solid grey; padding: 1em"> }
|
||||
puts "<span style=\"display:none\" id=dir>$dir</span>"
|
||||
|
||||
# Breadcrumb path
|
||||
puts "<h1>"
|
||||
puts "
|
||||
<fieldset style=\"margin: 1em\">
|
||||
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
|
||||
"
|
||||
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>"
|
||||
puts "<span class=filesize id=dirsize></span>"
|
||||
puts "</legend>"
|
||||
|
||||
# Parent directory
|
||||
set parent [join [lrange [split $dir /] 0 end-1] /]
|
||||
if {$parent ne ""} {
|
||||
puts "
|
||||
<div class=va>
|
||||
<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $parent]>
|
||||
<img src=/images/711_3_09_Media_Folder_UP.png class=va>
|
||||
<img border=0 src=/images/711_3_09_Media_Folder_UP.png class=va>
|
||||
\[parent directory\]</a>
|
||||
</div>
|
||||
"
|
||||
}
|
||||
|
||||
# Strip double slashes
|
||||
regsub -all -- {\/+} "$dir/*" "/" dir
|
||||
|
||||
foreach file [lsort [glob -nocomplain "$dir"]] {
|
||||
entry $file
|
||||
}
|
||||
|
||||
puts "</div>"
|
||||
puts "</fieldset>"
|
||||
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
footer
|
||||
|
||||
|
||||
287
var/mongoose/cgi-bin/browse/browse.js
Executable file
@@ -0,0 +1,287 @@
|
||||
|
||||
function epginfo_callback(data, status, xhr)
|
||||
{
|
||||
var width = 85;
|
||||
|
||||
if (status != 'success')
|
||||
return;
|
||||
|
||||
//console.log(status);
|
||||
//console.dir(data);
|
||||
|
||||
$('#titleorig').val(data.title);
|
||||
$('#renametitle').val(data.title);
|
||||
if (data.synopsis.length > width)
|
||||
data.synopsis = data.synopsis.substring(0, width) + '...';
|
||||
$('#synopsis').html(data.synopsis);
|
||||
$('tr.tstype').show('slow');
|
||||
}
|
||||
|
||||
function insert_folder_size(folder, size)
|
||||
{
|
||||
folder = folder.replace(/ /g, '');
|
||||
folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||
//console.log("Folder: (%s) = (%s)", folder, size);
|
||||
if (folder == "")
|
||||
$('#dirsize').text(' (' + size + 'iB)');
|
||||
else
|
||||
$('#' + folder).text(' (' + size + 'iB)');
|
||||
}
|
||||
|
||||
function folder_size_callback(data, status, xhr)
|
||||
{
|
||||
//console.log("Status: %s", status);
|
||||
//console.dir(data);
|
||||
$.each(data, insert_folder_size);
|
||||
}
|
||||
|
||||
function set_folder_new(folder, cnt)
|
||||
{
|
||||
folder = folder.replace(/ /g, '');
|
||||
folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||
//console.log("Folder: (%s) = (%s)", folder, cnt);
|
||||
$('#img' + folder).attr('src', '/img/Folder_New.png');
|
||||
}
|
||||
|
||||
function new_folder_callback(data, status, xhr)
|
||||
{
|
||||
//console.log("Status: %s", status);
|
||||
//console.dir(data);
|
||||
$.each(data, set_folder_new);
|
||||
}
|
||||
|
||||
function delete_callback(file, type, id)
|
||||
{
|
||||
var el = 'div.bf#' + id;
|
||||
var results = el + ' .results';
|
||||
var url = '/cgi-bin/browse/delete.jim?file=' +
|
||||
encodeURIComponent(file) + '&type=' + type;
|
||||
$(results).load(url, function() {
|
||||
$(el).delay(3000).slideUp(300, function() {
|
||||
$(el).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function lock_callback(file, type, id)
|
||||
{
|
||||
var url = '/cgi-bin/browse/lock.jim?file=' + encodeURIComponent(file);
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function enc_callback(file, type, id)
|
||||
{
|
||||
var url = '/cgi-bin/browse/enc.jim?file=' + encodeURIComponent(file);
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function new_callback(file, type, id)
|
||||
{
|
||||
var url = '/cgi-bin/browse/new.jim?file=' + encodeURIComponent(file);
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function rename_submit()
|
||||
{
|
||||
var s = $('#renameform_form').serialize();
|
||||
$.get('/cgi-bin/browse/rename.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
var $confirm; // Populated after DOM is loaded.
|
||||
|
||||
function confirm_action(action, callback, file, type, id)
|
||||
{
|
||||
var bfile = file.replace(/.*\/|\.[^.]*$/g, '');
|
||||
$confirm.dialog('option', 'buttons', {
|
||||
'Yes': function() { $(this).dialog('close');
|
||||
callback(file, type, id); },
|
||||
'No': function() {$(this).dialog('close');}
|
||||
|
||||
});
|
||||
$('#confirm').empty().html(
|
||||
'Are you sure you wish to ' + action + '<br>' +
|
||||
'<i>' + bfile + '</i> ?'
|
||||
);
|
||||
$confirm.dialog('open');
|
||||
}
|
||||
|
||||
function preparemenu(el, menu)
|
||||
{
|
||||
if (el.attr('type') == 'ts')
|
||||
{
|
||||
if (el.attr('def') == 'HD')
|
||||
{
|
||||
$('#optmenu').enableContextMenuItems('#enc');
|
||||
if (el.attr('encd') == 1)
|
||||
$(menu).changeContextMenuItem('#enc',
|
||||
'Remove ENC');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#enc',
|
||||
'Set ENC');
|
||||
}
|
||||
else
|
||||
$('#optmenu').disableContextMenuItems('#enc');
|
||||
|
||||
$('#optmenu').enableContextMenuItems('#new');
|
||||
if (el.attr('new') == 1)
|
||||
$(menu).changeContextMenuItem('#new', 'Mark watched');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#new', 'Mark new');
|
||||
|
||||
|
||||
$('#optmenu').enableContextMenuItems('#lock');
|
||||
if (el.attr('locked') == 1)
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Unlock');
|
||||
$('#optmenu').disableContextMenuItems('#delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Lock');
|
||||
$('#optmenu').enableContextMenuItems('#delete');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#optmenu').enableContextMenuItems('#delete');
|
||||
$('#optmenu').disableContextMenuItems('#lock');
|
||||
$('#optmenu').disableContextMenuItems('#enc');
|
||||
$('#optmenu').disableContextMenuItems('#new');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var menuclick = function(action, el, pos)
|
||||
{
|
||||
var file = $(el).parent().prevAll('a.bf').last().attr('file');
|
||||
var bfile = file.replace(/.*\/|\.[^.]*$/g, '');
|
||||
bfile = bfile.replace(/[\x00-\x1f]+/g, '');
|
||||
var type = $(el).attr('type');
|
||||
var id = $(el).attr('did');
|
||||
switch (action)
|
||||
{
|
||||
case 'delete':
|
||||
confirm_action('delete', delete_callback, file,
|
||||
type, id);
|
||||
break;
|
||||
|
||||
case 'lock':
|
||||
confirm_action('change the lock on', lock_callback,
|
||||
file, type, id);
|
||||
break;
|
||||
|
||||
case 'enc':
|
||||
confirm_action('change the ENC flag on', enc_callback,
|
||||
file, type, id);
|
||||
break;
|
||||
|
||||
case 'new':
|
||||
confirm_action('change the New flag on', new_callback,
|
||||
file, type, id);
|
||||
break;
|
||||
|
||||
case 'rename':
|
||||
$('#rename').val(bfile);
|
||||
$('#renameorig').val(file);
|
||||
|
||||
$('#titleorig').val('');
|
||||
$('#renametitle').val('');
|
||||
$('#synopsis').val('');
|
||||
$('tr.tstype').css('display', 'none');
|
||||
|
||||
if (type == 'ts')
|
||||
{
|
||||
$.getJSON('/cgi-bin/browse/epgtitle.jim?file=' +
|
||||
encodeURIComponent(file), epginfo_callback);
|
||||
}
|
||||
|
||||
$('#renameform').dialog('open');
|
||||
break;
|
||||
|
||||
case 'download':
|
||||
window.location.href = '/cgi-bin/browse/download.jim?file=' +
|
||||
encodeURIComponent(file);
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// Bind context menu to opt+ image
|
||||
$('img.opt').contextMenu(
|
||||
{
|
||||
menu: 'optmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparemenu
|
||||
},
|
||||
menuclick
|
||||
);
|
||||
|
||||
// Disable items which are not yet implemented.
|
||||
$('#optmenu').disableContextMenuItems('#title');
|
||||
|
||||
// Create reusable dialogue.
|
||||
var $dialog = $('#dialogue').dialog({
|
||||
title: "Media 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">'); }
|
||||
});
|
||||
|
||||
// Bind dialogue open to filenames.
|
||||
$('a.bf').click(function(e) {
|
||||
e.preventDefault();
|
||||
var file = $(this).attr('file');
|
||||
var type = $(this).attr('type');
|
||||
var url = '/cgi-bin/browse/file.jim?file=' +
|
||||
encodeURIComponent(file) + '&type=' + type;
|
||||
$('#dialogue').load(url);
|
||||
$dialog.dialog('open');
|
||||
});
|
||||
|
||||
$('#renameform').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Update": rename_submit,
|
||||
"Close": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#rename').val(''); }
|
||||
});
|
||||
|
||||
// Create re-usable confirmation dialogue.
|
||||
$confirm = $('#confirm').dialog({
|
||||
modal: true, autoOpen: false,
|
||||
height: 160, width: 500,
|
||||
show: 'fade', hide: 'fade',
|
||||
draggable: false, resizable: false
|
||||
});
|
||||
|
||||
var dir = $('#dir').text();
|
||||
|
||||
// Load folder sizes
|
||||
$.getJSON('/cgi-bin/browse/sizes.jim?dir=' + encodeURIComponent(dir),
|
||||
folder_size_callback);
|
||||
|
||||
// Flag folders with unwatched items
|
||||
$.getJSON('/cgi-bin/browse/newdir.jim?dir=' + encodeURIComponent(dir),
|
||||
new_folder_callback);
|
||||
});
|
||||
|
||||
27
var/mongoose/cgi-bin/browse/delete.jim
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set type [dict get $_cgi type]
|
||||
|
||||
if {$type eq "ts"} {
|
||||
set ts [ts fetch $file]
|
||||
if {[$ts delete]} {
|
||||
puts "Successfully deleted $file."
|
||||
} else {
|
||||
puts "Problem deleting $file, [$ts get error]"
|
||||
}
|
||||
exit
|
||||
}
|
||||
|
||||
file delete $file
|
||||
puts "Successfully deleted $file."
|
||||
|
||||
49
var/mongoose/cgi-bin/browse/download.jim
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class
|
||||
|
||||
#puts "Content-Type: text/plain\r\n\r\n"
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set rfile [file normalize $file]
|
||||
set ts [ts fetch $file]
|
||||
|
||||
set dmsfile /mnt/hd2/dms_cds.db
|
||||
|
||||
set url $file
|
||||
set mime "video/ts"
|
||||
if {[file exists $dmsfile]} {
|
||||
set db [sqlite3.open /mnt/hd2/dms_cds.db]
|
||||
set muri [$db query "
|
||||
select tblresource.mimetype, contenturi
|
||||
from tblresource join tblmedia using (mediaid)
|
||||
where localurl = '%s'" $rfile]
|
||||
if {$muri != ""} {
|
||||
set rec [lindex $muri 0]
|
||||
set xuri [lindex $rec 3]
|
||||
set mime [lindex $rec 1]
|
||||
set url "http://$env(HTTP_HOST):9000/web/$xuri"
|
||||
}
|
||||
}
|
||||
|
||||
puts "Content-Type: text/plain"
|
||||
puts "Refresh: 0; url=$url"
|
||||
puts "Content-length: 0"
|
||||
puts ""
|
||||
|
||||
#puts "Pragma: public"
|
||||
#puts "Expires: 0"
|
||||
#puts "Cache-Control: must-revalidate, post-check=0, pre-check=0"
|
||||
#puts "Content-Type: application/force-download"
|
||||
#puts "Content-Type: application/download"
|
||||
#puts "Content-Type: $mime"
|
||||
#puts "Content-Disposition: attachment; filename=\"[file tail $file]\""
|
||||
#puts "Content-Transfer-Encoding: binary"
|
||||
#puts "Content-Length: [file size $rfile]"
|
||||
|
||||
27
var/mongoose/cgi-bin/browse/enc.jim
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(file) "/media/My Video/The Walking Dead/The Walking Dead S01E06.ts"
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set ts [ts fetch $file]
|
||||
if {[set ts [ts fetch $file]] != 0} {
|
||||
set action enc
|
||||
if {[$ts flag "Encrypted"]} { set action unenc }
|
||||
|
||||
if {[$ts $action]} {
|
||||
puts "Successfully [set action]ed $file."
|
||||
} else {
|
||||
puts "Problem [set action]ing $file,
|
||||
[$ts get error]"
|
||||
}
|
||||
}
|
||||
|
||||
22
var/mongoose/cgi-bin/browse/epgtitle.jim
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: application/json"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
#set _cgi(file) "/media/My Video/Doctor Who/6.13._The_Almost_People.ts"
|
||||
|
||||
if {![dict exists $_cgi file]} { exit }
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set ts [ts fetch $file]
|
||||
|
||||
puts "{"
|
||||
puts "\"title\" : \"[$ts get title]\","
|
||||
puts "\"synopsis\" : \"[$ts get synopsis]\""
|
||||
puts "}"
|
||||
|
||||
17
var/mongoose/cgi-bin/browse/ffmpeg.jim
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
if [file exists /mod/bin/ffmpeg] {
|
||||
set file [dict get $_cgi file]
|
||||
puts [exec /mod/var/mongoose/lib/ffmpeg -i $file]
|
||||
} else {
|
||||
puts "Install ffmpeg package for more information..."
|
||||
}
|
||||
|
||||
115
var/mongoose/cgi-bin/browse/file.jim
Executable file
@@ -0,0 +1,115 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/pretty_size
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(file) "/media/My Video/Dangermouse/Series 1/01_rogue_robots.avi"
|
||||
|
||||
if {![dict exists $_cgi file]} { exit }
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set type [dict get $_cgi type]
|
||||
|
||||
file stat $file st
|
||||
set sz [pretty_size $st(size)]
|
||||
|
||||
if {$type eq "ts"} {
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
set ts [ts fetch $file]
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td>[$ts get title]</td>
|
||||
</tr><tr>
|
||||
<th>Synopsis</th>
|
||||
<td>[$ts get synopsis]</td>
|
||||
</tr><tr>
|
||||
"
|
||||
|
||||
if {[$ts flag "Guidance"] > 0} {
|
||||
puts "
|
||||
<th>Guidance</th>
|
||||
<td><img class=va
|
||||
src=/images/174_1_26_GuidancePolicy.png height=21>
|
||||
[$ts get guidance]
|
||||
</td>
|
||||
</tr><tr>
|
||||
"
|
||||
}
|
||||
|
||||
puts "
|
||||
<th>Definition</th>
|
||||
<td>
|
||||
"
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
puts "<img class=va src=/images/172_1_00_HD.png height=21>"
|
||||
} else {
|
||||
puts "<img class=va src=/images/172_1_26_SD.png height=21>"
|
||||
}
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Channel</th>
|
||||
<td>[epg channelicon [$ts get channel_name] 50 "vertical-align: middle"]
|
||||
[$ts get channel_num] - [$ts get channel_name]</td>
|
||||
</tr><tr>
|
||||
<th>Start Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get start] -format "%c %Z"]
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>End Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get end] -format "%c %Z"]
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[$ts duration] minute(s).</td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>$sz</td>
|
||||
</tr><tr>
|
||||
<th>Flags</th>
|
||||
<td>[$ts get flags]</td>
|
||||
</tr>
|
||||
</table>
|
||||
"
|
||||
exit
|
||||
}
|
||||
|
||||
# Otherwise, for a general file.
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
<td>$file</td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>$sz</td>
|
||||
</tr><tr>
|
||||
<th>Info</th>
|
||||
<td class=pre id=ffmpeg>
|
||||
<img src=/img/loading.gif><i>Loading...</i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
"
|
||||
|
||||
set url "/cgi-bin/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
|
||||
puts { <script type="text/javascript"> }
|
||||
puts "var url = \"$url\";"
|
||||
puts {
|
||||
$('#ffmpeg').load(url);
|
||||
</script>
|
||||
}
|
||||
|
||||
27
var/mongoose/cgi-bin/browse/lock.jim
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(file) "/media/My Video/The Walking Dead/The Walking Dead S01E06.ts"
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set ts [ts fetch $file]
|
||||
if {[set ts [ts fetch $file]] != 0} {
|
||||
set action lock
|
||||
if {[$ts flag "Locked"]} { set action unlock }
|
||||
|
||||
if {[$ts $action]} {
|
||||
puts "Successfully [set action]ed $file."
|
||||
} else {
|
||||
puts "Problem [set action]ing $file,
|
||||
[$ts get error]"
|
||||
}
|
||||
}
|
||||
|
||||
27
var/mongoose/cgi-bin/browse/new.jim
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(file) "/media/My Video/The Walking Dead/The Walking Dead S01E06.ts"
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set ts [ts fetch $file]
|
||||
if {[set ts [ts fetch $file]] != 0} {
|
||||
set action new
|
||||
if {[$ts flag "New"]} { set action watched }
|
||||
|
||||
if {[$ts set_$action]} {
|
||||
puts "Successfully marked $file as $action."
|
||||
} else {
|
||||
puts "Problem marking $file as $action,
|
||||
[$ts get error]"
|
||||
}
|
||||
}
|
||||
|
||||
34
var/mongoose/cgi-bin/browse/newdir.jim
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require pack
|
||||
|
||||
puts "Content-Type: application/json"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(dir) "/media/My Video"
|
||||
|
||||
set root [dict get $_cgi dir]
|
||||
# Strip double slashes
|
||||
regsub -all -- {\/+} "$root/*" "/" root
|
||||
|
||||
puts "{"
|
||||
foreach dir [glob -nocomplain "$root"] {
|
||||
if {[file exists "$dir/.series"]} {
|
||||
set fd [open "$dir/.series"]
|
||||
set bytes [read $fd 8]
|
||||
set recs [unpack $bytes -uintle 0 32]
|
||||
set plays [unpack $bytes -uintle 32 32]
|
||||
set diff $($recs - $plays)
|
||||
if {$diff != 0} {
|
||||
set node [lindex [split $dir /] end]
|
||||
puts "\"$node\": $diff,"
|
||||
}
|
||||
}
|
||||
}
|
||||
puts "\"dummy\" : 0"
|
||||
puts "}"
|
||||
|
||||
53
var/mongoose/cgi-bin/browse/rename.jim
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#renameorig
|
||||
#titleorig
|
||||
#rename
|
||||
#renametitle
|
||||
|
||||
#set _cgi(renameorig) "/media/My Video/The Walking Dead/The Walking Dead_20110521_2201.ts"
|
||||
#set _cgi(rename) "Last Episode"
|
||||
|
||||
if {![dict exists $_cgi renameorig]} { exit }
|
||||
|
||||
set file [dict get $_cgi renameorig]
|
||||
set newfile [dict get $_cgi rename]
|
||||
|
||||
if {[string length [string trim $newfile]] == 0 || $file eq $newfile} {
|
||||
set newfile ""
|
||||
}
|
||||
|
||||
if {[file isdirectory $file]} {
|
||||
#puts "Directory."
|
||||
if {$newfile ne ""} {
|
||||
set dir [file dirname $file]
|
||||
set newfile "${dir}/${newfile}"
|
||||
file rename $file $newfile
|
||||
}
|
||||
} elseif {[set ts [ts fetch $file]] != 0} {
|
||||
#puts "TS file."
|
||||
|
||||
catch {
|
||||
set title [dict get $_cgi renametitle]
|
||||
set titleorig [dict get $_cgi titleorig]
|
||||
|
||||
if {[string length [string trim $title]] > 0 &&
|
||||
$title ne $titleorig} {
|
||||
$ts settitle $title
|
||||
}
|
||||
}
|
||||
if {$newfile ne ""} { ts renamegroup $file $newfile }
|
||||
} else {
|
||||
#puts "Normal file."
|
||||
if {$newfile ne ""} { ts renamegroup $file $newfile }
|
||||
}
|
||||
|
||||
46
var/mongoose/cgi-bin/browse/sizes.jim
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
|
||||
#puts "Content-Type: text/plain"
|
||||
puts "Content-Type: application/json"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(dir) "/media/My Video"
|
||||
|
||||
set dir [dict get $_cgi dir]
|
||||
|
||||
#9.4G /media/My Video/Archive
|
||||
#1.4G /media/My Video/CSI_ Crime Scene Investigation
|
||||
puts "{"
|
||||
foreach line [split [exec /mod/bin/busybox/du -h "$dir/"] "\n"] {
|
||||
set fields [split $line "\t"]
|
||||
set size [lindex $fields 0]
|
||||
set node [file tail [lindex $fields 1]]
|
||||
# set node [lindex [split [lindex $fields 1] /] end]
|
||||
puts "\"$node\" : \"$size\","
|
||||
}
|
||||
|
||||
# Handle symbolic links.
|
||||
foreach file [glob -nocomplain "$dir/*"] {
|
||||
if {[catch {set lk [file readlink $file]}]} continue
|
||||
|
||||
if {![string match "/*" $lk]} { set lk "$dir/$lk" }
|
||||
|
||||
if {![file isdirectory $lk]} continue
|
||||
foreach line [split [exec /mod/bin/busybox/du -h "$lk"] "\n"] {
|
||||
set fields [split $line "\t"]
|
||||
if {[lindex $fields 1] eq $lk} {
|
||||
set node [file tail $file]
|
||||
set size [lindex $fields 0]
|
||||
puts "\"$node\" : \"@$size\","
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
puts "\"dummy\" : \"\""
|
||||
puts "}"
|
||||
|
||||
113
var/mongoose/cgi-bin/channel.jim
Executable file
@@ -0,0 +1,113 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require altrow progressbar epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
header
|
||||
|
||||
cgi_input
|
||||
|
||||
proc f2c {frequency} {
|
||||
set ch int($((($frequency / 1000) - 303.25) / 8))
|
||||
return [expr int($ch)]
|
||||
}
|
||||
|
||||
if {[catch {set db [sqlite3.open /var/lib/humaxtv/channel.db]} msg]} {
|
||||
puts "Error opening channel database: $msg"
|
||||
exit
|
||||
}
|
||||
|
||||
puts "
|
||||
<button id=expandall>Expand All</button>
|
||||
<button id=collapseall>Collapse All</button>
|
||||
<br><br>
|
||||
<table class=borders>
|
||||
<tr>
|
||||
<th>Channel</th>
|
||||
<th>Frequency</th>
|
||||
<th>Signal Strength</th>
|
||||
<th>Signal Quality</th>
|
||||
<th>Channels</th>
|
||||
</tr>
|
||||
"
|
||||
foreach tw [$db query {
|
||||
select tsIdx, usTsID, ulFrequency, ucLevel, ucQuality
|
||||
from TBL_TS
|
||||
order by ulFrequency
|
||||
}] {
|
||||
lassign $tw x tsIdx x usTsID x ulFrequency x ucLevel x ucQuality
|
||||
|
||||
altrow
|
||||
puts "
|
||||
<td>[f2c $ulFrequency]</td>
|
||||
<td>[expr $ulFrequency / 1000.0] MHz</td>
|
||||
"
|
||||
puts "<td>[progressbar $ucLevel]</td>"
|
||||
puts "<td>[progressbar $ucQuality]</td>"
|
||||
|
||||
set channels [$db query {
|
||||
select usLcn, szSvcName, szPrvName, aucDefaultAuthority
|
||||
from TBL_SVC left join TBL_PRV using (prvIdx)
|
||||
where tsIdx = %s
|
||||
order by usLcn
|
||||
} $tsIdx]
|
||||
puts "<td>[llength $channels]
|
||||
<a class=mchan ts=$tsIdx href=#>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
view
|
||||
</a></td>"
|
||||
puts "</tr>"
|
||||
puts "<tr id=mchan_$tsIdx class=mchan style=\"display: none\">
|
||||
<td colspan=5>"
|
||||
puts "<table style=\"margin-left: 5em\">"
|
||||
puts "<tr>
|
||||
<th colspan=3>Channel</th>
|
||||
<th>Provider</th>
|
||||
<th>Authority</th>
|
||||
</tr>"
|
||||
foreach chan $channels {
|
||||
lassign $chan x lcn x name x prv x auth
|
||||
set name [string range $name 1 end]
|
||||
set prv [string range $prv 3 end]
|
||||
altrow
|
||||
puts "<td class=va>"
|
||||
puts "[epg channelicon $name 50]</td>
|
||||
<td>$lcn</td><td>$name</td>"
|
||||
puts "</td><td>"
|
||||
puts $prv
|
||||
puts "</td><td>"
|
||||
puts $auth
|
||||
puts "</td>"
|
||||
puts "</tr>"
|
||||
}
|
||||
puts "</table>"
|
||||
puts "</td></tr>"
|
||||
}
|
||||
|
||||
puts "</table>"
|
||||
|
||||
puts {
|
||||
<script type=text/javascript>
|
||||
|
||||
$(document).ready(function() {
|
||||
$('a.mchan').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#mchan_' + $(this).attr('ts')).slideToggle('slow');
|
||||
});
|
||||
$('#expandall').button().click(function() {
|
||||
$('tr.mchan').slideDown('slow');
|
||||
});
|
||||
$('#collapseall').button().click(function() {
|
||||
$('tr.mchan').slideUp('slow');
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
}
|
||||
|
||||
85
var/mongoose/cgi-bin/db.jim
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require altrow
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
set databases {
|
||||
/var/lib/humaxtv/rsvp.db
|
||||
/var/lib/humaxtv/rsv.db
|
||||
/var/lib/humaxtv/setup.db
|
||||
/var/lib/humaxtv/channel.db
|
||||
/mnt/hd2/dms_cds.db
|
||||
}
|
||||
|
||||
header
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set ftab [cgi_get tab]
|
||||
set fdb [cgi_get db]
|
||||
|
||||
if {$fdb != 0} {
|
||||
puts "<h1><a href=/cgi-bin/db.jim>Remove filters</a></h1>"
|
||||
}
|
||||
|
||||
proc db_info {db_file} {
|
||||
global _cgi fdb ftab
|
||||
|
||||
if {$fdb != 0 && [file tail $db_file] ne $fdb} { return }
|
||||
if {![file exists $db_file]} { return }
|
||||
|
||||
set db [sqlite3.open $db_file]
|
||||
set tables [$db query {
|
||||
select name from sqlite_master
|
||||
where type='table' order by name
|
||||
}]
|
||||
|
||||
puts "<h1><a href=/cgi-bin/db.jim?db=[file tail $db_file]>
|
||||
$db_file</a></h1>"
|
||||
|
||||
foreach table $tables {
|
||||
set table [lindex $table 1]
|
||||
if {$ftab != 0 && $ftab ne $table} { continue }
|
||||
set columns [$db query "pragma table_info($table)"]
|
||||
set datas [$db query "SELECT * FROM $table order by 1"]
|
||||
|
||||
puts "<h2><a href=/cgi-bin/db.jim?db=[file tail $db_file]&tab=$table>$table</a></h2>"
|
||||
puts "<table class=borders>"
|
||||
puts " <tr>"
|
||||
foreach column $columns {
|
||||
puts " <th>[lindex $column 3]</th>"
|
||||
}
|
||||
puts " </tr>"
|
||||
foreach data $datas {
|
||||
altrow
|
||||
|
||||
for {set i 1} {$i < [llength $data]} {incr i 2} {
|
||||
puts " <td>[lindex $data $i]</td>"
|
||||
}
|
||||
puts " </tr>"
|
||||
}
|
||||
puts "</table>"
|
||||
}
|
||||
|
||||
$db close
|
||||
}
|
||||
|
||||
if {$fdb == 0} {
|
||||
puts "Please choose database to view:<ul>"
|
||||
foreach db $databases {
|
||||
puts "<li><a href=$::env(REQUEST_URI)?db=[file tail $db]>
|
||||
$db</a></li>"
|
||||
}
|
||||
puts "</ul>"
|
||||
} else {
|
||||
foreach db $databases { db_info $db }
|
||||
}
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
header
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
@@ -31,5 +32,6 @@ if { $raw == 0 } {
|
||||
puts "</pre>"
|
||||
|
||||
epg cleanup
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
|
||||
footer
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
@@ -9,19 +10,25 @@ puts ""
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set service 0
|
||||
catch { set service [dict get $_cgi service] }
|
||||
set event 0
|
||||
catch { set event [dict get $_cgi event] }
|
||||
if {! [dict exists $_cgi bare]} {
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
}
|
||||
|
||||
#set service 8384
|
||||
#set event 25293
|
||||
set service [cgi_get service 0]
|
||||
set event [cgi_get event 0]
|
||||
if {! [dict exists $_cgi bare]} { header }
|
||||
|
||||
set record [lindex [epg fetch dump -service $service -event $event] 0]
|
||||
$record get_channel_info
|
||||
set others [$record othertimes]
|
||||
|
||||
puts {
|
||||
<style type=text/css>
|
||||
font.also
|
||||
{
|
||||
font-size: 0.9em;
|
||||
font-style: italic;
|
||||
color: #333;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
@@ -33,10 +40,38 @@ puts "
|
||||
<td>[$record get text]</td>
|
||||
</tr><tr>
|
||||
<th>Start</th>
|
||||
<td>[clock format [$record get start] -format {%c %Z}]</td>
|
||||
<td>[clock format [$record get start] -format {%c %Z}]
|
||||
"
|
||||
|
||||
foreach o $others {
|
||||
if {[$o ended]} { continue }
|
||||
$o get_channel_info
|
||||
$o process_sched
|
||||
if {[$o get series_crid] eq ""} { set ro 1 } else { set ro 2 }
|
||||
puts -nonewline "<br><font class=also> "
|
||||
puts -nonewline "Also: "
|
||||
puts -nonewline "<a class=event href=# xs=[$o get service_id] "
|
||||
puts -nonewline "xe=[$o get event_id] "
|
||||
puts -nonewline "sch=[$o get sched_type] rec=$ro>"
|
||||
puts -nonewline "[clock format [$o get start] -format {%c %Z}]"
|
||||
puts -nonewline " on "
|
||||
puts -nonewline [$o channel_icon 16]
|
||||
puts -nonewline "[$o get channel_name] "
|
||||
puts "</a>"
|
||||
puts "</font>"
|
||||
}
|
||||
|
||||
puts "
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[clock format [$record get duration] -format %T]</td>
|
||||
<td>[clock format [$record get duration] -format %T]
|
||||
"
|
||||
if {[$record showing]} {
|
||||
puts [progressbar [$record percent]]
|
||||
}
|
||||
puts "
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Type</th>
|
||||
<td>[$record get content_type] ([$record get content_code])</td>
|
||||
@@ -55,8 +90,13 @@ if {[$record get warning] != ""} {
|
||||
if {[$record get event_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th>CRID</th>
|
||||
<td>[$record get channel_crid][$record get event_crid]</td>
|
||||
<th>CRID</th><td>
|
||||
<a href=/cgi-bin/epg_search.jim?crid=[$record get event_crid]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$record get channel_crid][$record get event_crid]
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
@@ -104,8 +144,8 @@ puts "
|
||||
</a>
|
||||
"
|
||||
|
||||
epg cleanup
|
||||
if {! [dict exists $_cgi bare]} {
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
}
|
||||
puts "<div id=epginfo_extra class=footnote></div>"
|
||||
|
||||
epg cleanup
|
||||
if {! [dict exists $_cgi bare]} { footer }
|
||||
|
||||
|
||||
43
var/mongoose/cgi-bin/epg_schedule.jim
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require epg.class system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
if {![dict exists $_cgi service] || ![dict exists $_cgi event]} {
|
||||
puts "Error, insufficient parameters passed."
|
||||
exit
|
||||
}
|
||||
|
||||
set service $_cgi(service)
|
||||
set event $_cgi(event)
|
||||
set type 1
|
||||
if {[dict exists $_cgi type]} { set type $_cgi(type) }
|
||||
|
||||
set event [lindex [epg fetch dump -service $service -event $event] 0]
|
||||
if {$event eq ""} {
|
||||
puts "Error, cannot find event to schedule."
|
||||
exit
|
||||
}
|
||||
if {[$event percent] > 0} {
|
||||
puts "Error, cannot record programme which has already started showing"
|
||||
puts "or occurred in the past."
|
||||
exit
|
||||
}
|
||||
|
||||
set r [rsv construct $event $type]
|
||||
if {[catch {$r insert} msg]} {
|
||||
puts "Error encountered while scheduling: <i>$msg</i>"
|
||||
} else {
|
||||
puts "Successfully scheduled <i>[$event get name]</i>"
|
||||
system restartpending
|
||||
}
|
||||
|
||||
epg cleanup
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
source /mod/var/mongoose/lib/altrow
|
||||
source /mod/var/mongoose/lib/cat
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require epg.class spinner.class altrow
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
header
|
||||
|
||||
puts "<script type=text/javascript src=/js/highlight.js></script>"
|
||||
require totop
|
||||
|
||||
source /mod/var/mongoose/lib/epg_popup
|
||||
puts "<script type=text/javascript src=/js/jquery.highlight.js></script>"
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
#set _cgi [dict create term "doctor who"]
|
||||
#set env(REQUEST_URI) "test"
|
||||
|
||||
set term ""
|
||||
catch { set term [dict get $_cgi term] }
|
||||
set cmd "search"
|
||||
if {[dict exists $_cgi full]} { set cmd "searchall" }
|
||||
set ct 0
|
||||
catch { set ct [dict get $_cgi ct] }
|
||||
set crid ""
|
||||
@@ -30,72 +23,35 @@ catch { set crid [dict get $_cgi crid] }
|
||||
set scrid ""
|
||||
catch { set scrid [dict get $_cgi scrid] }
|
||||
|
||||
puts "
|
||||
<form method=get action=/cgi-bin/epg_search.jim>
|
||||
Search EPG: <input name=term size=20 maxlength=255 value=\"$term\">
|
||||
<input type=checkbox name=full"
|
||||
if {[dict exists $_cgi full]} { puts " checked" }
|
||||
puts ">Search descriptions as well as titles.
|
||||
<input type=submit value=Search>
|
||||
"
|
||||
if {[dict exists $_cgi term]} {
|
||||
set lterm [dict get $_cgi term]
|
||||
|
||||
set db [sqlite3.open /var/lib/humaxtv/setup.db]
|
||||
set res [$db query {
|
||||
select itemBlob from TBL_USERCONFIG
|
||||
where itemName like 'EPG\_KEYWORD\_%%' ESCAPE '\'
|
||||
}]
|
||||
|
||||
proc cts {type img text} {
|
||||
puts "<a href=$::env(REQUEST_URI)?ct=$type>
|
||||
<img height=18 border=0 src=/images/173_3_00_G3_$img.png> $text</a>";
|
||||
}
|
||||
|
||||
puts {
|
||||
<br>
|
||||
<table>
|
||||
<tr><td rowspan=2>Content Type Searches</td>
|
||||
<td>
|
||||
}
|
||||
|
||||
cts 1 "Movie" "Film/Drama"
|
||||
puts "</td><td>"
|
||||
cts 2 "News" "News/Current affairs"
|
||||
puts "</td><td>"
|
||||
cts 4 "Sports" "Sport"
|
||||
puts "</td><td>"
|
||||
cts 9 "Education" "Education/Science/Factual"
|
||||
puts "</td><td>"
|
||||
cts 10 "Leisure" "Leisure"
|
||||
|
||||
puts "</td></tr><tr><td>"
|
||||
|
||||
cts 7 "Art" "Arts/Culture"
|
||||
puts "</td><td>"
|
||||
cts 3 "Show" "Show/Game show"
|
||||
puts "</td><td>"
|
||||
cts 5 "Children" "Children"
|
||||
puts "</td><td>"
|
||||
cts 8 "Society" "Social/Political/Economic"
|
||||
puts "</td><td>"
|
||||
cts 6 "Music" "Music/Ballet/Dance"
|
||||
|
||||
puts "</tr></table>"
|
||||
|
||||
puts "<table cellpadding=5>"
|
||||
if {[llength $res] > 0} {
|
||||
puts "<tr><td>Keyword Searches</td>"
|
||||
foreach keyword $res {
|
||||
set kw [string range [lindex $keyword 1] 1 end]
|
||||
puts "<td><a href=$env(REQUEST_URI)?term=[cgi_quote_url $kw]>$kw
|
||||
</a></td>"
|
||||
if {[string match {CRID:*} $lterm]} {
|
||||
set crid [string range $lterm 5 end]
|
||||
} elseif {[string match {SCRID:*} $lterm]} {
|
||||
set scrid [string range $lterm 6 end]
|
||||
}
|
||||
puts "</tr>"
|
||||
} elseif {$crid ne ""} {
|
||||
set _cgi(term) "CRID:$crid"
|
||||
} elseif {$scrid ne ""} {
|
||||
set _cgi(term) "SCRID:$scrid"
|
||||
}
|
||||
puts "</table>"
|
||||
|
||||
$db close
|
||||
require epg_search
|
||||
|
||||
puts "</form>"
|
||||
[spinner new {
|
||||
text "Searching EPG..."
|
||||
size "1.2em"
|
||||
style "margin: 1em;"
|
||||
}] start
|
||||
|
||||
require epg_popup
|
||||
|
||||
#set _cgi [dict create term "doctor who"]
|
||||
#set env(REQUEST_URI) "test"
|
||||
|
||||
set cmd "search"
|
||||
if {$searchfull} { set cmd "searchall" }
|
||||
|
||||
if {$ct > 0 } {
|
||||
set records [epg fetch dump -type $ct]
|
||||
@@ -103,13 +59,16 @@ if {$ct > 0 } {
|
||||
set records [epg fetch dump -crid $crid]
|
||||
} elseif {$scrid ne ""} {
|
||||
set records [epg fetch dump -scrid $scrid]
|
||||
} elseif {$term ne ""} {
|
||||
set records [epg fetch $cmd -extra $term]
|
||||
} elseif {$searchterm ne ""} {
|
||||
set records [epg fetch $cmd -extra $searchterm]
|
||||
} else {
|
||||
set records {}
|
||||
}
|
||||
|
||||
set favlist [epg favlist]
|
||||
|
||||
puts {
|
||||
if {[llength $records] > 0} {
|
||||
puts {
|
||||
<table class=borders id=results style="clear: both;margin: 0.5em 0 0 0">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
@@ -117,6 +76,9 @@ puts {
|
||||
<th>Programme</th>
|
||||
<th>Synopsis</th>
|
||||
</tr>
|
||||
}
|
||||
} else {
|
||||
puts "No results found."
|
||||
}
|
||||
|
||||
proc rsort {v1 v2} {
|
||||
@@ -135,9 +97,14 @@ foreach record [lsort -command rsort $records] {
|
||||
}
|
||||
altrow
|
||||
$record get_channel_info
|
||||
puts "<td nowrap>
|
||||
|
||||
set ended [$record ended]
|
||||
|
||||
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>"}
|
||||
puts "
|
||||
[clock format [$record get start] -format "%a %d %b %Y"]<br>
|
||||
[clock format [$record get start] -format "%H:%M %Z"]</td>"
|
||||
[clock format [$record get start] -format "%H:%M %Z"]"
|
||||
puts "</td>"
|
||||
puts "<td>[$record get channel_num]</td>"
|
||||
puts "<td>[$record channel_icon 50]</td>"
|
||||
puts "<td nowrap>
|
||||
@@ -147,18 +114,17 @@ foreach record [lsort -command rsort $records] {
|
||||
puts [$record cell]
|
||||
puts "<td>[$record get text]</td><td>[$record get warning]</td>"
|
||||
puts "</tr>"
|
||||
flush stdout
|
||||
}
|
||||
puts "</table>"
|
||||
|
||||
if {$term != ""} {
|
||||
if {$searchterm != ""} {
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
highlight(document.getElementById(\"results\"), \"$term\");
|
||||
\$('#results').highlight('$searchterm');
|
||||
</script>
|
||||
"
|
||||
}
|
||||
|
||||
epg cleanup
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
footer
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
source /mod/var/mongoose/lib/spinner.class
|
||||
source /mod/var/mongoose/lib/altrow
|
||||
source /mod/var/mongoose/lib/cat
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require epg.class spinner.class altrow
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
header
|
||||
|
||||
require totop
|
||||
|
||||
[spinner new {
|
||||
text "Loading EPG Data..."
|
||||
@@ -20,12 +20,9 @@ source /mod/var/mongoose/html/lib/header.jim
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
source /mod/var/mongoose/lib/epg_popup
|
||||
|
||||
set service 0
|
||||
set service 4351
|
||||
catch { set service [dict get $_cgi service] }
|
||||
require epg_popup
|
||||
|
||||
set service [cgi_get service 4351]
|
||||
set records [epg fetch dump -service $service]
|
||||
|
||||
set tr [lindex $records 0]
|
||||
@@ -56,21 +53,22 @@ puts {
|
||||
set i 0
|
||||
foreach record $records {
|
||||
altrow
|
||||
$record get_channel_info
|
||||
set ended [$record ended]
|
||||
if {[$record showing]} {
|
||||
puts "<td><img src=/images/111_1_00_Cursor_2R_Arrow.png></td>"
|
||||
} else { puts "<td></td>" }
|
||||
puts "<td nowrap>
|
||||
[clock format [$record get start] -format "%a %d %b %Y"]</td>"
|
||||
puts "<td nowrap>
|
||||
[clock format [$record get start] -format "%H:%M"]</td>"
|
||||
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
|
||||
puts "[clock format [$record get start] -format "%a %d %b %Y"]</td>"
|
||||
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
|
||||
puts "[clock format [$record get start] -format "%H:%M"]</td>"
|
||||
puts [$record cell]
|
||||
puts "<td>[$record get text]</td>"
|
||||
puts "<td>[$record get warning]</td>"
|
||||
puts "</tr>"
|
||||
flush stdout
|
||||
}
|
||||
puts "</table>"
|
||||
|
||||
epg cleanup
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
footer
|
||||
|
||||
|
||||
29
var/mongoose/cgi-bin/opkg.jim
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require pkg.class chunked
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set cmd [cgi_get cmd update]
|
||||
|
||||
start_chunked
|
||||
|
||||
set bcmd "|/mod/var/mongoose/lib/opkg $cmd"
|
||||
set fd [open $bcmd r]
|
||||
while {[gets $fd line] >= 0} {
|
||||
chunk "$line\r\n"
|
||||
#chunk_pad
|
||||
}
|
||||
close $fd
|
||||
|
||||
if {$cmd eq "update"} {
|
||||
chunk "Updating package meta information\r\n"
|
||||
pkg fetchmeta
|
||||
chunk "Done.\r\n"
|
||||
}
|
||||
|
||||
end_chunked
|
||||
|
||||
98
var/mongoose/cgi-bin/pkg.jim
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require settings.class pkg.class altrow
|
||||
|
||||
if {[[settings] pkgdev]} { set filter 0 } else { set filter 1 }
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts "Pragma: no-cache"
|
||||
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
if {![dict exists $_cgi type]} { set _cgi(type) avail }
|
||||
|
||||
proc pkgrow {pkg} {
|
||||
set name [$pkg get name]
|
||||
altrow
|
||||
puts "
|
||||
<td nowrap>$name</td>
|
||||
"
|
||||
|
||||
if {$::type eq "avail"} {
|
||||
puts "<td nowrap>[$pkg get latest]</td>"
|
||||
} else {
|
||||
puts "<td nowrap>[$pkg get installed]</td>"
|
||||
}
|
||||
|
||||
if {$::type eq "upgr"} {
|
||||
puts "<td nowrap>[$pkg get latest]</td>"
|
||||
}
|
||||
|
||||
if {[dict exists $::pkgmeta $name]} {
|
||||
puts "<td>$::pkgmeta($name)</td>"
|
||||
} else {
|
||||
puts "<td>[$pkg get descr]</td>"
|
||||
}
|
||||
|
||||
if {![$pkg is installed]} {
|
||||
set type Install
|
||||
} elseif {$::type eq "upgr" && [$pkg is upgradable]} {
|
||||
set type Upgrade
|
||||
} else {
|
||||
set type Remove
|
||||
}
|
||||
|
||||
puts "<td align=center><small><button id=\"[$pkg get name]\"
|
||||
action=[string tolower $type]
|
||||
class=[string tolower $type]>$type</button></small></td>"
|
||||
|
||||
puts "</tr>"
|
||||
}
|
||||
|
||||
pkg loadmeta
|
||||
|
||||
set type $_cgi(type)
|
||||
|
||||
set pkgs [pkg $type]
|
||||
|
||||
if {[llength $pkgs] > 0} {
|
||||
puts "<table><tr><th>Package</th>"
|
||||
|
||||
if {$type eq "avail"} {
|
||||
puts "<th>Available</th>"
|
||||
} else {
|
||||
puts "<th>Installed</th>"
|
||||
}
|
||||
|
||||
if {$type eq "upgr"} {
|
||||
puts "<th>Avail</th>"
|
||||
}
|
||||
|
||||
puts "
|
||||
<th>Description</th>
|
||||
<th> Action </th>
|
||||
</tr>
|
||||
"
|
||||
|
||||
foreach pkg $pkgs {
|
||||
if {$filter && ![dict exists $::pkgmeta $pkg]} { continue }
|
||||
pkgrow [pkg load $pkg]
|
||||
}
|
||||
puts "</table>"
|
||||
if {$filter} {
|
||||
puts "<font class=footnote>This is a filtered package list. To show all packages, enable the <i>Show development and advanced packages</i> in the settings screen.</font>"
|
||||
}
|
||||
} else {
|
||||
puts "<i>No packages "
|
||||
switch $type {
|
||||
inst { puts "are installed." }
|
||||
upgr { puts "are available for upgrade." }
|
||||
avail { puts "are available for installation." }
|
||||
}
|
||||
puts "</i>"
|
||||
}
|
||||
|
||||
56
var/mongoose/cgi-bin/restart.jim
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require rsv.class system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
if {[cgi_get now] eq "yes"} {
|
||||
# - Busybox reboot does sync the disk but may still not be clean enough.
|
||||
puts "Restarting."
|
||||
system reboot
|
||||
exit
|
||||
}
|
||||
|
||||
file delete /tmp/.restartpending
|
||||
header
|
||||
|
||||
# Commit pending reservations on older mod versions.
|
||||
if {![file exists /sbin/rsvsync] && ![file exists /mod/boot/rsvsync]} {
|
||||
rsv commit
|
||||
}
|
||||
|
||||
puts {
|
||||
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />
|
||||
<script type="text/javascript" src="/js/jquery.progressbar.js"></script>
|
||||
|
||||
<script type=text/javascript>
|
||||
var handle = 0;
|
||||
var pct = 0;
|
||||
function update()
|
||||
{
|
||||
$('#progressbar').reportprogress(++pct);
|
||||
if (pct == 100)
|
||||
{
|
||||
clearInterval(handle);
|
||||
pct = 0;
|
||||
window.location = '/';
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#progressbar').reportprogress(0);
|
||||
handle = setInterval("update()", 300);
|
||||
$.get('/cgi-bin/restart.jim?now=yes');
|
||||
});
|
||||
</script>
|
||||
|
||||
Please wait while the Humax restarts...<br>
|
||||
<div id=progressbar></div>
|
||||
}
|
||||
|
||||
footer
|
||||
|
||||
7
var/mongoose/cgi-bin/restartblock.jim
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
source /mod/var/mongoose/include/restart.jim
|
||||
|
||||
28
var/mongoose/cgi-bin/sched_cancel.jim
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require rsv.class system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set slot [cgi_get slot 0]
|
||||
set table [cgi_get table TBL_RESERVATION]
|
||||
|
||||
set event [rsv slot $table $slot]
|
||||
|
||||
if {$table eq "pending"} {
|
||||
$event remove_pending
|
||||
exit
|
||||
}
|
||||
|
||||
$event clear_ulslot
|
||||
$event set_delete
|
||||
$event insert
|
||||
|
||||
system restartpending
|
||||
|
||||
123
var/mongoose/cgi-bin/sched_info.jim
Executable file
@@ -0,0 +1,123 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require rsv.class progressbar
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set table [cgi_get table TBL_RESERVATION]
|
||||
set slot [cgi_get slot 0]
|
||||
|
||||
set event [rsv slot $table $slot]
|
||||
|
||||
set rsvicon [$event icon]
|
||||
if {$rsvicon ne ""} {
|
||||
set rsvicon "<img src='images/$rsvicon' height=20>
|
||||
}
|
||||
|
||||
set RKIcon [$event RKIcon]
|
||||
if {$RKIcon ne ""} {
|
||||
set RKIcon "<img src='images/$RKIcon' height=20>
|
||||
}
|
||||
|
||||
if {[$event get ucRecKind] == 4} {
|
||||
set series 1
|
||||
} else {
|
||||
set series 0
|
||||
}
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Event [$event get ulslot]</th>
|
||||
<td class=va>$rsvicon $RKIcon</td>
|
||||
</tr><tr>
|
||||
<th>Channel</th>
|
||||
<td class=va>
|
||||
"
|
||||
if {[$event get usLcn] ne ""} {
|
||||
puts "
|
||||
<img class=va width=50
|
||||
src=\"/img/channels/[$event channel_name].png\">
|
||||
- [$event get usLcn] - [$event channel_name]
|
||||
"
|
||||
}
|
||||
|
||||
puts "
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Event Name</th>
|
||||
<td>[$event name]</td>
|
||||
</tr><tr>
|
||||
<th>Start</th>
|
||||
"
|
||||
|
||||
set s [$event get nsttime]
|
||||
set d [$event get nduration]
|
||||
set e $($s + $d)
|
||||
set n [clock seconds]
|
||||
|
||||
if { $n > $e } {
|
||||
puts "<td class=blood nowrap class=va>"
|
||||
} else {
|
||||
puts "<td nowrap class=va>"
|
||||
}
|
||||
puts "[clock format $s -format "%a %d %b %Y"]
|
||||
[clock format $s -format "%H:%M %Z"]"
|
||||
|
||||
if {$d > 0 && $n > $s && $n < $e} {
|
||||
puts "<br>"
|
||||
set perc [expr [expr $n - $s] * 100 / $d]
|
||||
puts "<img class=va src=/images/745_1_11_Video_1REC.png>"
|
||||
puts [progressbar $perc]
|
||||
}
|
||||
|
||||
puts "
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[clock format [$event get nduration] -format %T]</td>
|
||||
</tr>
|
||||
"
|
||||
|
||||
set crid [join [lrange [split [$event get szCRID] /] 1 end]]
|
||||
if {$crid != ""} {
|
||||
puts "<tr><th>"
|
||||
if $series { puts "Series" } else { puts "Event" }
|
||||
puts " CRID</th><td>"
|
||||
puts -nonewline "<a href=/cgi-bin/epg_search.jim?"
|
||||
if $series { puts -nonewline "s" }
|
||||
puts "crid=/$crid>
|
||||
<img border=0 src=/images/421_1_00_CH_Title_2R_Arrow.png
|
||||
height=14>
|
||||
[$event get szCRID]"
|
||||
puts "</a></td></tr>"
|
||||
}
|
||||
puts "<tr><th>Events</th><td>"
|
||||
set flag 0
|
||||
foreach ev [split [$event get szEventToRecord] "|"] {
|
||||
if {$ev eq ""} { continue }
|
||||
set ev [string range $ev 1 end]
|
||||
if {$flag} { puts "<br>" }
|
||||
incr flag
|
||||
set crid [join [lrange [split $ev /] 1 end]]
|
||||
puts -nonewline "<a href=/cgi-bin/epg_search.jim?"
|
||||
puts "crid=/$crid>
|
||||
<img border=0 src=/images/421_1_00_CH_Title_2R_Arrow.png
|
||||
height=14>
|
||||
$ev"
|
||||
puts "</a>"
|
||||
}
|
||||
puts "</td></tr>"
|
||||
puts "<tr><th>Accepted</th><td>"
|
||||
if {[$event get aulEventToRecordInfo] != ""} {
|
||||
puts "Yes"
|
||||
}
|
||||
puts "</td></tr>"
|
||||
puts "</table>"
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/var/mongoose/lib/settings.class
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require settings.class
|
||||
require plugin
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
@@ -12,10 +14,14 @@ cgi_input
|
||||
set settings [settings new]
|
||||
|
||||
set hostname [$settings hostname]
|
||||
set smtp_server [$settings smtp_server]
|
||||
set channel_group [$settings channel_group]
|
||||
set pkgdev [$settings pkgdev]
|
||||
|
||||
# Handle updates
|
||||
|
||||
if {![dict exists $env REQUEST_URI]} { set env(REQUEST_URI) "" }
|
||||
|
||||
proc _handle_update {class var old text} {
|
||||
global _cgi
|
||||
global settings
|
||||
@@ -43,16 +49,22 @@ proc handle_str_update {var old {text "Value"}} {
|
||||
}
|
||||
|
||||
handle_str_update hostname $hostname Hostname
|
||||
_handle_update ascii smtp_server $smtp_server "SMTP Server"
|
||||
handle_int_update channel_group $channel_group "Channel Group"
|
||||
if {[dict exists $_cgi pkgdevoff] && ![dict exists $_cgi pkgdev]} {
|
||||
set _cgi(pkgdev) 0
|
||||
}
|
||||
handle_int_update pkgdev $pkgdev "Development Package Display"
|
||||
|
||||
header
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
puts {<script type="text/javascript" src="/js/jquery.form.js"></script>}
|
||||
|
||||
puts {
|
||||
<script type=text/javascript>
|
||||
$(document).ready(function () {
|
||||
$(":submit").button();
|
||||
$('form').each(function(i, el) {
|
||||
$('form.auto').each(function(i, el) {
|
||||
var id = $(this).attr('id');
|
||||
var output = '#' + id + '_output'
|
||||
$(this).ajaxForm({
|
||||
@@ -69,14 +81,26 @@ puts {
|
||||
}
|
||||
|
||||
puts "
|
||||
<h1>Settings</h1>
|
||||
<table class=keyval>
|
||||
<link href=/css/iphone-style-checkboxes.css rel=stylesheet type=text/css />
|
||||
<script type=\"text/javascript\" src=\"/js/iphone-style-checkboxes.js\">
|
||||
</script>
|
||||
<fieldset style=\"display: inline\">
|
||||
<legend>
|
||||
General Settings
|
||||
</legend>
|
||||
<table>
|
||||
"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form id=hostname method=get action=$env(REQUEST_URI)>
|
||||
<th>Hostname</th>
|
||||
<form class=auto id=hostname method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Hostname</th>
|
||||
<td><input name=hostname value=\"$hostname\"
|
||||
class=\"text ui-widget-content ui-corner-all\"
|
||||
length=20 maxlength=50>
|
||||
<small>
|
||||
<input id=hostname_submit value=\"change\" type=submit>
|
||||
</small>
|
||||
<div id=hostname_output></div>
|
||||
</td>
|
||||
</form>
|
||||
@@ -85,9 +109,10 @@ puts "
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form id=channel_group method=get action=$env(REQUEST_URI)>
|
||||
<th>Channel Group for EPG</th>
|
||||
<form class=auto id=channel_group method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Channel Group for EPG</th>
|
||||
<td><select id=channel_group name=channel_group
|
||||
class=\"text ui-widget-content ui-corner-all\"
|
||||
value=[$settings channel_group]>
|
||||
"
|
||||
|
||||
@@ -104,7 +129,9 @@ foreach grp [$settings channel_groups] {
|
||||
|
||||
puts "
|
||||
</select>
|
||||
<input name=channel_group value=\"change\" type=submit>
|
||||
<small>
|
||||
<input name=channel_group value=\"set\" type=submit>
|
||||
</small>
|
||||
<div id=channel_group_output></div>
|
||||
</td>
|
||||
</form>
|
||||
@@ -113,11 +140,63 @@ puts "
|
||||
|
||||
puts "
|
||||
</table>
|
||||
</form>
|
||||
<br>
|
||||
More coming soon...
|
||||
<br>
|
||||
<br>
|
||||
</fieldset>
|
||||
<br><br>
|
||||
<fieldset style=\"display: inline\">
|
||||
<legend> Email Settings </legend>
|
||||
<table>
|
||||
"
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form class=auto id=smtp_server method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>SMTP Server for outbound email</th>
|
||||
<td><input name=smtp_server value=\"$smtp_server\"
|
||||
class=\"text ui-widget-content ui-corner-all\"
|
||||
length=20 maxlength=50>
|
||||
<small>
|
||||
<input id=smtp_server_submit value=\"change\" type=submit>
|
||||
</small>
|
||||
<div id=smtp_server_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
"
|
||||
|
||||
puts "
|
||||
</table>
|
||||
</fieldset>
|
||||
<br><br>
|
||||
<fieldset style=\"display: inline\">
|
||||
<legend> Advanced Settings </legend>
|
||||
<table>
|
||||
"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<form class=auto id=pkgdev method=get action=$env(REQUEST_URI)>
|
||||
<th class=key>Show development and advanced packages?</th>
|
||||
<td><input name=pkgdevoff value=0 type=hidden>
|
||||
<input name=pkgdev id=pkgdev value=1 type=checkbox
|
||||
"
|
||||
if {$pkgdev} { puts " checked" }
|
||||
puts {
|
||||
>
|
||||
<small>
|
||||
<input id=pkgdev_submit value="save" type=submit>
|
||||
</small>
|
||||
<div id=pkgdev_output></div>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
}
|
||||
|
||||
puts "
|
||||
</table>
|
||||
</fieldset>
|
||||
"
|
||||
|
||||
eval_plugins settings
|
||||
|
||||
footer
|
||||
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
#puts "<img style=\"vertical-align: middle\" src=/images/745_1_11_Video_1REC.png><span style=\"vertical-align: middle\">Recording one thing</span>"
|
||||
#puts "<img style=\"vertical-align: middle\" src=/images/745_1_11_Video_1REC.png><span style=\"vertical-align: middle\">Recording another thing</span>"
|
||||
#puts "<img style=\"vertical-align: middle\" src=/images/745_1_10_Video_2Live.png><span style=\"vertical-align: middle\">Watching something else</span>"
|
||||
|
||||
if {[catch {set pid [exec pgrep humaxtv]}]} { exit }
|
||||
|
||||
if {[catch {set data [exec lsof -p $pid | grep Video | fgrep .ts]} ]} {
|
||||
@@ -43,9 +39,8 @@ foreach line $lines {
|
||||
|
||||
incr seen($name)
|
||||
|
||||
lappend output "<img style=\"vertical-align: middle\"
|
||||
src=/images/$icon><span
|
||||
style=\"vertical-align: middle\">$mode $name</span>"
|
||||
lappend output "<img class=va src=/images/$icon><span class=va>
|
||||
$mode $name</span><br>"
|
||||
}
|
||||
|
||||
if {[llength $output]} {
|
||||
|
||||
13
var/mongoose/cgi-bin/transmission.jim
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
set url "http://$env(HTTP_HOST):9091/"
|
||||
|
||||
puts "Content-Type: text/html
|
||||
Location: $url
|
||||
|
||||
<meta http-equiv=refresh content=\"0; url=$url\">
|
||||
|
||||
Transmission is available <a href=$url>here</a>
|
||||
|
||||
"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<!--#exec cmd="/mod/var/mongoose/include/db.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<!--#exec cmd="/mod/var/mongoose/include/backup.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
75
var/mongoose/html/css/iphone-style-checkboxes.css
Normal file
@@ -0,0 +1,75 @@
|
||||
.iPhoneCheckContainer {
|
||||
position: relative;
|
||||
height: 27px;
|
||||
cursor: pointer;
|
||||
overflow: hidden; }
|
||||
.iPhoneCheckContainer input {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 30px;
|
||||
opacity: 0;
|
||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); }
|
||||
.iPhoneCheckContainer label {
|
||||
white-space: nowrap;
|
||||
font-size: 17px;
|
||||
line-height: 17px;
|
||||
font-weight: bold;
|
||||
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 27px;
|
||||
position: absolute;
|
||||
width: auto;
|
||||
top: 0;
|
||||
padding-top: 5px;
|
||||
overflow: hidden; }
|
||||
.iPhoneCheckContainer, .iPhoneCheckContainer label {
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-khtml-user-select: none; }
|
||||
|
||||
.iPhoneCheckDisabled {
|
||||
opacity: 0.5;
|
||||
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); }
|
||||
|
||||
label.iPhoneCheckLabelOn {
|
||||
color: white;
|
||||
background: url('/img/iphone-style-checkboxes/on.png?1282083753') no-repeat;
|
||||
text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
|
||||
left: 0;
|
||||
padding-top: 5px; }
|
||||
label.iPhoneCheckLabelOn span {
|
||||
padding-left: 8px; }
|
||||
label.iPhoneCheckLabelOff {
|
||||
color: #8b8b8b;
|
||||
background: url('/img/iphone-style-checkboxes/off.png?1282083753') no-repeat right 0;
|
||||
text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6);
|
||||
text-align: right;
|
||||
right: 0; }
|
||||
label.iPhoneCheckLabelOff span {
|
||||
padding-right: 8px; }
|
||||
|
||||
.iPhoneCheckHandle {
|
||||
display: block;
|
||||
height: 27px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 0;
|
||||
background: url('/img/iphone-style-checkboxes/slider_left.png?1282083753') no-repeat;
|
||||
padding-left: 3px; }
|
||||
|
||||
.iPhoneCheckHandleRight {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding-right: 3px;
|
||||
background: url('/img/iphone-style-checkboxes/slider_right.png?1282083753') no-repeat right 0; }
|
||||
|
||||
.iPhoneCheckHandleCenter {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: url('/img/iphone-style-checkboxes/slider_center.png?1282083753'); }
|
||||
@@ -1,62 +1,62 @@
|
||||
/* Generic context menu styles */
|
||||
.contextMenu {
|
||||
position: absolute;
|
||||
width: 120px;
|
||||
z-index: 99999;
|
||||
border: solid 1px #CCC;
|
||||
background: #EEE;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.contextMenu LI {
|
||||
list-style: none;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.contextMenu A {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
background-position: 6px center;
|
||||
background-repeat: no-repeat;
|
||||
outline: none;
|
||||
padding: 1px 5px;
|
||||
padding-left: 28px;
|
||||
}
|
||||
|
||||
.contextMenu LI.hover A {
|
||||
color: #FFF;
|
||||
background-color: #3399FF;
|
||||
}
|
||||
|
||||
.contextMenu LI.disabled A {
|
||||
color: #AAA;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.contextMenu LI.hover.disabled A {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.contextMenu LI.separator {
|
||||
border-top: solid 1px #CCC;
|
||||
}
|
||||
|
||||
/*
|
||||
Adding Icons
|
||||
|
||||
You can add icons to the context menu by adding
|
||||
classes to the respective LI element(s)
|
||||
*/
|
||||
|
||||
.contextMenu LI.edit A { background-image: url(images/page_white_edit.png); }
|
||||
.contextMenu LI.cut A { background-image: url(images/cut.png); }
|
||||
.contextMenu LI.copy A { background-image: url(images/page_white_copy.png); }
|
||||
.contextMenu LI.paste A { background-image: url(images/page_white_paste.png); }
|
||||
.contextMenu LI.delete A { background-image: url(images/page_white_delete.png); }
|
||||
.contextMenu LI.quit A { background-image: url(images/door.png); }
|
||||
/* Generic context menu styles */
|
||||
.contextMenu {
|
||||
position: absolute;
|
||||
width: 150px;
|
||||
z-index: 99999;
|
||||
border: solid 1px #CCC;
|
||||
background: #EEE;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.contextMenu LI {
|
||||
list-style: none;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.contextMenu A {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
background-position: 6px center;
|
||||
background-repeat: no-repeat;
|
||||
outline: none;
|
||||
padding: 1px 5px;
|
||||
padding-left: 28px;
|
||||
}
|
||||
|
||||
.contextMenu LI.hover A {
|
||||
color: #FFF;
|
||||
background-color: #3399FF;
|
||||
}
|
||||
|
||||
.contextMenu LI.disabled A {
|
||||
color: #AAA;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.contextMenu LI.hover.disabled A {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.contextMenu LI.separator {
|
||||
border-top: solid 1px #CCC;
|
||||
}
|
||||
|
||||
/*
|
||||
Adding Icons
|
||||
|
||||
You can add icons to the context menu by adding
|
||||
classes to the respective LI element(s)
|
||||
*/
|
||||
|
||||
.contextMenu LI.edit A { background-image: url(images/page_white_edit.png); }
|
||||
.contextMenu LI.cut A { background-image: url(images/cut.png); }
|
||||
.contextMenu LI.copy A { background-image: url(images/page_white_copy.png); }
|
||||
.contextMenu LI.paste A { background-image: url(images/page_white_paste.png); }
|
||||
.contextMenu LI.delete A { background-image: url(images/page_white_delete.png); }
|
||||
.contextMenu LI.quit A { background-image: url(images/door.png); }
|
||||
|
||||
31
var/mongoose/html/css/jquery.progressbar.css
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
/* progress bar container */
|
||||
#progressbar{
|
||||
border:1px solid black;
|
||||
width:200px;
|
||||
height:20px;
|
||||
position:relative;
|
||||
color:black;
|
||||
}
|
||||
/* color bar */
|
||||
#progressbar div.progress{
|
||||
position:absolute;
|
||||
width:0;
|
||||
height:100%;
|
||||
overflow:hidden;
|
||||
background-color:#369;
|
||||
}
|
||||
/* text on bar */
|
||||
#progressbar div.progress .text{
|
||||
position:absolute;
|
||||
text-align:center;
|
||||
color:white;
|
||||
}
|
||||
/* text off bar */
|
||||
#progressbar div.text{
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,13 @@ div.footer
|
||||
padding-top: 2em;
|
||||
}
|
||||
|
||||
div.warningbox
|
||||
{
|
||||
background: url('/img/redshade.png') repeat-x;
|
||||
padding: 0.5em;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
table
|
||||
{
|
||||
empty-cells: show;
|
||||
@@ -63,13 +70,13 @@ table.borders, table.borders td, table.borders th
|
||||
empty-cells: show;
|
||||
}
|
||||
|
||||
table tr.odd
|
||||
table tr.odd, table td.odd, table th.odd
|
||||
{
|
||||
background: #ccff99;
|
||||
color: black;
|
||||
}
|
||||
|
||||
table tr.even
|
||||
table tr.even, table td.even, table th.even
|
||||
{
|
||||
background: #ffffcc;
|
||||
color: black;
|
||||
@@ -86,7 +93,7 @@ table th
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.keyval th
|
||||
table.keyval th, th.key
|
||||
{
|
||||
background: #ccff99;
|
||||
font-weight: bold;
|
||||
@@ -101,7 +108,7 @@ table.keyval td
|
||||
color: black;
|
||||
}
|
||||
|
||||
pre
|
||||
pre, .pre
|
||||
{
|
||||
font-family: Consolas, 'Courier New', Courier, monospace;
|
||||
color: black;
|
||||
@@ -174,6 +181,12 @@ pre
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.filesize
|
||||
{
|
||||
color: #6a6aff;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.footnote
|
||||
{
|
||||
color: #ff4000;
|
||||
@@ -225,3 +238,23 @@ img.progress
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.block
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.hidden
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
input.text
|
||||
{
|
||||
padding: .4em;
|
||||
}
|
||||
|
||||
.highlight
|
||||
{
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
|
||||
21
var/mongoose/html/css/tsort.css
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
table.tablesorter .header {
|
||||
background-image: url(/img/tsort/bg.png);
|
||||
background-repeat: no-repeat;
|
||||
border-left: 1px solid #FFF;
|
||||
border-right: 1px solid #000;
|
||||
border-top: 1px solid #FFF;
|
||||
padding-left: 30px;
|
||||
padding-top: 8px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
table.tablesorter .headerSortUp {
|
||||
background-image: url(/img/tsort/asc.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
table.tablesorter .headerSortDown {
|
||||
background-image: url(/img/tsort/desc.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
30
var/mongoose/html/css/ui.totop.css
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
#toTop {
|
||||
background: url("/img//ui.totop.png") no-repeat scroll left top transparent;
|
||||
border: medium none;
|
||||
bottom: 110px;
|
||||
display: none;
|
||||
height: 51px;
|
||||
margin-left: 50px;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
text-decoration: none;
|
||||
text-indent: -999px;
|
||||
width: 77px;
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
#toTopHover {
|
||||
background: url("/img/ui.totop.png") no-repeat scroll left -51px transparent;
|
||||
display: block;
|
||||
float: left;
|
||||
height: 51px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
width: 77px;
|
||||
}
|
||||
|
||||
#toTop:active, #toTop:focus {
|
||||
outline: medium none;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<form method=get action=/cgi-bin/epg_search.jim>
|
||||
Search EPG: <input name=term size=20 maxlength=255>
|
||||
<input type=checkbox name=full>Search descriptions as well as titles.
|
||||
<input type=submit value=Search>
|
||||
</form>
|
||||
<!--#exec cmd="/mod/var/mongoose/include/epg.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
|
||||
BIN
var/mongoose/html/img/Folder_New.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
var/mongoose/html/img/Video_Other.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
var/mongoose/html/img/Video_Other_New.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
var/mongoose/html/img/Video_TS.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
var/mongoose/html/img/Video_TS_New.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
var/mongoose/html/img/add.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
1
var/mongoose/html/img/channels/1-2-1 Dating.png
Symbolic link
@@ -0,0 +1 @@
|
||||
blank.png
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.4 KiB |
BIN
var/mongoose/html/img/channels/5_.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
var/mongoose/html/img/channels/ADULT Babestn2.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
var/mongoose/html/img/channels/ADULT Blue.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
var/mongoose/html/img/channels/ADULT Filth.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 18 B After Width: | Height: | Size: 4.5 KiB |
BIN
var/mongoose/html/img/channels/ADULT redhotTV.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
1
var/mongoose/html/img/channels/CONNECT.png
Symbolic link
@@ -0,0 +1 @@
|
||||
blank.png
|
||||
BIN
var/mongoose/html/img/channels/Capital FM.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 6.7 KiB |
BIN
var/mongoose/html/img/channels/Really.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
1
var/mongoose/html/img/channels/STREAM.png
Symbolic link
@@ -0,0 +1 @@
|
||||
blank.png
|
||||
1
var/mongoose/html/img/channels/VISION.png
Symbolic link
@@ -0,0 +1 @@
|
||||
blank.png
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 6.0 KiB |
BIN
var/mongoose/html/img/channels/blank.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 6.8 KiB |
BIN
var/mongoose/html/img/close.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
var/mongoose/html/img/draghandle.jpg
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
var/mongoose/html/img/iphone-style-checkboxes/off.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
var/mongoose/html/img/iphone-style-checkboxes/on.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
var/mongoose/html/img/iphone-style-checkboxes/slider.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
var/mongoose/html/img/iphone-style-checkboxes/slider_center.png
Normal file
|
After Width: | Height: | Size: 260 B |
BIN
var/mongoose/html/img/iphone-style-checkboxes/slider_left.png
Normal file
|
After Width: | Height: | Size: 324 B |
BIN
var/mongoose/html/img/iphone-style-checkboxes/slider_right.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
var/mongoose/html/img/lightning.png
Normal file
|
After Width: | Height: | Size: 671 B |
BIN
var/mongoose/html/img/mediatomb.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
var/mongoose/html/img/more_hide.png
Normal file
|
After Width: | Height: | Size: 382 B |
BIN
var/mongoose/html/img/more_show.png
Normal file
|
After Width: | Height: | Size: 388 B |
BIN
var/mongoose/html/img/redshade.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
var/mongoose/html/img/stripes.gif
Normal file
|
After Width: | Height: | Size: 936 B |
BIN
var/mongoose/html/img/transmission.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
var/mongoose/html/img/tsort/asc.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
var/mongoose/html/img/tsort/bg.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
var/mongoose/html/img/tsort/desc.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
var/mongoose/html/img/ui.totop.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
@@ -19,6 +19,8 @@ $(document).ready(function() {
|
||||
});
|
||||
</script>
|
||||
|
||||
<div style="clear: both">
|
||||
|
||||
<div style="float: left">
|
||||
<center>
|
||||
<a href=/cgi-bin/browse.jim>
|
||||
@@ -39,7 +41,7 @@ $(document).ready(function() {
|
||||
</a>
|
||||
<br>
|
||||
<a href=/sched.shtml>
|
||||
<b>Scheduled Recordings</b>
|
||||
<b>Scheduled Events</b>
|
||||
</a>
|
||||
<br>
|
||||
</center>
|
||||
@@ -56,8 +58,11 @@ $(document).ready(function() {
|
||||
<br>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="float: left; clear: left">
|
||||
<div style="clear: both; padding-top: 1em">
|
||||
|
||||
<div style="float: left">
|
||||
<center>
|
||||
<a href=/services.shtml>
|
||||
<img src=/img/spanner.jpg border=0 width=217 height=228>
|
||||
@@ -72,11 +77,11 @@ $(document).ready(function() {
|
||||
|
||||
<div style="float: left">
|
||||
<center>
|
||||
<a href=/packages.shtml>
|
||||
<a href=/pkg.shtml>
|
||||
<img src=/img/packages.jpg border=0 width=217 height=228>
|
||||
</a>
|
||||
<br>
|
||||
<a href=/packages.shtml>
|
||||
<a href=/pkg.shtml>
|
||||
<b>Package Management</b>
|
||||
</a>
|
||||
<br>
|
||||
@@ -97,19 +102,25 @@ $(document).ready(function() {
|
||||
</center>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="clear: both">
|
||||
<!--#exec cmd="/mod/var/mongoose/include/mediatomb.jim" -->
|
||||
<!--#exec cmd="/mod/var/mongoose/include/transmission.jim" -->
|
||||
</div>
|
||||
<div class=footer>
|
||||
<ul>
|
||||
<li>
|
||||
<!--#exec cmd="/mod/var/mongoose/include/mediatomb.jim" -->
|
||||
MediaTomb Web Interface</a>
|
||||
<a href=/cgi-bin/channel.jim>Channel Information</a>
|
||||
</li><li>
|
||||
<a href=/db.shtml target=_blank>SQLite3 Database Dump</a>
|
||||
<a href=/cgi-bin/db.jim target=_blank>SQLite3 Database Dump</a>
|
||||
</li><li>
|
||||
<a href=/jim/ref.html target=_blank>Jim Reference Manual</a> |
|
||||
<a href=/jim/oo.html target=_blank>OO</a> |
|
||||
<a href=/jim/sqlite.html target=_blank>Sqlite</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!--#exec cmd="/mod/var/mongoose/include/modversion.jim" -->
|
||||
</div>
|
||||
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
142
var/mongoose/html/js/easing.js
Normal file
@@ -0,0 +1,142 @@
|
||||
|
||||
/*
|
||||
* jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
|
||||
*
|
||||
* Uses the built In easIng capabilities added In jQuery 1.1
|
||||
* to offer multiple easIng options
|
||||
*
|
||||
* Copyright (c) 2007 George Smith
|
||||
* Licensed under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
50
var/mongoose/html/js/iajax.js
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
jQuery.ajaxPrefilter(function(options, _, jqXHR) {
|
||||
|
||||
if (jQuery.isFunction(options.progress)) {
|
||||
|
||||
var xhrFactory = options.xhr,
|
||||
interval;
|
||||
|
||||
options.xhr = function() {
|
||||
|
||||
var xhr = xhrFactory.apply(this, arguments),
|
||||
partial = "",
|
||||
prevcount = 1;
|
||||
|
||||
interval = setInterval(function() {
|
||||
|
||||
var responseText,
|
||||
jQueryPartial;
|
||||
|
||||
try {
|
||||
|
||||
responseText = xhr.responseText;
|
||||
|
||||
if (responseText && (responseText.length > partial.length))
|
||||
{
|
||||
|
||||
partial = responseText;
|
||||
jQueryPartial = $(partial).filter("*")
|
||||
|
||||
if (jQueryPartial.length > prevcount) {
|
||||
prevcount = jQueryPartial.length;
|
||||
options.progress(jQueryPartial.filter("*:not(:last)"));
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
alert(e);
|
||||
}
|
||||
}, options.progressInterval);
|
||||
|
||||
return xhr;
|
||||
};
|
||||
function stop()
|
||||
{
|
||||
if (interval)
|
||||
clearInterval(interval);
|
||||
}
|
||||
jqXHR.then(stop, stop);
|
||||
}
|
||||
});
|
||||
|
||||
229
var/mongoose/html/js/iphone-style-checkboxes.js
Normal file
@@ -0,0 +1,229 @@
|
||||
/*!
|
||||
// iPhone-style Checkboxes jQuery plugin
|
||||
// Copyright Thomas Reynolds, licensed GPL & MIT
|
||||
*/
|
||||
;(function($, iphoneStyle) {
|
||||
|
||||
// Constructor
|
||||
$[iphoneStyle] = function(elem, options) {
|
||||
this.$elem = $(elem);
|
||||
|
||||
// Import options into instance variables
|
||||
var obj = this;
|
||||
$.each(options, function(key, value) {
|
||||
obj[key] = value;
|
||||
});
|
||||
|
||||
// Initialize the control
|
||||
this.wrapCheckboxWithDivs();
|
||||
this.attachEvents();
|
||||
this.disableTextSelection();
|
||||
|
||||
if (this.resizeHandle) { this.optionallyResize('handle'); }
|
||||
if (this.resizeContainer) { this.optionallyResize('container'); }
|
||||
|
||||
this.initialPosition();
|
||||
};
|
||||
|
||||
$.extend($[iphoneStyle].prototype, {
|
||||
// Wrap the existing input[type=checkbox] with divs for styling and grab DOM references to the created nodes
|
||||
wrapCheckboxWithDivs: function() {
|
||||
this.$elem.wrap('<div class="' + this.containerClass + '" />');
|
||||
this.container = this.$elem.parent();
|
||||
|
||||
this.offLabel = $('<label class="'+ this.labelOffClass +'">' +
|
||||
'<span>'+ this.uncheckedLabel +'</span>' +
|
||||
'</label>').appendTo(this.container);
|
||||
this.offSpan = this.offLabel.children('span');
|
||||
|
||||
this.onLabel = $('<label class="'+ this.labelOnClass +'">' +
|
||||
'<span>'+ this.checkedLabel +'</span>' +
|
||||
'</label>').appendTo(this.container);
|
||||
this.onSpan = this.onLabel.children('span');
|
||||
|
||||
this.handle = $('<div class="' + this.handleClass + '">' +
|
||||
'<div class="' + this.handleRightClass + '">' +
|
||||
'<div class="' + this.handleCenterClass + '" />' +
|
||||
'</div>' +
|
||||
'</div>').appendTo(this.container);
|
||||
},
|
||||
|
||||
// Disable IE text selection, other browsers are handled in CSS
|
||||
disableTextSelection: function() {
|
||||
if (!$.browser.msie) { return; }
|
||||
|
||||
// Elements containing text should be unselectable
|
||||
$.each([this.handle, this.offLabel, this.onLabel, this.container], function() {
|
||||
$(this).attr("unselectable", "on");
|
||||
});
|
||||
},
|
||||
|
||||
// Automatically resize the handle or container
|
||||
optionallyResize: function(mode) {
|
||||
var onLabelWidth = this.onLabel.width(),
|
||||
offLabelWidth = this.offLabel.width();
|
||||
|
||||
if (mode == 'container') {
|
||||
var newWidth = (onLabelWidth > offLabelWidth) ? onLabelWidth : offLabelWidth;
|
||||
newWidth += this.handle.width() + 15;
|
||||
} else {
|
||||
var newWidth = (onLabelWidth < offLabelWidth) ? onLabelWidth : offLabelWidth;
|
||||
}
|
||||
|
||||
this[mode].css({ width: newWidth });
|
||||
},
|
||||
|
||||
attachEvents: function() {
|
||||
var obj = this;
|
||||
|
||||
// A mousedown anywhere in the control will start tracking for dragging
|
||||
this.container
|
||||
.bind('mousedown touchstart', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (obj.$elem.is(':disabled')) { return; }
|
||||
|
||||
var x = event.pageX || event.originalEvent.changedTouches[0].pageX;
|
||||
$[iphoneStyle].currentlyClicking = obj.handle;
|
||||
$[iphoneStyle].dragStartPosition = x;
|
||||
$[iphoneStyle].handleLeftOffset = parseInt(obj.handle.css('left'), 10) || 0;
|
||||
$[iphoneStyle].dragStartedOn = obj.$elem;
|
||||
})
|
||||
|
||||
// Utilize event bubbling to handle drag on any element beneath the container
|
||||
.bind('iPhoneDrag', function(event, x) {
|
||||
event.preventDefault();
|
||||
|
||||
if (obj.$elem.is(':disabled')) { return; }
|
||||
if (obj.$elem != $[iphoneStyle].dragStartedOn) { return; }
|
||||
|
||||
var p = (x + $[iphoneStyle].handleLeftOffset - $[iphoneStyle].dragStartPosition) / obj.rightSide;
|
||||
if (p < 0) { p = 0; }
|
||||
if (p > 1) { p = 1; }
|
||||
obj.handle.css({ left: p * obj.rightSide });
|
||||
obj.onLabel.css({ width: p * obj.rightSide + 4 });
|
||||
obj.offSpan.css({ marginRight: -p * obj.rightSide });
|
||||
obj.onSpan.css({ marginLeft: -(1 - p) * obj.rightSide });
|
||||
})
|
||||
|
||||
// Utilize event bubbling to handle drag end on any element beneath the container
|
||||
.bind('iPhoneDragEnd', function(event, x) {
|
||||
if (obj.$elem.is(':disabled')) { return; }
|
||||
|
||||
var checked;
|
||||
if ($[iphoneStyle].dragging) {
|
||||
var p = (x - $[iphoneStyle].dragStartPosition) / obj.rightSide;
|
||||
checked = (p < 0) ? Math.abs(p) < 0.5 : p >= 0.5;
|
||||
} else {
|
||||
checked = !obj.$elem.attr('checked');
|
||||
}
|
||||
|
||||
obj.$elem.attr('checked', checked);
|
||||
|
||||
$[iphoneStyle].currentlyClicking = null;
|
||||
$[iphoneStyle].dragging = null;
|
||||
obj.$elem.change();
|
||||
});
|
||||
|
||||
// Animate when we get a change event
|
||||
this.$elem.change(function() {
|
||||
if (obj.$elem.is(':disabled')) {
|
||||
obj.container.addClass(obj.disabledClass);
|
||||
return false;
|
||||
} else {
|
||||
obj.container.removeClass(obj.disabledClass);
|
||||
}
|
||||
|
||||
var new_left = obj.$elem.attr('checked') ? obj.rightSide : 0;
|
||||
|
||||
obj.handle.animate({ left: new_left }, obj.duration);
|
||||
obj.onLabel.animate({ width: new_left + 4 }, obj.duration);
|
||||
obj.offSpan.animate({ marginRight: -new_left }, obj.duration);
|
||||
obj.onSpan.animate({ marginLeft: new_left - obj.rightSide }, obj.duration);
|
||||
});
|
||||
},
|
||||
|
||||
// Setup the control's inital position
|
||||
initialPosition: function() {
|
||||
this.offLabel.css({ width: this.container.width() - 5 });
|
||||
|
||||
var offset = ($.browser.msie && $.browser.version < 7) ? 3 : 6;
|
||||
this.rightSide = this.container.width() - this.handle.width() - offset;
|
||||
|
||||
if (this.$elem.is(':checked')) {
|
||||
this.handle.css({ left: this.rightSide });
|
||||
this.onLabel.css({ width: this.rightSide + 4 });
|
||||
this.offSpan.css({ marginRight: -this.rightSide });
|
||||
} else {
|
||||
this.onLabel.css({ width: 0 });
|
||||
this.onSpan.css({ marginLeft: -this.rightSide });
|
||||
}
|
||||
|
||||
if (this.$elem.is(':disabled')) {
|
||||
this.container.addClass(this.disabledClass);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// jQuery-specific code
|
||||
$.fn[iphoneStyle] = function(options) {
|
||||
var checkboxes = this.filter(':checkbox');
|
||||
|
||||
// Fail early if we don't have any checkboxes passed in
|
||||
if (!checkboxes.length) { return this; }
|
||||
|
||||
// Merge options passed in with global defaults
|
||||
var opt = $.extend({}, $[iphoneStyle].defaults, options);
|
||||
|
||||
checkboxes.each(function() {
|
||||
$(this).data(iphoneStyle, new $[iphoneStyle](this, opt));
|
||||
});
|
||||
|
||||
if (!$[iphoneStyle].initComplete) {
|
||||
// As the mouse moves on the page, animate if we are in a drag state
|
||||
$(document)
|
||||
.bind('mousemove touchmove', function(event) {
|
||||
if (!$[iphoneStyle].currentlyClicking) { return; }
|
||||
event.preventDefault();
|
||||
|
||||
var x = event.pageX || event.originalEvent.changedTouches[0].pageX;
|
||||
if (!$[iphoneStyle].dragging &&
|
||||
(Math.abs($[iphoneStyle].dragStartPosition - x) > opt.dragThreshold)) {
|
||||
$[iphoneStyle].dragging = true;
|
||||
}
|
||||
|
||||
$(event.target).trigger('iPhoneDrag', [x]);
|
||||
})
|
||||
|
||||
// When the mouse comes up, leave drag state
|
||||
.bind('mouseup touchend', function(event) {
|
||||
if (!$[iphoneStyle].currentlyClicking) { return; }
|
||||
event.preventDefault();
|
||||
|
||||
var x = event.pageX || event.originalEvent.changedTouches[0].pageX;
|
||||
$($[iphoneStyle].currentlyClicking).trigger('iPhoneDragEnd', [x]);
|
||||
});
|
||||
|
||||
$[iphoneStyle].initComplete = true;
|
||||
}
|
||||
|
||||
return this;
|
||||
}; // End of $.fn[iphoneStyle]
|
||||
|
||||
$[iphoneStyle].defaults = {
|
||||
duration: 200, // Time spent during slide animation
|
||||
checkedLabel: 'ON', // Text content of "on" state
|
||||
uncheckedLabel: 'OFF', // Text content of "off" state
|
||||
resizeHandle: true, // Automatically resize the handle to cover either label
|
||||
resizeContainer: true, // Automatically resize the widget to contain the labels
|
||||
disabledClass: 'iPhoneCheckDisabled',
|
||||
containerClass: 'iPhoneCheckContainer',
|
||||
labelOnClass: 'iPhoneCheckLabelOn',
|
||||
labelOffClass: 'iPhoneCheckLabelOff',
|
||||
handleClass: 'iPhoneCheckHandle',
|
||||
handleCenterClass: 'iPhoneCheckHandleCenter',
|
||||
handleRightClass: 'iPhoneCheckHandleRight',
|
||||
dragThreshold: 5 // Pixels that must be dragged for a click to be ignored
|
||||
};
|
||||
|
||||
})(jQuery, 'iphoneStyle');
|
||||
@@ -13,8 +13,9 @@
|
||||
// (C)2008 by Cory S.N. LaViska.
|
||||
//
|
||||
// For details, visit http://creativecommons.org/licenses/by/3.0/us/
|
||||
//
|
||||
// Modified 11NOV08 By Bill Beckelman to include option to use left mouse button instead.
|
||||
|
||||
// Modified by Andy Fiddaman to support left click and
|
||||
// support modification of menu items.
|
||||
|
||||
if (jQuery) (function() {
|
||||
$.extend($.fn, {
|
||||
@@ -25,6 +26,7 @@ if (jQuery) (function() {
|
||||
if (o.inSpeed == undefined) o.inSpeed = 150;
|
||||
if (o.outSpeed == undefined) o.outSpeed = 75;
|
||||
if (o.leftButton == undefined) o.leftButton = false;
|
||||
if (o.beforeShow == undefined) o.beforeShow = false;
|
||||
// 0 needs to be -1 for expected results (no fade)
|
||||
if (o.inSpeed == 0) o.inSpeed = -1;
|
||||
if (o.outSpeed == 0) o.outSpeed = -1;
|
||||
@@ -34,8 +36,8 @@ if (jQuery) (function() {
|
||||
var offset = $(el).offset();
|
||||
// Add contextMenu class
|
||||
$('#' + o.menu).addClass('contextMenu');
|
||||
if (o.leftButton) $(this).bind('click', false);
|
||||
// Simulate a true right click
|
||||
$(this).bind('click', false);
|
||||
$(this).mousedown(function(e) {
|
||||
var evt = e;
|
||||
$(this).mouseup(function(e) {
|
||||
@@ -49,6 +51,8 @@ if (jQuery) (function() {
|
||||
|
||||
if ($(el).hasClass('disabled')) return false;
|
||||
|
||||
if (o.beforeShow) o.beforeShow(el, menu);
|
||||
|
||||
// Detect mouse position
|
||||
var d = {}, x, y;
|
||||
if (self.innerHeight) {
|
||||
@@ -185,6 +189,15 @@ if (jQuery) (function() {
|
||||
return ($(this));
|
||||
},
|
||||
|
||||
// Change context menu text on the fly
|
||||
changeContextMenuItem: function(d, t) {
|
||||
if (d == undefined) return;
|
||||
$(this).each(function() {
|
||||
$(this).find('A[href="' + d + '"]').text(t);
|
||||
});
|
||||
return ($(this));
|
||||
},
|
||||
|
||||
// Disable context menu(s)
|
||||
disableContextMenu: function() {
|
||||
$(this).each(function() {
|
||||
|
||||
53
var/mongoose/html/js/jquery.highlight.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
|
||||
highlight v3
|
||||
|
||||
Highlights arbitrary terms.
|
||||
|
||||
<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>
|
||||
|
||||
MIT license.
|
||||
|
||||
Johann Burkard
|
||||
<http://johannburkard.de>
|
||||
<mailto:jb@eaio.com>
|
||||
|
||||
*/
|
||||
|
||||
jQuery.fn.highlight = function(pat) {
|
||||
function innerHighlight(node, pat) {
|
||||
var skip = 0;
|
||||
if (node.nodeType == 3) {
|
||||
var pos = node.data.toUpperCase().indexOf(pat);
|
||||
if (pos >= 0) {
|
||||
var spannode = document.createElement('span');
|
||||
spannode.className = 'highlight';
|
||||
var middlebit = node.splitText(pos);
|
||||
var endbit = middlebit.splitText(pat.length);
|
||||
var middleclone = middlebit.cloneNode(true);
|
||||
spannode.appendChild(middleclone);
|
||||
middlebit.parentNode.replaceChild(spannode, middlebit);
|
||||
skip = 1;
|
||||
}
|
||||
}
|
||||
else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
|
||||
for (var i = 0; i < node.childNodes.length; ++i) {
|
||||
i += innerHighlight(node.childNodes[i], pat);
|
||||
}
|
||||
}
|
||||
return skip;
|
||||
}
|
||||
return this.each(function() {
|
||||
innerHighlight(this, pat.toUpperCase());
|
||||
});
|
||||
};
|
||||
|
||||
jQuery.fn.removeHighlight = function() {
|
||||
return this.find("span.highlight").each(function() {
|
||||
this.parentNode.firstChild.nodeName;
|
||||
with (this.parentNode) {
|
||||
replaceChild(this.firstChild, this);
|
||||
normalize();
|
||||
}
|
||||
}).end();
|
||||
};
|
||||
54
var/mongoose/html/js/jquery.progressbar.js
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Josh Bush (digitalbush.com)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Progress Bar Plugin for jQuery
|
||||
* Version: Alpha 2
|
||||
* Release: 2007-02-26
|
||||
*/
|
||||
(function($) {
|
||||
//Main Method
|
||||
$.fn.reportprogress = function(val,maxVal) {
|
||||
var max=100;
|
||||
if(maxVal)
|
||||
max=maxVal;
|
||||
return this.each(
|
||||
function(){
|
||||
var div=$(this);
|
||||
var innerdiv=div.find(".progress");
|
||||
|
||||
if(innerdiv.length!=1){
|
||||
innerdiv=$("<div class='progress'></div>");
|
||||
div.append("<div class='text'> </div>");
|
||||
$("<span class='text'> </span>").css("width",div.width()).appendTo(innerdiv);
|
||||
div.append(innerdiv);
|
||||
}
|
||||
var width=Math.round(val/max*100);
|
||||
innerdiv.css("width",width+"%");
|
||||
div.find(".text").html(width+" %");
|
||||
}
|
||||
);
|
||||
};
|
||||
})(jQuery);
|
||||
4
var/mongoose/html/js/jquery.tablesorter.js
Normal file
60
var/mongoose/html/js/jquery.ui.totop.js
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| UItoTop jQuery Plugin 1.1
|
||||
| http://www.mattvarone.com/web-design/uitotop-jquery-plugin/
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
(function($){
|
||||
$.fn.UItoTop = function(options) {
|
||||
|
||||
var defaults = {
|
||||
text: 'To Top',
|
||||
min: 400,
|
||||
|
||||
inDelay:600,
|
||||
outDelay:300,
|
||||
containerID: 'toTop',
|
||||
containerHoverID: 'toTopHover',
|
||||
scrollSpeed: 1000,
|
||||
easingType: 'linear'
|
||||
};
|
||||
|
||||
var settings = $.extend(defaults, options);
|
||||
var containerIDhash = '#' + settings.containerID;
|
||||
var containerHoverIDHash = '#'+settings.containerHoverID;
|
||||
|
||||
$('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');
|
||||
$(containerIDhash).hide().click(function(){
|
||||
$('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
|
||||
$('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType);
|
||||
return false;
|
||||
})
|
||||
.prepend('<span id="'+settings.containerHoverID+'"></span>')
|
||||
.hover(function() {
|
||||
$(containerHoverIDHash, this).stop().animate({
|
||||
'opacity': 1
|
||||
}, 300, 'linear');
|
||||
}, function() {
|
||||
$(containerHoverIDHash, this).stop().animate({
|
||||
'opacity': 0
|
||||
}, 600, 'linear');
|
||||
});
|
||||
|
||||
$(window).scroll(function() {
|
||||
var sd = $(window).scrollTop();
|
||||
if(typeof document.body.style.maxHeight === "undefined") {
|
||||
$(containerIDhash).css({
|
||||
'position': 'absolute',
|
||||
'left': 20,
|
||||
'top': $(window).scrollTop() + $(window).height() - 50
|
||||
});
|
||||
}
|
||||
if ( sd > settings.min )
|
||||
$(containerIDhash).fadeIn(settings.inDelay);
|
||||
else
|
||||
$(containerIDhash).fadeOut(settings.Outdelay);
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -16,6 +16,9 @@ puts {
|
||||
}
|
||||
|
||||
source /mod/var/mongoose/html/lib/topbar.jim
|
||||
puts "<div id=restart_block>"
|
||||
source /mod/var/mongoose/include/restart.jim
|
||||
puts "</div>"
|
||||
|
||||
puts {
|
||||
<div style="clear: both">
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title><!--#exec cmd="/mod/var/mongoose/include/model.jim" --></title>
|
||||
<meta http-equiv="expires" value="Thu, 01 Jan 1970 00:00:00 GMT" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<link rel="shortcut icon" href=/img/favicon.ico />
|
||||
<link href=/css/style.css rel=stylesheet type=text/css />
|
||||
<link type="text/css" href="/css/jquery-ui.css" rel="Stylesheet" />
|
||||
@@ -10,6 +12,9 @@
|
||||
<body>
|
||||
|
||||
<!--#include virtual="/lib/topbar.shtml" -->
|
||||
<div id=restart_block>
|
||||
<!--#exec cmd="/mod/var/mongoose/include/restart.jim" -->
|
||||
</div>
|
||||
|
||||
<div style="clear: both">
|
||||
|
||||
|
||||
@@ -4,17 +4,18 @@ puts {
|
||||
<div class=container onclick="location.href='/'; return false;">
|
||||
<div class=left><img src=/images/154_1_00_WIN_MD116_1L.png></div>
|
||||
<div class=middle>
|
||||
<img border=0 src=/images/516_1_26_Freeview_Logo.png>
|
||||
<span style="font-size: 150%; padding: 0 0 0 2em;">
|
||||
}
|
||||
source /mod/var/mongoose/include/model.jim
|
||||
puts {
|
||||
</span>
|
||||
<!-- Start include diskspace -->
|
||||
<!-- Start include diskspace - above other items to work around IE feature.. -->
|
||||
}
|
||||
source /mod/var/mongoose/include/diskspace.jim
|
||||
puts {
|
||||
<!-- End include diskspace -->
|
||||
<img border=0 src=/images/516_1_26_Freeview_Logo.png>
|
||||
<span style="display: inline; font-size: 150%;
|
||||
padding: 0 0 0 2em;">
|
||||
}
|
||||
source /mod/var/mongoose/include/model.jim
|
||||
puts {
|
||||
</span>
|
||||
</div>
|
||||
<div class=right><img src=/images/154_1_00_WIN_MD116_3R.png></div>
|
||||
</div>
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<div class=container onclick="location.href='/'; return false;">
|
||||
<div class=left><img src=/images/154_1_00_WIN_MD116_1L.png></div>
|
||||
<div class=middle>
|
||||
<img border=0 src=/images/516_1_26_Freeview_Logo.png>
|
||||
<span style="font-size: 150%; padding: 0 0 0 2em;">
|
||||
<!--#exec cmd="/mod/var/mongoose/include/model.jim" -->
|
||||
</span>
|
||||
<!-- Start include diskspace -->
|
||||
<!-- Start include diskspace - above other items to work around IE feature.. -->
|
||||
<!--#exec cmd="/mod/var/mongoose/include/diskspace.jim" -->
|
||||
<!-- End include diskspace -->
|
||||
<img border=0 src=/images/516_1_26_Freeview_Logo.png>
|
||||
<span style="font-size: 1.5em; padding: 0 0 0 2em;">
|
||||
<!--#exec cmd="/mod/var/mongoose/include/model.jim" -->
|
||||
</span>
|
||||
</div>
|
||||
<div class=right><img src=/images/154_1_00_WIN_MD116_3R.png></div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
|
||||
<h1>Package Management</h1>
|
||||
<div id=results class=shadowbox style="width: 90%; display: none; margin: 1 0 1em 0">
|
||||
<div>
|
||||
<pre id=result_txt>
|
||||
Results...
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--#exec cmd="/mod/var/mongoose/include/packages.jim" -->
|
||||
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||