Compare commits

..

1 Commits

Author SHA1 Message Date
hummypkg
5251d71b99 tag
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/tags/0.13.3@1517 2a923420-c742-0410-a762-8d5b09965624
2013-04-03 22:45:45 +00:00
915 changed files with 5895 additions and 13434 deletions

View File

@@ -1,6 +0,0 @@
webif/html/css/EXTRA.css
webif/html/favicon.ico
webif/html/img/fav/57.png
webif/html/img/fav/72.png
webif/html/img/fav/114.png
webif/html/img/fav/144.png

View File

@@ -1,10 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 1.2.1
Version: 0.13.3
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.14),lighttpd(>=1.4.35-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=2.0.3),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,mongoose,recmon(>=2.0.2)
Suggests:
Depends: webif-channelicons(>=1.0.4-1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.10),hmt(>=1.1.13),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.05)
Suggests: ffmpeg
Description: An evolving web interface for the Humax.
Tags: http://hummy.tv/forum/threads/5866/

View File

@@ -1,37 +1,29 @@
#!/bin/sh
# Relocate any stray files in /mod/var/mongoose
if [ -d /mod/var/mongoose -a ! -h /mod/var/mongoose ]; then
(
cd /mod/var/mongoose
find . | cpio -pmud /mod/webif
cd /mod/var
rm -rf mongoose
ln -s ../webif mongoose
)
fi
echo "Postinstall $*"
export tmpf=/tmp/cronf.$$
# Add cron jobs
crontab=$PKG_ROOT/bin/crontab
if [ -x $crontab ]; then
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
cat $tmpf - << EOM | $crontab -
*/10 * * * * /mod/webif/lib/bin/auto >/dev/null 2>&1
EOM
fi
crond=$PKG_ROOT/var/spool/cron/crontabs
[ -d $crond ] || exit 1
cronf=$crond/root
grep -v webif/lib/bin/auto $cronf > $tmpf
(
cat $tmpf
echo '*/10 * * * * /mod/webif/lib/bin/auto >/dev/null 2>&1'
) > $cronf
# Add anacron jobs
ana=$PKG_ROOT/etc/anacrontab
egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf
cat $tmpf - << EOM > $ana
1 8 sched_backup /mod/webif/html/backup/backup.jim
1 5 diskattrs /mod/webif/lib/bin/diskattrs
EOM
grep -v 'backup/backup.jim' $ana > $tmpf
(
cat $tmpf
echo "1 8 sched_backup /mod/var/mongoose/cgi-bin/backup/backup.jim"
) > $ana
$PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &
@@ -46,15 +38,5 @@ if [ ! -f /mod/webif/.strip-updated ]; then
touch /mod/webif/.strip-updated
fi
/mod/webif/lib/bin/diskattrs
#/mod/webif/lib/bin/resetnew
# Remove hook script placed by the legacy rt3070 package which does not work
# with CFW >= 3.00
hook=/mod/boot/xinit.d/rt3070
[ -f $hook ] && rm -f $hook
[ -f $tmpf ] && rm -f $tmpf
exit 0

View File

@@ -1,16 +0,0 @@
#!/bin/sh
# Handle moving the legacy /var/mongoose directory to /webif..
if [ -h /mod/webif -a -d /mod/var/mongoose -a ! -h /mod/var/mongoose ]; then
echo "Relocating web interface files..."
cd /mod
rm webif || exit 1
mv var/mongoose webif || exit 1
cd var
ln -s ../webif mongoose
fi
exit 0

View File

@@ -2,17 +2,16 @@
export tmpf=/tmp/cronf.$$
crontab=$PKG_ROOT/bin/crontab
if [ -x $crontab ]; then
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
cronf=$PKG_ROOT/var/spool/cron/crontabs/root
if [ -f $cronf ]; then
grep -v webif/lib/bin/auto $cronf > $tmpf
cp $tmpf $cronf
[ -s $cronf ] || rm -f $cronf
fi
ana=/mod/etc/anacrontab
egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf
grep -v 'backup/backup.jim' $ana > $tmpf
cp $tmpf $ana
[ -f $tmpf ] && rm -f $tmpf
exit 0

View File

@@ -1,21 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class
set modver [system modversion]
set modbuild [system modbuild]
if {$modbuild > 0} {
append modver " (build $modbuild)"
}
catch {set fhtcpversion [system fhtcpversion]}
catch {set kernelver [system kernelver]}
puts "
Humax [system model] Fox T2 ([system hostname])
Humax Version: $fhtcpversion (kernel $kernelver)
Custom firmware version: $modver
Web interface version: [system pkgver webif]
Serial Number: [system serialno]
"

View File

@@ -1,24 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require ts.class system.class
set file [lindex $argv 0]
set ts [ts fetch "$file.ts"]
set root [system mediaroot]
set dir [file dirname $file]
if {[string match "$root*" $dir]} {
set dir [string range $dir $([string length $root] + 1) end]
}
set ch [$ts get channel_name]
set dur [$ts duration]
set title [$ts get title]
set msg "Recorded: $dir/$title ($dur minutes - $ch)"
set logfd [open "/mod/tmp/record.log" "a+"]
puts $logfd "[\
clock format [clock seconds] -format "%d/%m/%Y %H:%M"\
] - $msg"
$logfd close

View File

@@ -1 +0,0 @@
../webif

View File

@@ -0,0 +1,83 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require rsv.class
set dir /mod/var/backup
httpheader
set now [clock seconds]
set file [file tail [cgi_get file \
[clock format $now -format "auto-%Y-%b-%d-%H:%M"]]]
if {[string match {auto-*} $file]} {
# Delete any automatic backups over 7 days old.
set mt $(15 * 86400)
foreach af [glob -nocomplain "$dir/auto-*"] {
set aft [file mtime $af]
set diff $($now - $aft)
if {$diff > $mt} {
puts "Removing $af"
file delete $af
}
}
}
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,
favIdx
from TBL_FAV join TBL_SVC using (hSvc)
order by eFavGroup, favIdx
}] {
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)\t$res(favIdx)"
}
puts "Done."
close $fd
rsv cleanup

View File

@@ -1,7 +1,7 @@
function refresh_files()
{
$('#backup_files').load('files.jim', function() {
$('#backup_files').load('/cgi-bin/backup/files.jim', function() {
$('input.restore').change(function() {
$('#restore_button').removeAttr('disabled')
.button('option', 'disabled', false);
@@ -20,7 +20,7 @@ $(document).ready(function() {
$('#backup_button').click(function() {
$('#backup_working').slideDown();
$('#results').load('backup.jim?' +
$('#results').load('/cgi-bin/backup/backup.jim?' +
$('#backup_name').serialize(), function() {
$('#results').slideDown(function() {
$('#backup_working').slideUp();
@@ -32,7 +32,7 @@ $(document).ready(function() {
var backup = $('input.restore:checked').val();
if (confirm('Confirm deletion of ' + backup))
{
$('#results').load('delete.jim?' +
$('#results').load('/cgi-bin/backup/delete.jim?' +
$('input.restore').serialize(), function() {
$('#results').slideDown(function() {
refresh_files();
@@ -42,7 +42,7 @@ $(document).ready(function() {
});
$('#view_button').click(function() {
var backup = $('input.restore:checked').val();
$('#results').load('view.jim?' +
$('#results').load('/cgi-bin/backup/view.jim?' +
$('input.restore').serialize(), function() {
$('#results').slideDown(function() {
refresh_files();
@@ -54,7 +54,7 @@ $(document).ready(function() {
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('restore.jim?' +
$('#results').load('/cgi-bin/backup/restore.jim?' +
$('input.restore').serialize(), function() {
$('#results').slideDown(function() {
$('#restore_working').slideUp();

View File

@@ -0,0 +1,135 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require rsv.class findhsvc system.class
set dir /mod/var/backup
httpheader
set file [file tail [cgi_get restore_file]]
if {$file == 0} {
puts "No filename supplied."
exit
}
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]
}
# Don't restore DSO events.
if {$vars(ersvtype) == 11} { continue }
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}
$rsvdb query {drop table if exists pending.fav}
$rsvdb query {create table pending.fav (
favIdx integer primary key autoincrement unique,
hSvc integer(4),
eFavGroup integer(4),
[eSvcType] integer(4)
)}
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 idx [lindex $vals 4]
if {$idx eq ""} { set idx 0 }
set hsvc [get_channel_attr $chan]
if {$grp != $group} {
set grp $group
puts " Group $grp"
}
puts " $chan"
if {$hsvc eq ""} {
puts " Cannot map channel name to service."
continue
}
set query "
insert into pending.fav(favIdx, hSvc, eFavGroup, eSvcType)
values($idx, $hsvc, $group, $type);
"
$rsvdb query $query
}
$rsvdb query {commit transaction;}
system restartpending
close $fd
rsv cleanup

View File

@@ -33,19 +33,13 @@ set fields [lsort [[rsv] vars]]
set data [split [read $fd] "\n"]
set ver 1
foreach line $data {
if {[string match "# version *" $line]} {
set ver [lindex [split $line " "] 2]
puts "Backup version $ver"
}
set vals [split $line "\t"]
if {[lindex $vals 0] ne "event"} { continue }
set vars {}
set i 0
foreach f $fields {
if {$ver < 2 && $f eq "aulEventToRecordInfo"} continue
if {$f eq "aulEventToRecordInfo"} { continue }
incr i
lappend vars $f [lindex $vals $i]
}

View File

@@ -2,7 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require system.class pretty_size
require system.class chunked pretty_size
cgi_input
#cgi_dump
@@ -10,14 +10,16 @@ cgi_input
set file [cgi_get file "-"]
if {$file eq "-"} { exit }
httpheader "text/plain"
start_chunked
if {![file exists $file]} {
puts ">>> File $file does not exist.\r\n"
chunk ">>> File $file does not exist.\r\n"
} else {
puts ">>> Contents of $file [pretty_size [file size $file]]\r\n"
chunk ">>> Contents of $file [pretty_size [file size $file]]\r\n"
set fp [open $file r]
puts [read $fp]
chunk [read $fp]
close $fp
}
end_chunked

View File

@@ -3,7 +3,7 @@
package require cgi
package require sqlite3
source /mod/webif/lib/setup
require altrow progressbar epg.class system.class
require altrow progressbar epg.class
header
@@ -29,29 +29,26 @@ puts "
<th>Signal Quality</th>
<th>Network</th>
<th>Mux</th>
<th>Type</th>
<th>Channels</th>
<th>&gt;799</th>
</tr>
"
foreach tw [$db query {
select tsIdx, szNetName, usTsID, ulFrequency, ucLevel,
ucQuality, eTransMode, eConstellation
select tsIdx, szNetName, usTsID, ulFrequency, ucLevel, ucQuality
from TBL_TS join TBL_NET using (netIdx)
order by ulFrequency
}] {
lassign $tw \
x tsIdx x netName x usTsID x ulFrequency x ucLevel x ucQuality \
x eTransMode x eConstellation
x tsIdx x netName x usTsID x ulFrequency x ucLevel x ucQuality
altrow
puts "
<tr class=odd>
<td>[f2c $ulFrequency]</td>
<td>[expr $ulFrequency / 1000.0] MHz</td>
"
puts "<td>[progressbar $ucLevel]</td>"
puts "<td>[progressbar $ucQuality]</td>"
puts "<td>[system strip $netName]</td>"
puts "<td>[string range $netName 3 end]</td>"
set channels [$db query {
select usLcn, szSvcName, szPrvName, aucDefaultAuthority
@@ -60,34 +57,24 @@ foreach tw [$db query {
order by usLcn
} $tsIdx]
if {$eConstellation == 1} {
set mux "Local"
} else {
set mux "Unknown"
}
set mux "Local"
set ehs 0
foreach chan $channels {
lassign $chan x lcn x name
set name [system strip $name]
set name [string range $name 1 end]
if {$lcn >= 800} { incr ehs }
switch $name {
"BBC THREE" { set mux "PSB1/BBC A" }
"BBC ONE" { set mux "PSB1/BBC A" }
"ITV1" { set mux "PSB2/D3&amp;4" }
"ITV" { set mux "PSB2/D3&amp;4" }
"BBC ONE HD" { set mux "PSB3/BBC B" }
"BBC One HD" { set mux "PSB3/BBC B (HD)" }
"ITV3" { set mux "COM4/SDN" }
"Dave" { set mux "COM5/ARQ A" }
"ITV4" { set mux "COM6/ARQ B" }
"BBC NEWS HD" { set mux "COM7/ARQ C" }
"Film4" { set mux "COM6/ARQ B" }
"Movies4Men" { set mux "Local" }
}
}
puts "<td>$mux</td>"
if {$eTransMode == 2} {
puts "<td>DVB-T (SD)</td>"
} else {
puts "<td class=blood>DVB-T2 (HD)</td>"
}
puts "<td>[llength $channels]
<a class=mchan ts=$tsIdx href=#>
@@ -95,29 +82,30 @@ foreach tw [$db query {
src=/images/421_1_00_CH_Title_2R_Arrow.png>
view
</a></td>"
puts "<td>$ehs</td>"
puts "<td>$ehs</th>"
puts "</tr>"
puts "<tr id=mchan_$tsIdx class=mchan style=\"display: none\">
<td colspan=9>"
<td colspan=5>"
puts "<table style=\"margin-left: 5em\">"
puts "<tr>
<th colspan=3>Channel</th>
<th>Provider</th>
<th>Authority</th>
</tr>"
altrow reset
foreach chan $channels {
lassign $chan x lcn x name x prv x auth
set name [system strip $name]
set prv [system strip $prv]
set name [string range $name 1 end]
set prv [string range $prv 3 end]
altrow
puts "
<td class=va>[epg channelicon $name 50]</td>
<td>$lcn</td><td>$name</td>
<td>$prv</td>
<td>$auth</td>
</tr>
"
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>"
@@ -144,5 +132,3 @@ $(document).ready(function() {
</script>
}
footer

View File

@@ -6,7 +6,6 @@ source /mod/webif/lib/setup
require altrow
set databases [glob /var/lib/humaxtv/*.db]
lappend databases {*}[glob /mod/etc/*.db]
lappend databases "/mnt/hd2/dms_cds.db"
header
@@ -62,8 +61,8 @@ proc db_info {db_file} {
if {$fdb == 0} {
puts "Please choose database to view:<ul>"
foreach db [lsort $databases] {
puts "<li><a href=$::env(SCRIPT_NAME)?db=[file tail $db]>
foreach db $databases {
puts "<li><a href=$::env(REQUEST_URI)?db=[file tail $db]>
$db</a></li>"
}
puts "</ul>"

9
var/mongoose/cgi-bin/env.jim Executable file
View File

@@ -0,0 +1,9 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
httpheader "text/plain"
foreach f [dict keys $env] {
puts "$f = $env($f)"
}

View File

@@ -13,7 +13,7 @@ set raw [cgi_get raw]
puts "<pre>"
if { $raw == 0 } {
puts [epg exec dump -raw 1 -service $service -event $event]
puts "<a href=$env(SCRIPT_NAME)?$env(QUERY_STRING)&raw=1>
puts "<a href=$env(REQUEST_URI)?$env(QUERY_STRING)&raw=1>
Click here for extended dump</a>"
} else {
puts [epg exec dumpraw -raw 1 -service $service -event $event]

View File

@@ -2,27 +2,18 @@
package require cgi
source /mod/webif/lib/setup
require epg.class system.class settings.class
set irinst [system pkginst ir]
require epg.class
httpheader
set service [cgi_get service 0]
set event [cgi_get event 0]
if {![cgi_exists bare]} header else noheader
if {![cgi_exists bare]} header
set record [lindex [epg fetch dump -service $service -event $event] 0]
$record get_channel_info
set others [$record othertimes]
if {[[settings] chanchangenc]} {
puts { <script type=text/javascript src=/js/chanchangenc.js></script> }
} else {
jqplugin confirmAction
puts { <script type=text/javascript src=/js/chanchange.js></script> }
}
puts "
<table class=keyval>
<tr>
@@ -72,16 +63,10 @@ puts "
"
if {[$record get warning] != ""} {
if {[$record get warning_mode]} {
set gcol red
} else {
set gcol blue
}
puts "
<tr>
<th>Warning</th>
<td><img class=va src=/img/Guidance_$gcol.png height=21>
[$record get warning]</td>
<td>[$record get warning]</td>
</tr>
"
}
@@ -131,14 +116,7 @@ if {[$record get rec_crid] != ""} {
puts "
<tr>
<td colspan=2 valign=top>
"
if {$irinst} {
puts "<a class=chanchange chan=[$record get channel_num] href=#>"
}
puts [$record channel_icon 70]
if {$irinst} { puts "</a>" }
puts "
[$record channel_icon 70]
[join [$record icon_set] "&nbsp;"]
</td>
</tr>

View File

@@ -4,11 +4,12 @@ package require cgi
source /mod/webif/lib/setup
require epg.class spinner.class altrow settings.class
jqplugin highlight
header
require totop
puts "<script type=text/javascript src=/js/jquery.highlight.js></script>"
set ct [cgi_get ct 0]
set crid [cgi_get crid ""]
set scrid [cgi_get scrid ""]
@@ -55,12 +56,6 @@ if {$ct > 0 } {
}
set favlist [epg favlist]
set s [settings]
if {[$s service_style] eq "standard"} {
set surl xservice
} else {
set surl service
}
if {[llength $records] > 0} {
puts {
@@ -70,7 +65,6 @@ if {[llength $records] > 0} {
<th colspan=3>Channel</th>
<th>Programme</th>
<th>Synopsis</th>
<th></th>
</tr>
}
} else {
@@ -89,10 +83,8 @@ proc rsort {v1 v2} {
set seen {}
set i 0
foreach record [lsort -command rsort $records] {
set ename [$record get name]
if {$ename eq ""} continue
if {$dedup} {
set ename [$record get name]
if {$ename in $seen} continue
lappend seen $ename
}
@@ -105,11 +97,7 @@ foreach record [lsort -command rsort $records] {
set ended [$record ended]
if {$ended} {
puts "<td nowrap class=blood>"
} else {
puts "<td nowrap>"
}
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"]"
@@ -117,7 +105,7 @@ foreach record [lsort -command rsort $records] {
puts "<td>[$record get channel_num]</td>"
puts "<td>[$record channel_icon 50]</td>"
puts "<td nowrap>
<a href=/epg/$surl.jim?service=[$record get service_id]>
<a href=/cgi-bin/epg/service.jim?service=[$record get service_id]>
[$record get channel_name]
</a></td>"
puts [$record cell]

View File

@@ -17,7 +17,7 @@ require totop
require epg_popup
set service [cgi_get service 4351]
set records [epg dbfetch dump -service $service]
set records [epg fetch dump -service $service]
set tr [lindex $records 0]
$tr get_channel_info
@@ -26,28 +26,14 @@ set channel_name [$tr get channel_name]
puts "
<div style=\"margin: 0 1em 1em 1em\">
<table class=va><tr><td class=va>
[$tr channel_icon 40 {vertical-align:middle}]
</td><td>
[$tr channel_icon 80 {vertical-align:middle}]
<span style=\"vertical-align: middle\">
$channel_num - $channel_name
</td><td style=\"width: 50px\">&nbsp;</td><td>
<button id=gridview>
Grid View
</button>
</td></tr></table>
</span>
</div>
"
puts "
<script type=text/javascript>
\$('button').button();
\$('#gridview').button().bind('click', function() {
document.location.href = '/epg/service.jim?service=$service';
});
</script>
"
puts {
<div id=list>
<table class=borders>
<tr>
<th></th>
@@ -55,35 +41,27 @@ puts {
<th>Time</th>
<th>Programme</th>
<th>Synopsis</th>
<th></th>
</tr>
}
set i 0
foreach record $records {
altrow
$record get_channel_info
#$record get_channel_info
set ended [$record ended]
if {[$record showing]} {
puts "<td><img src=/images/111_1_00_Cursor_2R_Arrow.png></td>"
} else { puts "<td></td>" }
if {$ended} {
puts "<td nowrap class=blood>"
} else {
puts "<td nowrap>"
}
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>"
}
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>"
}
puts "</table></div>"
puts "</table>"
epg cleanup
footer

39
var/mongoose/cgi-bin/opkg.jim Executable file
View File

@@ -0,0 +1,39 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require pkg.class chunked
cgi_input
#cgi_dump
set cmd [cgi_get cmd update]
proc opkg {cmd} {
chunk ">>> opkg $cmd\r\n"
set bcmd "|/mod/webif/lib/bin/opkg $cmd"
set fd [open $bcmd r]
while {[gets $fd line] >= 0} {
chunk "$line\r\n"
#chunk_pad
}
close $fd
chunk "\r\n"
}
start_chunked
if {$cmd eq "upgrade"} { opkg update }
opkg $cmd
if {$cmd eq "update" || $cmd eq "upgrade"} {
chunk "Updating package meta information\r\n"
pkg fetchmeta
chunk "Done.\r\n"
chunk "Updating diagnostic meta information\r\n"
pkg fetchdiagmeta
chunk "Done.\r\n"
}
end_chunked

View File

@@ -7,7 +7,7 @@ require rsv.class system.class
httpheader
if {[cgi_get act] eq "cancel"} {
system restartpending 0
file delete /tmp/.restartpending
exit
}
@@ -18,8 +18,7 @@ if {[cgi_get now] eq "yes"} {
exit
}
system restartpending 0
jqplugin progressbar
file delete /tmp/.restartpending
header
# Commit pending reservations on older mod versions.
@@ -28,6 +27,8 @@ if {![file exists /sbin/rsvsync] && ![file exists /mod/boot/rsvsync]} {
}
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;
@@ -45,7 +46,7 @@ puts {
$(document).ready(function() {
$('#progressbar').reportprogress(0);
handle = setInterval("update()" , 400);
handle = setInterval("update()", 350);
$.get('/cgi-bin/restart.jim?now=yes');
});
</script>

442
var/mongoose/cgi-bin/settings.jim Executable file
View File

@@ -0,0 +1,442 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require settings.class plugin system.class
httpheader
if {[cgi_get act] eq "https"} {
if {[cgi_get val off] eq "off"} {
file delete /mod/etc/mongoose.cert
puts "HTTPS Server will be disabled after next reboot."
} else {
exec /mod/sbin/mongoose_mkcert
puts "HTTPS Server will be enabled after next reboot."
}
exit
}
if {[cgi_get act] eq "xtelnet"} {
if {[cgi_get val off] eq "off"} {
file delete /mod/boot/xtelnet
puts "Telnet server expert mode will be disabled after next reboot."
} else {
exec /mod/bin/busybox/touch /mod/boot/xtelnet
puts "Telnet server expert mode will be enabled after next reboot."
}
exit
}
set settings [settings new]
set hostname [$settings hostname]
set smtp_server [$settings smtp_server]
set channel_group [$settings channel_group]
set epg_style [$settings epg_style]
set pkgdev [$settings pkgdev]
set notoolbar [$settings notoolbar]
set nomobile [$settings nomobile]
set xepghours [$settings xepghours]
if {$xepghours == 0} { set xepghours 4 }
set genrededup [$settings genrededup]
# Handle updates
if {![dict exists $env REQUEST_URI]} { set env(REQUEST_URI) "" }
proc _handle_update {class var old text} {
global _cgi
global settings
if {[dict exists $_cgi $var]} {
set new [string trim [dict get $_cgi $var]]
if {$new == $old} {
puts "$text unchanged."
} elseif [string is $class -strict $new] {
$settings $var $new
puts "$text updated."
} else {
puts "Invalid value for $var."
}
exit
}
}
proc handle_int_update {var old {text "Value"}} {
_handle_update digit $var $old $text
}
proc handle_str_update {var old {text "Value"}} {
_handle_update alnum $var $old $text
}
handle_str_update hostname $hostname Hostname
_handle_update ascii smtp_server $smtp_server "SMTP Server"
handle_int_update channel_group $channel_group "Channel Group"
handle_int_update xepghours $xepghours "Grid EPG Hours"
handle_str_update epg_style $epg_style "EPG Type"
handle_int_update pkgdev $pkgdev "Development Package Display"
handle_int_update notoolbar $notoolbar "Disable toolbar"
handle_int_update nomobile $nomobile "Disable mobile link"
handle_int_update genrededup $genrededup "Genre search dedup"
set acluser [cgi_get acluser "-"]
set aclpass [cgi_get aclpass "-"]
set aclpassc [cgi_get aclpassc "-"]
if {$acluser ne "-" && $aclpass ne "-"} {
if {![string length $acluser]} {
puts "No username provided."
exit
}
if {$aclpass ne $aclpassc} {
puts "Passwords do not match."
exit
}
if {[string length $aclpass] < 4} {
puts "Password is too short (< 4 characters)"
exit
}
puts [$settings addacluser $acluser $aclpass]
exit
}
set aclact [cgi_get aclact "-"]
if {$aclact ne "-" && $acluser ne "-"} {
switch $aclact {
"del" { puts [$settings delacluser $acluser] }
}
exit
}
header
puts {
<script type="text/javascript" src="/cgi-bin/settings.js"></script>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script type="text/javascript" src="/js/jconfirmaction.jquery.js"></script>
<link href=/css/jconfirmaction.jquery.css rel=stylesheet type=text/css />
<script type="text/javascript" src="/js/iphone-style-checkboxes.js"></script>
<link href=/css/iphone-style-checkboxes.css rel=stylesheet type=text/css />
}
puts "
<fieldset style=\"display: inline\">
<legend>
General Settings
</legend>
<table>
"
puts "
<tr>
<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>
</tr>
"
puts -nonewline "
<tr>
<th class=key>HTTPS web server?</th>
<td><input id=https_toggle name=https type=checkbox value=yes"
if {[file exists /mod/etc/mongoose.cert]} { puts -nonewline " checked" }
puts ">
<div id=https_output></div>
</td>
</tr>
"
puts -nonewline "
<tr>
<th class=key>Slide-down toolbar?</th>
<td><input id=toolbar_toggle name=toolbar type=checkbox value=yes"
if {$notoolbar == 0} { puts -nonewline " checked" }
puts ">
<div id=toolbar_output></div>
</td>
</tr>
"
puts -nonewline "
<tr>
<th class=key>Mobile link on main page?</th>
<td><input id=mobile_toggle name=mobile type=checkbox value=yes"
if {$nomobile == 0} { puts -nonewline " checked" }
puts ">
<div id=mobile_output></div>
</td>
</tr>
"
puts "
</table></fieldset>
<br><br>
<fieldset style=\"display: inline\">
<legend>
EPG Settings
</legend>
<table>
"
puts "
<tr>
<form class=auto id=epg_style method=get action=$env(REQUEST_URI)>
<th class=key>Default Now/Next style</th>
<td><select id=epg_style name=epg_style
class=\"text ui-widget-content ui-corner-all\">
"
puts "<option value=standard"
if {$epg_style ne "grid"} { puts " selected" }
puts ">Standard\n"
puts "<option value=grid"
if {$epg_style eq "grid"} { puts " selected" }
puts ">Grid\n"
puts "
</select>
<small>
<input name=epg_style value=\"set\" type=submit>
</small>
<div id=epg_style_output></div>
</td>
</form>
</tr>
"
puts "
<tr>
<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\">
"
set i 0
puts "<option value=0>-- None --"
foreach grp [$settings channel_groups] {
incr i
puts -nonewline "<option value=$i"
if {$channel_group == $i} {
puts -nonewline " selected"
}
puts ">$grp"
}
puts "
</select>
<small>
<input name=channel_group value=\"set\" type=submit>
</small>
<div id=channel_group_output></div>
</td>
</form>
</tr>
"
puts "
<tr>
<form class=auto id=xepghours method=get action=$env(REQUEST_URI)>
<th class=key>Grid-style EPG Hours</th>
<td><select id=xepghours name=xepghours
class=\"text ui-widget-content ui-corner-all\">
"
foreach xehopt {2 3 4 5 6} {
puts -nonewline "<option value=$xehopt"
if {$xehopt == $xepghours} {
puts -nonewline " selected"
}
puts ">$xehopt hours"
}
puts "
</select>
<small>
<input name=xepghours value=\"set\" type=submit>
</small>
<div id=xepghours_output></div>
</td>
</form>
</tr>
"
puts -nonewline "
<tr>
<th class=key>De-duplicate genre search results?</th>
<td><input id=genrededup_toggle name=genrededup type=checkbox value=yes"
if {$genrededup == 1} { puts -nonewline " checked" }
puts ">
<div id=genrededup_output></div>
</td>
</tr>
"
puts "
</table>
</fieldset>
<br><br>
<fieldset style=\"display: inline\">
<legend> Email Settings </legend>
<table>
"
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>
"
puts "
<br><br>
<fieldset style=\"display: inline\">
<legend> Web Interface User Access Control </legend>
<table>
"
set aclusers [$settings aclusers]
if {[llength $aclusers]} {
puts "<tr><th colspan=5 class=odd>Existing Users</th></tr>"
foreach user [$settings aclusers] {
lassign $user user
puts "<tr><td align=center style=\"font-weight: bold\">
$user</td>"
puts "<th class=key>New password:
<input
class=\"aclpass text ui-widget-content ui-corner-all\"
type=password size=20 maxlength=50><br>"
puts "Again:
<input
class=\"aclpassc text ui-widget-content ui-corner-all\"
type=password size=20 maxlength=50></td>"
puts "<th class=key><button class=pwchange>
Change</button></td>"
puts "<th class=key><button class=userdel>
Delete User</button></td>"
puts "</tr>"
}
puts "<tr><td colspan=5 id=aclusermod_output>&nbsp;</td></tr>"
puts "<tr><td colspan=5>&nbsp;</td></tr>"
} else {
puts "<tr><td colspan=5 class=blood><b>
Add a user to enable authentication.</b></td></tr>"
}
puts "<tr><th colspan=5 class=odd>Add New User</th></tr>"
puts "
<form id=aclnewuser method=get action=$env(REQUEST_URI)>
<tr><th class=key>New User:</th><td>
<input
class=\"text ui-widget-content ui-corner-all\"
id=acluser name=acluser size=20 maxlength=50></td></tr>
<tr><th class=key>Password:</th><td>
<input type=password
class=\"text ui-widget-content ui-corner-all\"
id=aclpass name=aclpass size=20 maxlength=50></td></tr>
<tr><th class=key>Password (confirm):</th><td>
<input type=password
class=\"text ui-widget-content ui-corner-all\"
id=aclpassc name=aclpassc size=20 maxlength=50></td></tr>
<tr><td><input id=aclnewuser_submit value=\"Add User\" type=submit>
</td></tr>
</form>
</table>
<div id=aclnewuser_output></div>
</fieldset>
"
puts {
<script type=text/javascript>
$('#aclnewuser').ajaxForm({
target: '#aclnewuser_output',
success: function(txt) {
if (txt.indexOf('Success') >= 0)
window.location.reload(true);
}
});
$('button.userdel').click(function(el) {
var user = $('td:first', $(this).parents('tr')).text().trim();
$('#aclusermod_output').load(
'/cgi-bin/settings.jim?aclact=del&acluser=' +
encodeURIComponent(user), function(txt) {
if (txt.indexOf('Success') >= 0)
window.location.reload(true);
});
});
$('button.pwchange').click(function(el) {
var tr = $(this).parents('tr');
var user = $('td:first', $(tr)).text().trim();
var pass = $(tr).find('input.aclpass').val();
var passc = $(tr).find('input.aclpassc').val();
$('#aclusermod_output').load('/cgi-bin/settings.jim?' +
'acluser=' + encodeURIComponent(user) + '&' +
'aclpass=' + encodeURIComponent(pass) + '&' +
'aclpassc=' + encodeURIComponent(passc));
});
</script>
}
puts -nonewline "
<br><br>
<fieldset style=\"display: inline\">
<legend> Advanced Settings </legend>
<table>
<tr>
<th class=key>Show development and advanced packages?</th>
<td><input name=pkgdev id=pkgdev value=1 type=checkbox
"
if {$pkgdev} { puts -nonewline " checked" }
puts ">
</td>
</tr>
"
if {[system modversion 1] >= 214} {
puts -nonewline "
<tr>
<th class=key>Expert mode telnet server?</th>
<td><input id=xtelnet_toggle name=xtelnet type=checkbox value=yes"
if {[file exists /mod/boot/xtelnet]} { puts -nonewline " checked" }
puts ">
<div id=xtelnet_output></div>
</td>
</tr>
"
}
puts "
</table>
<div id=pkgdev_output></div>
</fieldset>
"
eval_plugins settings
footer

View File

@@ -0,0 +1,160 @@
(function($)
{
$.fn.enable = function()
{
return this.each(function() {
$(this)
.removeClass('ui-state-disabled')
.removeProp('disabled');
});
};
$.fn.disable = function()
{
return this.each(function() {
$(this)
.addClass('ui-state-disabled')
.prop('disabled', true);
});
};
})(jQuery);
$(document).ready(function () {
$(":submit").button();
//$('[type="checkbox"] :not(.yesno)').iphoneStyle();
$('[type="checkbox"]').iphoneStyle({
checkedLabel: 'YES',
uncheckedLabel: 'NO'
});
$('form.auto').each(function(i, el) {
var id = $(this).attr('id');
var output = '#' + id + '_output';
$(this).ajaxForm({
target: output,
success: function() {
$(output)
.css('font-style', 'italic')
.show('slow')
.delay(2000)
.fadeOut('slow');
}
});
});
$('#pkgdev').change(function() {
var arg = '0';
if ($(this).attr('checked'))
arg = '1';
$(this).disable();
$('#pkgdev_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?pkgdev=' + arg,
function() {
$('#pkgdev').enable();
$('#pkgdev_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#https_toggle').change(function() {
var arg = 'off';
if ($(this).attr('checked'))
arg = 'on';
$(this).disable();
$('#https_output')
.empty()
.html('<img src=/img/loading.gif>Please Wait...')
.show('slow')
.load('/cgi-bin/settings.jim?act=https&val=' + arg,
function() {
$('#https_toggle').enable();
$('#https_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#xtelnet_toggle').change(function() {
var arg = 'off';
if ($(this).attr('checked'))
arg = 'on';
$(this).disable();
$('#xtelnet_output')
.empty()
.html('<img src=/img/loading.gif>Please Wait...')
.show('slow')
.load('/cgi-bin/settings.jim?act=xtelnet&val=' + arg,
function() {
$('#xtelnet_toggle').enable();
$('#xtelnet_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#toolbar_toggle').change(function() {
var arg = '1';
if ($(this).attr('checked'))
arg = '0';
$(this).disable();
$('#toolbar_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?notoolbar=' + arg,
function() {
$('#toolbar_toggle').enable();
$('#toolbar_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#mobile_toggle').change(function() {
var arg = '1';
if ($(this).attr('checked'))
arg = '0';
$(this).disable();
$('#mobile_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?nomobile=' + arg,
function() {
$('#mobile_toggle').enable();
$('#mobile_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#genrededup_toggle').change(function() {
var arg = '0';
if ($(this).attr('checked'))
arg = '1';
$(this).disable();
$('#genrededup_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?genrededup=' + arg,
function() {
$('#genrededup_toggle').enable();
$('#genrededup_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
});

183
var/mongoose/cgi-bin/status.jim Executable file
View File

@@ -0,0 +1,183 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require system.class findhsvc epg.class rsv.class
set runmode cli
if {[string match {*jim} $argv0]} { set runmode cgi }
set schedtime 1200
case $runmode {
cgi {
set type [cgi_get type "full"]
httpheader
}
cli {
set type "full"
if {"-X" in $argv} { set schedtime 7200 }
}
}
if {[catch {set pid [exec pgrep humaxtv]}]} {
puts "Cannot find humaxtv process."
exit
}
proc get_data {} {
global pid
set ret {}
if {[catch {set data \
[exec /mod/bin/lsof -p $pid | grep Video | fgrep .ts]} ]} {
set ret {}
} else {
foreach line [split $data "\n"] {
regsub -all -- {[[:space:]]+} $line " " line
set name [file rootname [file tail $line]]
if {[dict exists $ret $name]} {
set ret($name) -1
} else {
set size [lindex [split $line " "] 6]
set ret($name) $size
}
}
}
return $ret
}
set play 0
set rec 0
set seen {}
set output {}
if {$type eq "full"} {
set data [get_data]
} else {
set data {}
}
if {[llength $data]} {
sleep 3
set ndata [get_data]
foreach name [array names ndata] {
if {![dict exists $seen $name]} { set seen($name) 0 }
if {![dict exists $data $name]} { set data($name) 0 }
if {[file exists "/mod/tmp/webif_auto/decrypting.$name.ts"]} {
set mode "Decrypting"
set icon "178_1_00_Icon_Lock.png style=\"padding: 0 0.2em 0 0.5em\""
} elseif {$ndata($name) == -1} {
incr rec
incr play
set mode "Chase Playing"
set icon "745_1_11_Video_3REC_Live.png"
} elseif {$ndata($name) > $data($name) && $seen($name) < 1} {
incr rec
set mode "Recording"
set icon "745_1_11_Video_1REC.png"
} else {
incr play
set mode "Playing"
set icon "745_1_10_Video_2Live.png"
}
incr seen($name)
if {$runmode eq "cgi"} {
lappend output [concat \
"<span class=\"va stitem\">\n" \
" <img class=va src=/images/$icon>\n" \
" <span>$mode&nbsp;<i>$name</i></span>\n" \
"</span>\n" \
]
} else {
lappend output "$mode $name"
}
}
}
if {![system instandby] && $play < 1} {
set hsvc [system param CUR_SVC Value USERCONFIG]
set ff [$rsvdb query "
select usSvcid as svcid, usLcn as lcn,
substr(szSvcName, 2) as name
from channel.TBL_SVC
where hSvc = $hsvc
limit 1
"]
if {[llength $ff] == 1} {
lassign [lindex $ff 0] x svcid x lcn x name
set epgs [epg dbfetch get \
-service $svcid \
-time [clock seconds]\
]
set prog ""
if {[llength $epgs] == 1} {
lassign $epgs epg
set prog "- [$epg get name] ("
append prog "[clock format [$epg get start] -format %H:%M] - "
append prog "[clock format $([$epg get start] + [$epg get duration]) -format %H:%M]"
append prog ") \[[$epg percent]%\]"
}
if {$runmode eq "cgi"} {
lappend output [concat \
"<span class=\"va stitem\">\n" \
" [epg channelicon $name 30 \
{vertical-align: middle; padding: 0 4px 0 2px}]\n" \
" <span>Watching <i>$lcn: $name $prog</i></span>\n" \
"</span>\n" \
]
} else {
lappend output "Watching $lcn: $name $prog"
}
}
}
if {[system instandby]} {
if {$runmode eq "cgi"} {
lappend output [concat \
"<span class=\"va stitem\">\n" \
" <img class=va width=28 style=\"padding: 0 4px\"" \
"src=/img/standby.png>\n" \
" <span>System is in standby.</span>\n" \
"</span>" \
]
} else {
lappend output "System is in standby."
}
}
set events [rsv list tbl_reservation \
" where ersvtype = 3 and nsttime - [clock seconds] < $schedtime
and nsttime > [clock seconds] "]
foreach event $events {
if {$runmode eq "cgi"} {
set icon "175_1_11_Reservation_Record.png"
lappend output [concat \
"<span class=\"va stitem\">\n" \
" <img class=va src=/images/$icon width=20>\n" \
" <span>Will record <i>[$event name]</i>" \
" on [$event channel_name] at"\
" [clock format [$event get nsttime] -format {%H:%M}]" \
" </span>\n" \
"</span>\n" \
} else {
lappend output [concat \
"Will record '[$event name]' " \
"on [$event channel_name] at " \
"[clock format [$event get nsttime] -format {%H:%M}]" \
]
}
}
if {[llength $output]} {
if {$runmode eq "cgi"} {
puts [join $output "\n<br>\n"]
} else {
puts [join $output "\n"]
}
}

View File

@@ -2,29 +2,14 @@
package require cgi
source /mod/webif/lib/setup
require settings.class
jqplugin enadis
jscss xepg.js /css/xepg.css
header
require epg.class spinner.class altrow epg_search totop system.class
require epg.class spinner.class altrow epg_search totop
set irinst [system pkginst ir]
set s [settings]
if {[$s chanchangenc]} {
puts { <script type=text/javascript src=/js/chanchangenc.js></script> }
} else {
jqplugin confirmAction
puts { <script type=text/javascript src=/js/chanchange.js></script> }
}
if {[$s service_style] eq "standard"} {
set surl xservice
} else {
set surl service
puts {
<link type="text/css" href="/css/xepg.css" rel="Stylesheet" />
<script type=text/javascript src=/js/enadis.js></script>
}
[spinner new {
@@ -44,7 +29,7 @@ if {$stt <= $now} {
set current 0
}
set favgroup [$s channel_group]
set favgroup [[settings] channel_group]
set hours [expr 1.0 * [[settings] xepghours]]
if {$hours == 0} { set hours 4.0 }
@@ -96,9 +81,8 @@ puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
but "&lt&lt; -1 Week" $($stt - 3600 * 24 * 7) \
$($stt - $now + 3600 >= 3600 * 24 * 7)
but "&lt&lt; -1 Day" $($stt - 3600 * 24) $($stt - $now >= 3600 * 23)
but "&lt;&lt; Earlier" $($stt - 3600 * 4) $($stt > $now)
#but "&lt; Now &gt;" $now $($current == 0)
but "&lt; Now &gt;" $now
but "&lt;&lt; Earlier", $($stt - 3600 * 4) $($stt > $now)
but "&lt; Now &gt;" $now $($current == 0)
but "&gt;&gt; Later" $ett;
but "&gt;&gt; +1 Day" $($stt + 3600 * 24) $($stt < $now + 8 * 3600 * 24)
but "&gt;&gt; +1 Week" $($stt + 3600 * 24 * 7) $($stt < $now + 8 * 3600 * 24)
@@ -137,13 +121,9 @@ foreach e $records {
if {$chnum != $lcn} {
puts "<div class=xechan style=\"width: ${chanpx}px;\">"
if {$irinst} {
puts "<a class=chanchange chan=$chnum href=#>"
}
puts "[$e channel_icon 30]&nbsp;"
if {$irinst} { puts "</a>" }
puts "$chnum
<a href=\"/epg/$surl.jim?service=[$e get service_id]\"
<a href=/cgi-bin/epg/service.jim?service=[$e get service_id]
title=\"[$e get channel_name]\">
[$e get channel_name]
</a></div>"
@@ -193,10 +173,7 @@ foreach e $records {
clock format $ee -format "%H:%M"])"
if {$showing} { append hxt " ($perc%)" }
set lbg $bg
if {[$e scheduled]} { set lbg "blueshade" }
puts "<div class=\"xeprog $lbg\"
puts "<div class=\"xeprog $bg\"
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
<a class=event href=# xs=[$e get service_id]
xe=[$e get event_id] sch=[$e get sched_type]
@@ -220,11 +197,48 @@ puts "
</div>
"
puts "
<script type=text/javascript>
\$(document).ready(function() {
\$('#epgswitch').button().click(function() {
window.location = '/epg.shtml';
});
\$('button.nav').click(function() {
window.location = '/cgi-bin/xepg.jim?stt=' + \$(this).attr('tt') +
'&pos=' + \$('#xegrid').scrollTop();
});
\$('#xepg_dp').datepicker({
buttonImage: '/img/cal.gif',
buttonImageOnly: true,
showOn: 'button',
dateFormat: '@',
minDate: '[expr $now * 1000]',
maxDate: '[expr ($now + 7 * 86400) * 1000]',
onSelect: function(val, sel) {
var stt = \$(this).attr('stt');
// Extract date part
dval = ~~(val / 86400000);
// Extract current time part
var tm = ~~(stt % 86400);
var ret = dval * 86400 + tm;
window.location = '/cgi-bin/xepg.jim?stt=' + ret;
}
});
\$('img.ui-datepicker-trigger').hover(
function() { \$(this).css('cursor', 'pointer'); },
function() { \$(this).css('cursor', 'auto'); }
);
"
if {$current} {
puts "
<script type=text/javascript>
\$(function() {
"
puts {
var kt = $('#xe0');
@@ -235,21 +249,23 @@ var height = $('#keypos').position().top - ktpos.top;
}
puts "var nowpos = ktpos.left + (kt.width() * $offset);"
puts {
if (window.console)
console.log('NOWPOS: %d', nowpos);
$('#xepgnow')
.css('left', nowpos + 'px')
.css('top', ktpos.top)
.height(height)
.show('slow');
}
puts "
});
</script>
"
}
puts "
<a href=/settings/settings.jim>
});
</script>
"
puts "
<a href=/cgi-bin/settings.jim>
<img border=0 height=14 src=/images/421_1_00_CH_Title_2R_Arrow.png>
Visit settings to change EPG options.
</a><br>

View File

@@ -0,0 +1,4 @@
<!--#include virtual="/lib/header.shtml" -->
<!--#exec cmd="/mod/webif/include/backup.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@@ -0,0 +1,24 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
httpheader
# dir=%2Fmedia%2FMy+Video%2FWeatherview
# aexpiry_days=13
set dir [cgi_get dir "-"]
set days [cgi_get aexpiry_days 7]
if {$dir eq "-"} exit
if {![file isdirectory $dir]} {
puts "Not a directory."
exit
}
set fd [open "$dir/.autoexpire" w]
puts $fd $days
$fd close
puts "Ok."

View File

@@ -9,8 +9,8 @@ puts {
<li class=cut><a href=#cut>Cut to clipboard</a></li>
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
<li class="separator rename"><a href=#rename>Rename</a></li>
<li class=download><a href=#download>Download</a></li>
<li class=separator><a href=#rename>Rename</a></li>
<li><a href=#download>Download</a></li>
}
if {$model eq "HDR"} {
@@ -23,33 +23,17 @@ if {[system pkginst ffmpeg]} {
puts {
<li class=mp3><a href=#audio>Extract Audio</a></li>
<li class=mpg><a href=#mpg>Extract to MPG</a></li>
<li class=thm><a href=#thm>Set Thumbnail</a></li>
}
}
puts { <li class=thm><a href=#vthm>View Thumbnail</a></li> }
puts { <li class=bookmark><a href=#bmarks>Bookmarks</a></li> }
if {$nicesplice} {
if $nicesplice {
puts {
<li class="cut"><a href=#crop>Crop</a></li>
<li class="cut"><a href=#chunk>Split (45m parts)</a></li>
}
}
puts {
<li class="separator lock"><a href=#lock>Toggle Lock</a></li>
<li class=new><a href=#new>Toggle New</a></li>
}
if {[llength $plugins(menu)]} {
foreach plugin $plugins(menu) {
lassign $plugin tag options
puts "<li class=$tag><a href=#$tag>$options(desc)</a></li>"
}
}
puts {
<li class=separator><a href=#lock>Toggle Lock</a></li>
<li><a href=#new>Toggle New</a></li>
</ul>
<ul id=ooptmenu class=contextMenu style="width: 160px">
@@ -57,17 +41,8 @@ puts {
<li class=cut><a href=#cut>Cut to clipboard</a></li>
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
<li class="separator rename"><a href=#rename>Rename</a></li>
<li class="download"><a href=#download>Download</a></li>
}
if {[llength $plugins(omenu)]} {
foreach plugin $plugins(omenu) {
lassign $plugin tag options
puts "<li class=$tag><a href=#$tag>$options(desc)</a></li>"
}
}
puts {
<li class=separator><a href=#rename>Rename</a></li>
<li><a href=#download>Download</a></li>
</ul>
<ul id=dooptmenu class=contextMenu style="width: 250px">
@@ -83,10 +58,10 @@ puts {
<li class=cut><a href=#cut>Cut to clipboard</a></li>
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
<li class=pwpaste><a href=#paste>Paste to folder</a></li>
<li class="separator rename"><a href=#rename>Rename</a></li>
<li class=separator><a href=#rename>Rename</a></li>
<li class=separator><a href=#resetnew>Reset new flag</a></li>
<li class="separator compress"><a href=#shrink>Auto-Shrink</a></li>
<li class=compressr><a href=#shrinkr>Recursive Auto-Shrink</a></li>
<li class="compressr"><a href=#shrinkr>Recursive Auto-Shrink</a></li>
<li class=dedup><a href=#dedup>Auto-Dedup</a></li>
}
if {$model eq "HDR"} {
@@ -96,12 +71,12 @@ if {$model eq "HDR"} {
</a></li>
}
}
if {$flatten} {
if $flatten {
puts { <li class="separator"><a href=#flat>No-Flatten</a></li> }
}
puts {
<li class=clock><a href=#expire>Auto-Expire Options</a></li>
<li class=clock><a href=#expire>Auto-Expire</a></li>
}
if {[system pkginst ffmpeg]} {
@@ -111,13 +86,6 @@ if {[system pkginst ffmpeg]} {
}
}
if {[llength $plugins(dmenu)]} {
foreach plugin $plugins(dmenu) {
lassign $plugin tag options
puts "<li class=$tag><a href=#$tag>$options(desc)</a></li>"
}
}
puts {
</ul>
@@ -237,10 +205,7 @@ puts {
<div id=savestreamform title="Save streamed content"
style="display: none">
<div class=pre id=savestream_detail></div>
<div id=savestream_retrieving>
<img src=/img/loading.gif> Retrieving details...
</div>
<form id=savestream_form class=hidden>
<form id=savestream_form>
}
puts "<input type=hidden name=dir value=\"$dir\">"
puts {
@@ -248,7 +213,7 @@ puts {
<tr>
<th>
<label for="savestream_name">
<b>Enter Filename</b>
<b>Filename</b>
</label>
</th>
<td>
@@ -256,9 +221,7 @@ puts {
id="savestream_name"
value="" size=70 maxlength=255
class="text ui-widget-content ui-corner-all">
<span id=savestream_spin>
<img src=/img/loading.gif> Saving...
</span>
<img id=savestream_spin src=/img/loading.gif>
</td>
</tr>
</table>
@@ -287,76 +250,28 @@ puts {
</form>
</div>
<div id=aexpiry title="Auto-Expiry Settings"
style="display: none; line-height: 1em;">
<div id=aexpiry title="Auto-Expiry" style="display: none">
<form id=aexpiry_form>
<input type=hidden name="dir" id="aexpiry_ldir" value="">
}
puts {
<table border=0>
<tr><th align=right>
<tr>
<th>
<label for="aexpiry_days">
<b>Remove recordings after</b> (in days)
<br><span class=footnote>
(Leave blank to skip age check)
</span>
<b>Expire after</b>
<span class=blood>(in days)</span>
</label>
</th><td>
<input name="aexpiry_days" id="aexpiry_days"
</th>
<td>
<input type=text name="aexpiry_days" id="aexpiry_days"
type=number value=0 size=5 maxlength=3
class="text ui-widget-content ui-corner-all">
</td></tr>
<tr><th>
<label for="aexpiry_min">
<b>Keep at least</b>
(number of recordings)
<br>
<span class=footnote>(Oldest will be deleted first)
</span>
</label>
</th><td>
<input name="aexpiry_min" id="aexpiry_min"
type=number value=0 size=5 maxlength=3
class="text ui-widget-content ui-corner-all">
</td></tr>
<tr><th>
<label for="aexpiry_timetype">
<b>For date of recording, use</b>
</label>
</th><td>
<input name="aexpiry_timetype" id="aexpiry_timetype0"
type=radio value=0 checked
class="text ui-widget-content ui-corner-all">
Recording end time
<br>
<input name="aexpiry_timetype" id="aexpiry_timetype1"
type=radio value=1
class="text ui-widget-content ui-corner-all">
<span>
When last watched
<span class=bfootnote>(or end time if unwatched)</span>
</span>
</td></tr>
<tr><th>
<label for="aexpiry_unwatched">
<b>Never delete unwatched recordings</b>
</label>
</th><td>
<input name="aexpiry_unwatched" id="aexpiry_unwatched"
type=checkbox value=1
class="ui-widget-content ui-corner-all">
</td></tr>
</td>
</tr>
</table>
<div id=aexpiry_working class=hidden>
<img src=/img/loading.gif> Applying changes...
</div>
<div id=aexpiry_loading class=hidden>
<img src=/img/loading.gif> Retrieving data...
<img src=/img/loading.gif> Applying auto-expiry...
</div>
</form>
</div>
@@ -372,9 +287,5 @@ Please wait...
</center>
</div>
<div id=bmpdialogue title="Recording Thumbnail" class=hidden>
<img id=thmbmp class=doublebmp src="about:blank">
</div>
}

View File

@@ -3,21 +3,19 @@
package require sqlite3
package require cgi
source /mod/webif/lib/setup
require ts.class system.class settings.class
require ts.class system.class
jqplugin progressbar
jscss audio.js
header
set s [settings]
set type [$s audiomp3descr [$s audiomp3]]
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
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 src=audio.js></script>
<fieldset class=cleft>
<legend>Audio Extraction</legend>
@@ -33,7 +31,7 @@ puts "
></span>
<div id=audiodiv style=\"padding: 1em\">
<button id=audioit>Perform audio extraction - $type</button>
<button id=audioit>Perform audio extraction</button>
</div>
<div id=progressdiv class=hidden>

View File

@@ -3,7 +3,7 @@
package require sqlite3
package require cgi
source /mod/webif/lib/setup
require ts.class system.class settings.class
require ts.class system.class
httpheader
@@ -18,15 +18,9 @@ set base [file rootname $rfile]
set shname [file tail $base]
puts "Processing $shname"
set cmd [list ffmpeg -y -benchmark -v 0 -i "$rfile" -f mp3 -vn]
if {![[settings] audiomp3]} {
lappend cmd -acodec copy
}
lappend cmd "${base}.mp3"
#puts "$cmd"
puts [exec {*}$cmd]
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
-i $rfile -f mp3 \
-vn -acodec copy "${base}.mp3"]
if {[system pkginst id3v2]} {
puts [exec /mod/bin/id3v2 \

View File

@@ -4,8 +4,6 @@ package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size
jqplugin progressbar
jscss chunk.js chunk.css
header
set rfile [cgi_get file]
@@ -21,6 +19,10 @@ set esttime $(int($len * 0.025))
if {[$ts get definition] eq "HD"} { set esttime $($esttime * 4) }
puts "
<script type=text/javascript src=/js/jquery.progressbar.js></script>
<script type=text/javascript src=chunk.js></script>
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />
<link href=chunk.css rel=stylesheet type=text/css />
<fieldset class=cleft>
<legend>Split recording into 45 minute segments</legend>

View File

@@ -16,7 +16,7 @@ switch $action {
list {
if {![$cb size]} {
puts "<i>Clipboard is empty</i>"
exit
break
}
puts "<div class=cliplist>"
foreach file [$cb get items] {
@@ -113,7 +113,6 @@ switch $action {
"$dir/[file tail $path]"}
}
}
ts resetnew $dir
}
$cb clear
$cb save

View File

@@ -4,19 +4,20 @@ package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size
jqplugin progressbar
jscss crop.js
header
set rfile [cgi_get file]
set invert [cgi_get invert 0]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
puts "
<fieldset>
<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 src=crop.js></script>
<fieldset class=cleft>
<legend>Crop recording</legend>
<table class=keyval cellpadding=5>
@@ -25,9 +26,12 @@ puts "
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
<tr><th>Bookmarks:</th><td>[$ts get bookmarks] @ "
puts [join [lmap i [$ts bookmarks 1] {
clock format $i -format "%T"
}] ", "]
set flag 0
foreach b [$ts bookmarks] {
if $flag { puts -nonewline ", " }
incr flag
puts -nonewline [clock format $b -format "%T"]
}
puts "</td></tr><tr><th>File</th><td>"
@@ -39,16 +43,10 @@ proc div {type left right} {
$type</div>"
}
set bookmarks {}
if {$invert} {
append bookmarks "0 "
}
append bookmarks [$ts bookmarks]
set keeping 0
set last 0
set start -1
foreach b $bookmarks {
foreach b [$ts bookmarks] {
if {$start < 0} {
set start $b
continue
@@ -98,7 +96,6 @@ puts "
></span>
<div id=cropdiv style=\"padding: 1em\">
<button id=invert invert=$invert>Invert selection</button>
<button id=cropit>Perform crop operation</button>
</div>
@@ -106,9 +103,9 @@ puts "
Cropping: <div id=progressbar></div>
</div>
<button id=back>Back to media list</button>
<button id=back class=hidden>Back to media list</button>
<div id=output class=\"hidden pre\" style=\"margin-top: 10px\"></div>
<div id=output class=pre style=\"margin-top: 10px\"></div>
</fieldset>
"

View File

@@ -24,9 +24,8 @@ $('#cropit').button().click(function() {
$('#cropdiv').hide('slow');
$('#progressdiv').show('slow');
handle = setInterval("update()", 1000);
$('#output').show().text('Please do not interrupt...')
.load('execute.jim?file=' + $('#params').attr('file') +
'&invert=' + $('#invert').attr('invert'),
$('#output').text('Please do not interrupt...')
.load('execute.jim?file=' + $('#params').attr('file'),
function() {
clearInterval(handle);
handle = 0;
@@ -35,10 +34,5 @@ $('#cropit').button().click(function() {
});
});
$('#invert').button().on('click', function() {
window.location = 'crop.jim?file=' + $('#params').attr('file') +
'&invert=' + ($(this).attr('invert') == '1' ? '0' : '1');
});
});

View File

@@ -7,7 +7,6 @@ require ts.class pretty_size system.class
httpheader
set rfile [cgi_get file]
set invert [cgi_get invert]
if {[system inuse $rfile]} {
puts "This file is in use. Cannot process at the moment."
@@ -26,7 +25,7 @@ set origdir "$dir/_original"
if {![file exists $origdir]} { file mkdir $origdir }
set shname [file tail $base]
puts "Processing $shname (inverted: $invert)"
puts "Processing $shname"
if {[file exists "$origdir/$shname.ts"]} {
puts "This recording already exists within _original"
@@ -34,47 +33,22 @@ if {[file exists "$origdir/$shname.ts"]} {
exit
}
set bookmarks [$ts bookmarks]
puts "Moving recording to $origdir"
set tail [file tail $base]
foreach ext $tsgroup {
if {![file exists "$base.$ext"]} continue
puts " $tail.$ext"
file rename "$base.$ext" "${origdir}/$tail.$ext"
foreach f [glob -nocomplain "${base}.*"] {
set tail [file tail $f]
puts " $tail"
file rename $f "$origdir/$tail"
}
set cmd [list /mod/bin/nicesplice \
-in "$origdir/$shname" \
-out "$dir/$shname"]
if {$invert} {
if {[expr [llength $bookmarks] % 2] != 0} {
lappend bookmarks [$ts duration 1]
}
foreach k [array names bookmarks] {
lappend cmd -cut $($k * 10) $($bookmarks($k) * 10)
}
} else {
lappend cmd "-cutBookMarks"
}
puts "CMD: $cmd"
puts [exec {*}$cmd]
#puts [exec /mod/bin/nicesplice \
# -in "$origdir/$shname" \
# -out "$dir/$shname" \
# -cutBookMarks]
puts [exec /mod/bin/nicesplice \
-in "$origdir/$shname" \
-out "$dir/$shname" \
-cutBookMarks]
set newname "$shname-[clock seconds]"
puts "Renaming file group to $newname"
ts renamegroup "$dir/$shname.ts" $newname
exec /mod/bin/hmt "+setfilename=$newname" "$dir/$newname.hmt"
# New nicesplice shrinks whilst cropping.
# No longer required - nicesplice now sets this flag.
#exec /mod/bin/hmt "+shrunk" "$dir/$newname.hmt"
set croptime [expr [expr [clock milliseconds] - $cropstart] / 1000.0]
puts "Time taken: $croptime"

View File

@@ -7,7 +7,7 @@ require ts.class
httpheader
set perc [cgi_get perc 100]
set tsfile [cgi_get file]
set tsfile [file normalize [cgi_get file]]
set origfile "[file dirname $tsfile]/_original/[file tail $tsfile]"
set newfile [file rootname $tsfile]

View File

@@ -5,17 +5,18 @@ package require cgi
source /mod/webif/lib/setup
require ts.class
jqplugin progressbar
jscss decrypt.js
header
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts dlnaloc "127.0.0.1"] url
lassign [$ts dlnaloc] url
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 src=decrypt.js></script>
<fieldset class=cleft>
<legend>Decrypt in-place</legend>

View File

@@ -11,7 +11,7 @@ set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts dlnaloc "127.0.0.1"] url
lassign [$ts dlnaloc] url
if {$url eq ""} {
puts "This file has not been indexed by the media server.
@@ -42,22 +42,20 @@ exec wget -O "$rfile.decrypting" $url
puts "Moving recording to $origdir"
set tail [file tail $base]
foreach ext $tsgroup {
if {![file exists "$base.$ext"]} continue
puts " $tail.$ext"
file rename "$base.$ext" "${origdir}/$tail.$ext"
foreach f [glob -nocomplain "${base}.*"] {
if {[file extension $f] eq ".decrypting"} { continue }
set tail [file tail $f]
puts " $tail"
file rename $f "${origdir}/$tail"
}
file rename "$rfile.decrypting" $rfile
file touch $rfile "$origdir/$tail.ts"
foreach ext {nts hmt thm} {
set sidecar "$shname.$ext"
if {[file exists "$origdir/$sidecar"]} {
puts "Copying back sidecar $ext"
file copy "$origdir/$sidecar" "$dir/$sidecar"
file touch "$dir/$sidecar" "$origdir/$tail.ts"
}
}

View File

@@ -2,7 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require safe_delete ts.class
require safe_delete
httpheader
@@ -31,5 +31,3 @@ foreach file [cgi_get files] {
}
puts "</ul>"
ts resetnew $dir

View File

@@ -5,7 +5,7 @@ source /mod/webif/lib/setup
httpheader
if {[file exists /mod/bin/ffmpeg]} {
if [file exists /mod/bin/ffmpeg] {
set file [cgi_get file]
puts [exec /mod/webif/lib/bin/ffmpeg -i $file]
} else {

View File

@@ -2,7 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require pretty_size progressbar
require pretty_size
httpheader
@@ -11,7 +11,8 @@ set type [cgi_get type]
if {$file == 0} exit
set sz [pretty_size [file size $file]]
file stat $file st
set sz [pretty_size $st(size)]
if {$type eq "ts"} {
require epg.class ts.class
@@ -22,12 +23,7 @@ if {$type eq "ts"} {
<table class=keyval>
<tr>
<th>Title</th>
<td class=va>
"
if {[file exists "[file rootname $file].thm"]} {
puts "<img class=\"bmp va\" width=70 height=39 src=\"bmp.jim?file=$file\">"
}
puts "[$ts get title]</td>
<td>[$ts get title]</td>
</tr><tr>
<th>Synopsis</th>
<td>[$ts get synopsis]</td>
@@ -38,17 +34,7 @@ if {$type eq "ts"} {
puts "
<th>Guidance</th>
<td><img class=va
src=/img/Guidance_red.png height=21>
[$ts get guidance]
</td>
</tr><tr>
"
}
if {[$ts flag "GGuidance"] > 0} {
puts "
<th>General Guidance</th>
<td><img class=va
src=/img/Guidance_blue.png height=21>
src=/images/174_1_26_GuidancePolicy.png height=21>
[$ts get guidance]
</td>
</tr><tr>
@@ -89,14 +75,6 @@ if {$type eq "ts"} {
<td>[$ts duration] minute(s).
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
</font></td>
</tr><tr>
<th>Status</th>
<td>[$ts get status]</td>
</tr><tr>
<th>Resumes</th>
<td>[expr [$ts get resume] / 60] minutes into recording.
[progressbar $([$ts get resume] * 100 / [$ts duration 1])]
</td>
</tr><tr>
<th>Size</th>
<td>$sz</td>
@@ -129,10 +107,7 @@ puts "</td>
<td>[$ts get flags]
"
if {[$ts get bookmarks]} {
puts " \[Bookmarks: [$ts get bookmarks] @ [join \
[lmap i [$ts bookmarks 1] {
clock format $i -format "%T"
}] ", "]"
puts " \[Bookmarks: [$ts get bookmarks]\]"
}
puts "</tr>"

View File

@@ -9,6 +9,6 @@ httpheader
set file [cgi_get file]
if {[file isdirectory $file]} {
lassign [dir iconset $file] icons #attrs
lassign [{dir iconset} $file] icons #attrs
puts [join $icons ""]
}

View File

@@ -2,14 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size system.class settings.class escape browse.class \
plugin epg.class
jqplugin contextMenu bar enadis
jscss script.js style.css
set plugins { dmenu {} menu {} omenu {} }
eval_plugins browse
require ts.class pretty_size system.class settings.class escape browse.class
header
@@ -17,32 +10,28 @@ set nicesplice [system pkginst nicesplice]
set flatten [system pkginst flatten]
set ignore {.nts .thm .hmi}
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt .m4v}
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt}
if {![dict exists $env SCRIPT_NAME]} {
set env(SCRIPT_NAME) ""
if {![dict exists $env REQUEST_URI]} {
set env(REQUEST_URI) ""
cgi_input
set _cgi(dir) "/media/My Video/"
}
if {![dict exists $env QUERY_STRING]} { set env(QUERY_STRING) "root" }
set config [settings new]
set order [cgi_get order -]
if {$order eq "-"} {
set order [$config sortorder]
set order [[settings new] sortorder]
} else {
$config sortorder $order
[settings new] sortorder $order
}
set nofcount [$config nounwatchedcount]
set model [system model]
set dustbin [system dustbin 1]
proc icon {img {hover ""} {extra ""} {class "va"}} {
puts -nonewline "<img src=\"$img\" class=\"$class\" height=21 $extra"
puts -nonewline "<img src=$img class=\"$class\" height=21 $extra"
if {$hover ne ""} {
puts -nonewline " alt=\"$hover\" title=\"$hover\""
}
@@ -50,19 +39,18 @@ proc icon {img {hover ""} {extra ""} {class "va"}} {
}
proc directory {file bfile tbfile} {
puts "<div class=\"va relative\">"
puts "<div class=va>"
set img "/images/711_1_09_Media_Folder.png"
if {$bfile eq $::dustbin} { set img "/img/Dustbin_Folder.png" }
puts "<img border=0 class=va id=\"img$tbfile\" src=$img>"
if {!$::nofcount} { puts "<span class=foldernum></span>" }
puts "<input class=\"fs fsdir\" type=checkbox>"
puts "<a class=dbf
href=\"$::env(SCRIPT_NAME)?dir=[cgi_quote_url $file]\"
href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
file=\"[cgi_quote_url $file]\">"
puts "$bfile</a><span class=filesize id=\"$tbfile\">
</span>"
lassign [dir iconset $file] icons attrs
lassign [{dir iconset} $file] icons attrs
puts "<span class=iconset>"
puts [join $icons ""]
@@ -89,43 +77,32 @@ proc directory {file bfile tbfile} {
puts "</div>"
}
set dircount 0
set filecount 0
proc entry {file} {{i 0}} {
global dircount filecount dinuse
set bfile [file tail $file]
regsub -all " +" $bfile "" tbfile
if {[string index $bfile 0] == "\025"} {
set bfile [string range $bfile 1 end]
}
if {[file isdirectory "$file"]} {
incr dircount
if [file isdirectory "$file"] {
directory $file $bfile $tbfile
return
}
set ext [string tolower [file extension $file]]
if {$ext in $::ignore || $ext ni $::include} { return }
set rsz [file size $file]
file stat $file st
set rsz $st(size)
set sz [pretty_size $rsz]
set base [file rootname $file]
set thmok 0
if {$ext eq ".ts" && [file exists "${base}.nts"]} {
set type ts
set ts [ts fetch $file 1]
if {[$ts get status] eq "Valid/OK"} {
set img Video_TS
} else {
set img Video_Failed
}
set img Video_TS
set omenu opt
if {[file exists "${base}.thm"]} { set thmok 1 }
} elseif {$ext eq ".hmt"} {
if {[file exists "${base}.ts"]} { return }
if {[file exists "${base}.ts"]} { continue }
# Sole hmt file indicates failure to track.
set type bad
set ts 0
@@ -137,7 +114,6 @@ proc entry {file} {{i 0}} {
set img Video_Other
set omenu oopt
}
incr filecount
set new 0
if {$type eq "ts"} {
@@ -178,11 +154,6 @@ proc entry {file} {{i 0}} {
set dlna 0
set shrunk 0
if {$type eq "ts"} {
if {$bfile in $dinuse} {
icon "/img/inuse.png"
}
icon [epg channeliconpath [$ts get channel_name]] \
[$ts get channel_name] "" "va browsechannel"
set genre [$ts get genre]
set glist [ts genrelist]
if {[dict exists $glist $genre]} {
@@ -192,9 +163,9 @@ proc entry {file} {{i 0}} {
}
lassign $ret txt img
if {$img eq "Unclassified"} {
icon "/images/173_3_26_G3_$img.png" $txt "" "va genre"
icon "/images/173_3_26_G3_$img.png" $txt
} else {
icon "/images/173_3_00_G3_$img.png" $txt "" "va genre"
icon "/images/173_3_00_G3_$img.png" $txt
}
# HD / SD
@@ -225,10 +196,7 @@ proc entry {file} {{i 0}} {
# Guidance
if {[$ts flag "Guidance"] > 0} {
icon "/img/Guidance_red.png"
}
if {[$ts flag "GGuidance"] > 0} {
icon "/img/Guidance_blue.png"
icon "/images/174_1_26_GuidancePolicy.png"
}
# Indexed
@@ -253,7 +221,7 @@ proc entry {file} {{i 0}} {
<img class=\"$omenu va\" border=0 width=45 type=$type did=$i
locked=$locked encd=$encd def=$def new=$new bx=$bx
shrunk=$shrunk rsize=$rsz
odencd=$odencd dlna=$dlna thmok=$thmok
odencd=$odencd dlna=$dlna
src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
@@ -267,6 +235,16 @@ set dir [cgi_get dir $mroot]
######################################################################
# Render web page
puts {
<link href=/css/jquery.contextMenu.css rel=stylesheet type=text/css />
<script type=text/javascript src=/js/jquery.contextMenu.js></script>
<link href=/css/jquery.bar.css rel=stylesheet type=text/css />
<script type=text/javascript src=/js/jquery.bar.js></script>
<script type=text/javascript src=/js/enadis.js></script>
<script type=text/javascript src=script.js></script>
<link type=text/css rel=stylesheet href=style.css />
}
source assets.jim
puts "
@@ -281,7 +259,7 @@ set stub ""
foreach part [split $dir /] {
if {$stub eq "/"} { set name $part } else { set name "/$part" }
append stub $name
puts "<a href=\"$env(SCRIPT_NAME)?dir=[cgi_quote_url $stub]\">$name</a>"
puts "<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $stub]>$name</a>
}
puts "<span class=filesize id=dirsize></span>"
puts "</legend>"
@@ -291,7 +269,7 @@ set parent [join [lrange [split $dir /] 0 end-1] /]
if {$parent ne ""} {
puts "
<div class=va>
<a href=\"$env(SCRIPT_NAME)?dir=[cgi_quote_url $parent]\">
<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $parent]>
<img border=0 src=/images/711_3_09_Media_Folder_UP.png class=va>
\[parent directory\]</a>
</div>
@@ -316,9 +294,9 @@ proc s_time {a b} {
}
if {[catch {file stat $a l}]} { return 0}
set at $l(mtime)
set at $l(ctime)
if {[catch {file stat $b l}]} { return 0}
set bt $l(mtime)
set bt $l(ctime)
if {$at < $bt} { return -1 }
if {$at > $bt} { return 1 }
@@ -328,17 +306,12 @@ proc s_time {a b} {
set files [readdir -nocomplain $dir]
switch $order {
1 { set files [lsort -command s_time $files] }
default { set files [lsort -nocase $files] }
default { set files [lsort $files] }
}
set dinuse [system dirinuse $dir]
foreach file $files { entry "$dir/$file" }
puts "
<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>
&nbsp;&nbsp;
Directories: $dircount, Files: $filecount
"
puts "<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>"
# Sort icons
puts "<div id=sortdiv>"
@@ -351,7 +324,7 @@ foreach sl $sortlist {
set tag "Currently sorting"
if {$order != $index} {
puts "
<a href=\"$env(SCRIPT_NAME)?$env(QUERY_STRING)&order=$index\">"
<a href=$env(REQUEST_URI)?$env(QUERY_STRING)&order=$index>"
set tag "Sort"
}
puts "<img class=va border=0 src=/img/$img.gif> $tag by $descr"
@@ -387,7 +360,7 @@ puts {
}
# Join
if {$nicesplice} {
if $nicesplice {
puts { <button id=join>Join</button> }
}

View File

@@ -4,14 +4,18 @@ package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size
jqplugin progressbar touchpunch
jscss join.js join.css
header
cgi_input 1
#cgi_dump
puts "
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />
<link href=join.css rel=stylesheet type=text/css />
<script type=text/javascript src=/js/jquery.progressbar.js></script>
<script type=text/javascript src=/js/touchbridge.js></script>
<script type/text/javascript src=join.js></script>
<p><b>
Drag the files below into order, enter a name for the resulting file and then
click the <i>Join</i> button.</b>

View File

@@ -5,8 +5,6 @@ package require cgi
source /mod/webif/lib/setup
require ts.class system.class
jqplugin progressbar
jscss mpg.js
header
set rfile [cgi_get file]
@@ -15,6 +13,9 @@ set dir [file dirname $rfile]
set len [$ts duration 1]
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 src=mpg.js></script>
<fieldset class=cleft>
<legend>Extract to MPG</legend>

View File

@@ -14,7 +14,6 @@ if {[set ts [ts fetch $file]] != 0} {
if {[$ts set_$action]} {
puts "Successfully marked $file as $action."
ts resetnew [file dirname $file]
} else {
puts "Problem marking $file as $action,
[$ts get error]"

View File

@@ -15,11 +15,10 @@ foreach dir [glob -nocomplain "$root"] {
if {[file exists "$dir/.series"]} {
set fd [open "$dir/.series"]
set bytes [read $fd 8]
$fd close
set recs [unpack $bytes -uintle 0 32]
set plays [unpack $bytes -uintle 32 32]
set diff $($recs - $plays)
if {$diff > 0} {
if {$diff != 0} {
set node [lindex [split $dir /] end]
puts "\"$node\": $diff,"
}

View File

@@ -0,0 +1,45 @@
#!/mod/bin/jimsh
package require cgi
package require pack
source /mod/webif/lib/setup
require ts.class hexdump
httpheader
set dir [cgi_get dir]
if {![file isdirectory $dir]} { exit }
if {![file exists "$dir/.series"]} { exit }
set tot 0
set watched 0
foreach file [readdir -nocomplain $dir] {
if {![string match {*.ts} $file]} { continue }
#puts "FILE: $file"
incr tot
if {[set ts [ts fetch "$dir/$file"]] != 0} {
if {![$ts flag "New"]} { incr watched }
}
}
set fd [open "$dir/.series"]
set bytes [read $fd]
close $fd
set recs [unpack $bytes -uintle 0 32]
set played [unpack $bytes -uintle 32 32]
puts "Current: $played/$recs"
#hexdump $bytes
puts "Calculated: $watched/$tot"
pack bytes $tot -intle 32 0
pack bytes $watched -intle 32 32
#hexdump $bytes
set fd [open "$dir/.series" "w"]
puts -nonewline $fd $bytes
close $fd

View File

@@ -1,13 +1,4 @@
var plugins = {
menu: {},
menu_prepare: {},
omenu: {},
omenu_prepare: {},
dmenu: {},
dmenu_prepare: {}
};
var dir;
function disableall()
@@ -124,13 +115,7 @@ function set_folder_new(folder, cnt)
folder = folder.replace(/ /g, '');
folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
//console.log("Folder: (%s) = (%s)", folder, cnt);
left = cnt > 99 ? 11 : (cnt > 9 ? 14 : 17);
$('#img' + folder)
.attr('src', '/img/Folder_New.png')
.next('span.foldernum')
.css('left', left + 'px')
.text(cnt)
.show();
$('#img' + folder).attr('src', '/img/Folder_New.png');
}
function new_folder_callback(data, status, xhr)
@@ -140,6 +125,24 @@ function new_folder_callback(data, status, xhr)
$.each(data, set_folder_new);
}
//function insert_shrunk(file, perc)
//{
// if (perc == 0)
// {
// file = file.replace(/[ ]/g, '');
// file = file.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
// //console.log("File: (%s) = (%s)", file, perc);
// $('#sp_' + file).show();
// }
//}
//function shrunk_callback(data, status, xhr)
//{
// //console.log("Status: %s", status);
// //console.dir(data);
// $.each(data, insert_shrunk);
//}
function delete_callback(file, dir, id)
{
var el = 'div.bf#' + id;
@@ -175,20 +178,6 @@ function new_callback(file, type, id)
$.get(url, function() { window.location.reload(true); });
}
function thumbnail_callback(file, type, id)
{
var el = 'div.bf#' + id;
var results = el + ' .results';
$(results)
.html('<img src=/img/loading.gif>Generating thumbnail, ' +
'please wait...')
.slideDown('slow')
.load('/browse/thumbnail.jim?file=' + file)
.delay(3000)
.slideUp('slow');
$('div.bf#' + id + ' img.opt').attr('thmok', 1);
}
function rename_submit()
{
var s = $('#renameform_form').serialize();
@@ -211,14 +200,6 @@ function aexpiry_submit()
function() { window.location.reload(true); });
}
function aexpiry_remove()
{
$('#aexpiry_working').slideDown('slow');
var s = $('#aexpiry_form').serialize();
$.get('/browse/aexpiry.jim?act=remove&' + s,
function() { window.location.reload(true); });
}
function newdir_submit()
{
var s = $('#newdirform_form').serialize();
@@ -230,7 +211,6 @@ function savestream_submit()
{
var s = $('#savestream_form').serialize();
var sf = $('#save_stream').attr('file');
$('#savestream_name').disable();
$('#savestream_spin').show();
$.get('/browse/savestream.jim?sfile=' +
encodeURIComponent(sf) + '&' + s,
@@ -277,20 +257,7 @@ function preparemenu(el, menu)
else
$(menu).disableContextMenuItems('#crop');
if (el.attr('odencd') == 0)
$(menu).enableContextMenuItems('#thm');
else
$(menu).disableContextMenuItems('#thm');
if (el.attr('shrunk') == 0)
$(menu).enableContextMenuItems('#strip');
else
$(menu).disableContextMenuItems('#strip');
if (el.attr('thmok') == 1)
$(menu).enableContextMenuItems('#vthm');
else
$(menu).disableContextMenuItems('#vthm');
$(menu).enableContextMenuItems('#strip');
if (el.attr('rsize') > 4294967296)
$(menu).enableContextMenuItems('#chunk');
@@ -303,6 +270,7 @@ function preparemenu(el, menu)
else
$(menu).changeContextMenuItem('#new', 'Mark new');
$(menu).enableContextMenuItems('#lock');
if (el.attr('locked') == 1)
{
@@ -343,18 +311,6 @@ function preparemenu(el, menu)
$(menu).disableContextMenuItems('#new');
}
$.each(plugins.menu_prepare, function(k,v) {
plugins.menu_prepare[k](el, menu);
});
}
function prepareomenu(el, menu)
{
$(menu).enableContextMenuItems('#delete');
$.each(plugins.omenu_prepare, function(k,v) {
plugins.omenu_prepare[k](el, menu);
});
}
function fixdmenu(el, menu, flag, tag, descr, recurse)
@@ -403,30 +359,10 @@ function preparedmenu(el, menu)
fixdmenu(el, menu, 'autodecrypt', '#decrypt', 'Auto-decrypt', 1);
fixdmenu(el, menu, 'autompg', '#mpg', 'Auto-mpg', 0);
fixdmenu(el, menu, 'automp3', '#mp3', 'Auto-audio', 0);
//fixdmenu(el, menu, 'autoexpire', '#expire', 'Auto-expire', 0);
$.each(plugins.dmenu_prepare, function(k,v) {
plugins.dmenu_prepare[k](el, menu);
});
fixdmenu(el, menu, 'autoexpire', '#expire', 'Auto-expire', 0);
}
function flagdir(file, flag, iconset, output, options)
{
var url = '/browse/flagdir.jim?dir=' + file +
'&flag=' + flag;
$(output).slideDown().load(url, function() {
$(iconset)
.empty()
.html('<img src=/img/loading.gif> Updating...')
.load('/browse/iconset.jim?file=' + file);
if ($(options).attr(flag) == '1')
$(options).attr(flag, 0);
else
$(options).attr(flag, 1);
}).delay(3000).slideUp();
}
$(function() {
$(document).ready(function() {
dir = $('#dir').text();
@@ -488,21 +424,6 @@ var menuclick = function(action, el, pos)
$('#renameform').dialog('open');
break;
case 'thm':
window.location.href = '/browse/thumbnail/index.jim?file=' +
file;
break;
case 'vthm':
$('#thmbmp').attr('src', 'bmp.jim?file=' + file);
$('#bmpdialogue').dialog('open');
break;
case 'bmarks':
window.location.href = '/browse/bookmarks/?file=' +
file;
break;
case 'download':
window.location.href = '/browse/download.jim?file=' +
file + '&base=' +
@@ -540,38 +461,27 @@ var menuclick = function(action, el, pos)
break;
default:
if (plugins.menu[action])
plugins.menu[action](file);
else
alert('Unhandled action: ' + action);
alert('Unhandled action: ' + action);
break;
}
};
var omenuclick = function(action, el, pos)
function flagdir(file, flag, iconset, output, options)
{
switch (action)
{
case 'delete':
case 'copy':
case 'cut':
case 'rename':
case 'download':
menuclick(action, el, pos);
break;
var url = '/browse/flagdir.jim?dir=' + file +
'&flag=' + flag;
default:
if (plugins.omenu[action])
{
var file = $(el).parent().prevAll('a.bf')
.last().attr('file');
plugins.omenu[action](file);
}
$(output).load(url, function() {
$(iconset)
.empty()
.html('<img src=/img/loading.gif> Updating...')
.load('/browse/iconset.jim?file=' + file);
if ($(options).attr(flag) == '1')
$(options).attr(flag, 0);
else
alert('Unhandled action: ' + action);
break;
}
};
$(options).attr(flag, 1);
}).delay(3000).slideUp();
}
var dmenuclick = function(action, el, pos)
{
@@ -633,37 +543,19 @@ var dmenuclick = function(action, el, pos)
break;
case 'expire':
$('#aexpiry_ldir').val(decodeURIComponent(file));
// Initialise form with default values
$('#aexpiry_days').val("");
$('#aexpiry_timetype0').prop('checked', true);
$('#aexpiry_min').val("");
$('#aexpiry_unwatched').prop('checked', false);
$('#aexpiry_form input').disable();
$('#aexpiry_working').hide('fast');
$('#aexpiry_loading').show('fast');
$.getJSON('aexpiry.jim?act=fetch&dir=' + file, function(data) {
$.each(data, function(key, val) {
if (key == 'days')
$('#aexpiry_days').val(val);
else if (key == 'keep')
$('#aexpiry_min').val(val);
else if (key == 'keepnew')
$('#aexpiry_unwatched')
.prop('checked',
val == "1" ? true : false);
else if (key == 'type')
$('#aexpiry_timetype' + val)
.prop('checked', true);
});
$('#aexpiry_loading').hide('slow');
$('#aexpiry_form input').enable();
});
$('#aexpiry').dialog('open');
if ($(el).attr('autoexpire') == 1)
flagdir(file, 'autoexpire', iconset, results, el);
else
{
$('#aexpiry_ldir').val(decodeURIComponent(file));
if ($(el).attr('autoexpiredays') > 0)
$('#aexpiry_days')
.val($(el).attr('autoexpiredays'));
else
$('#aexpiry_days').val(7);
$('#aexpiry_working').hide('fast');
$('#aexpiry').dialog('open');
}
break;
case 'flat':
@@ -704,10 +596,7 @@ var dmenuclick = function(action, el, pos)
break;
default:
if (plugins.dmenu[action])
plugins.dmenu[action](file, iconset, results, el);
else
alert('Unhandled action: ' + action);
alert('Unhandled action: ' + action);
break;
}
};
@@ -727,9 +616,9 @@ var dmenuclick = function(action, el, pos)
{
menu: 'ooptmenu',
leftButton: true,
beforeShow: prepareomenu
beforeShow: preparemenu
},
omenuclick
menuclick
);
$('img.dopt').contextMenu(
@@ -839,7 +728,6 @@ var dmenuclick = function(action, el, pos)
modal: true,
buttons: {
"Update": aexpiry_submit,
"Remove Settings": aexpiry_remove,
"Close": function() {
$(this).dialog('close');
}
@@ -860,23 +748,6 @@ var dmenuclick = function(action, el, pos)
close: function() { $('#savestream_name').val(''); }
});
$('#savestream_name').keyup(function(e) {
if (e.keyCode == $.ui.keyCode.ENTER)
savestream_submit();
});
$('#bmpdialogue').dialog({
autoOpen: false,
height: 'auto', width: 'auto',
modal: true,
buttons: {
"Close": function() {
$(this).dialog('close');
}
},
close: function() { $('#thmbmp').attr('src', 'about:blank'); }
});
// Create re-usable confirmation dialogue.
$confirm = $('#confirm').dialog({
modal: true, autoOpen: false,
@@ -889,6 +760,10 @@ var dmenuclick = function(action, el, pos)
$.getJSON('/browse/sizes.jim?dir=' + encodeURIComponent(dir),
folder_size_callback);
// Flag shrunk recordings
// $.getJSON('/browse/shrunk.jim?dir=' + encodeURIComponent(dir),
// shrunk_callback);
// Flag folders with unwatched items
$.getJSON('/browse/newdir.jim?dir=' + encodeURIComponent(dir),
new_folder_callback);
@@ -897,7 +772,7 @@ var dmenuclick = function(action, el, pos)
reloadclipboard();
// Uncheck everything
$('input.fs:checked').prop('checked', false);
$('input.fs:checked').attr('checked', false);
// Buttons
@@ -907,29 +782,20 @@ var dmenuclick = function(action, el, pos)
});
$('#save_stream').button().click(function() {
$('#savestream_retrieving').show();
$('#savestream_detail').text('').hide();
$('#savestream_spin').hide();
$('#savestream_name').val('').enable();
$('#savestreamform').dialog('open');
$('#savestream_detail').load(
'/browse/ffmpeg.jim?file=' +
encodeURIComponent($('#save_stream').attr('file')),
function() {
$('#savestream_retrieving').hide();
$('#savestream_detail').show();
$('#savestream_form').show();
});
encodeURIComponent($('#save_stream').attr('file')));
});
$('#selectall').click(function(e) {
e.preventDefault();
$('input.fs').prop('checked', true).trigger('change');
$('input.fs').attr('checked', true).trigger('change');
});
$('#deselectall').click(function(e) {
e.preventDefault();
$('input.fs:checked').prop('checked', false).trigger('change');
$('input.fs:checked').attr('checked', false).trigger('change');
});
$('#join').button().disable()
@@ -1000,7 +866,7 @@ var dmenuclick = function(action, el, pos)
'path': files
}, function() {
reloadclipboard();
$('input.fs:checked').prop('checked', false);
$('input.fs:checked').attr('checked', false);
});
});

View File

@@ -28,11 +28,10 @@ if {[file exists "$origdir/$shname.ts"]} {
}
puts "Moving recording to $origdir"
set tail [file tail $base]
foreach ext $tsgroup {
if {![file exists "$base.$ext"]} continue
puts " $tail.$ext"
file rename "$base.$ext" "${origdir}/$tail.$ext"
foreach f [glob -nocomplain "${base}.*"] {
set tail [file tail $f]
puts " $tail"
file rename $f "$origdir/$tail"
}
puts [exec /mod/bin/stripts \
@@ -40,10 +39,6 @@ puts [exec /mod/bin/stripts \
"$dir/$shname" \
]
# Set the file time to match the old file
ts touchgroup "$dir/$shname.ts" "$origdir/$shname.ts"
set newname "$shname-[clock seconds]"
puts "Renaming file group to $newname"
ts renamegroup "$dir/$shname.ts" $newname

View File

@@ -4,8 +4,6 @@ package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size
jqplugin progressbar
jscss strip.js
header
set rfile [cgi_get file]
@@ -17,6 +15,10 @@ set len [$ts duration 1]
set esttime $([$ts size] / 5700000)
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 src=strip.js></script>
<fieldset class=cleft>
<legend>Make recordings smaller by removing unecessary frames</legend>

View 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'); }

View File

@@ -7,12 +7,11 @@
height: 78px;
font-size: 13px;
line-height: 1.5em;
background: url(/img/bubble.png) left top no-repeat;
background: url('/img/bubble.png') left top no-repeat;
padding: 10px 0 0 0;
text-shadow: 0px 1px 0px #fff;
margin-left: -7em;
margin-top: -6em;
z-index: 1000;
opacity: 0;
}
@@ -25,7 +24,7 @@
height: 21px;
color: #fff;
text-shadow: 0px 1px 0px #000;
background: url(/img/button.png) left top no-repeat;
background: url('/img/button.png') left top no-repeat;
}
.jcatitle {

View File

@@ -72,11 +72,5 @@
.contextMenu LI.mpg A { background-image: url(/img/context/mpg.png); }
.contextMenu LI.mp3 A { background-image: url(/img/context/mp3.png); }
.contextMenu LI.clock A { background-image: url(/img/context/clock.png); }
.contextMenu LI.thm A { background-image: url(/img/context/thumb.png); }
.contextMenu LI.bookmark A { background-image: url(/img/context/bookmark.png); }
.contextMenu LI.lock A { background-image: url(/img/context/lock.png); }
.contextMenu LI.rename A { background-image: url(/img/context/rename.png); }
.contextMenu LI.download A { background-image: url(/img/context/download.png); }
.contextMenu LI.new A { background-image: url(/img/context/new.png); }

View File

@@ -21,15 +21,6 @@ html>body
{
clear: left;
}
.right, .cright
{
float: right;
}
.cright
{
clear: right;
}
fieldset.left, fieldset.cleft
{
display: inline;
@@ -68,46 +59,19 @@ div.container .middle
height: 116px;
}
div.container .usb
{
position: absolute;
left: -5px;
top: 8px;
}
div.footer
{
clear: both;
padding-top: 2em;
}
div.owarningbox
div.warningbox
{
background: url('/img/redshade.png') repeat-x;
padding: 0.5em;
margin: 1em;
}
div.warningbox
{
width: 60%;
background: url('/img/redshade.png') repeat-x;
background-size: 100%;
#color: #005000;
border: 1px solid #7a4707;
padding: 10px;
position: relative;
top: -2px;
left: -2px;
font-weight: bold;
z-index: 30;
box-shadow: 2px 2px 11px #666;
-moz-box-shadow: 2px 2px 11px #666;
-webkit-box-shadow: 2px 2px 11px #666;
border-radius: 5px;
-moz-border-radius: 5px;
}
table
{
empty-cells: show;
@@ -235,7 +199,7 @@ pre, .pre
.blood
{
color: #ff4000 !important;
color: #ff4000;
background: transparent;
}
@@ -245,18 +209,14 @@ pre, .pre
background: transparent;
}
.footnote, .bfootnote
.footnote
{
color: #ff4000;
background: transparent;
font-size: 70%;
font-weight: bold;
}
.footnote
{
color: #ff4000 !important;
}
.blueshade
{
background: #b9daff;
@@ -380,7 +340,6 @@ div.cut
div.toolbarouter
{
position: relative;
z-index: 29;
}
div.toolbar
@@ -402,11 +361,6 @@ div.toolbar
padding: 6px;
}
#status
{
width: 60%;
}
span.toolbarcell
{
float: left;
@@ -453,94 +407,6 @@ button.red
div#restart_block
{
text-align: center;
z-index: 31;
float: right;
width: 60%;
position: absolute;
top: 10px;
left: 100px;
background-color: #f8f8f8;
opacity: 0.9;
filter:alpha(opacity=90);
}
img.bmp, img.doublebmp
{
transform: scaleY(-1);
-webkit-transform: scaleY(-1);
-o-transform: scaleY(-1);
height: 78px;
width: 140px;
}
img.doublebmp
{
height: 156px;
width: 280px;
}
.relative
{
position: relative;
}
span.foldernum
{
display: none;
position: absolute;
left: 14px;
top: 9px;
color: white;
height: 15px;
line-height: 16px;
background-color: #CC0000;
background: linear-gradient(#FF0000, #CC0000) repeat scroll 0 0 #EEEEEE;
font-size: 10px;
border: 1px solid #660000;
padding: 0 2px 0 2px;
border-radius: 1em 1em 1em 1em;
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
border-top-right-radius: 1em;
border-top-left-radius: 1em;
border-bottom-right-radius: 1em;
border-bottom-left-radius: 1em;
}
#tbdiskspace
{
float: right;
padding-top: 1.2em;
position: relative;
right: -10px;
}
#tbdiskpie
{
float: right;
width: 150px;
height: 150px;
position: relative;
right: -10px;
}
.tbdiskpie
{
top: -10px !important;
}
#usbejectinfo
{
position: relative;
border: 1px solid #899caa;
box-shadow: 2px 2px 11px #666;
-moz-box-shadow: 2px 2px 11px #666;
-webkit-box-shadow: 2px 2px 11px #666;
border-radius: 5px;
-moz-border-radius: 5px;
background: #d2e0ea;
padding: 6px;
z-index: 40;
}

View File

@@ -111,8 +111,3 @@ button#later
margin-left: 2em;
}
.jcaquestion
{
margin-left: 0px !important;
}

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