Compare commits
275 Commits
0.13.2@182
...
0.13.2@214
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
070fd7a749 | ||
|
|
2f570f6ea0 | ||
|
|
fa8b6d7e7c | ||
|
|
d466b5cc15 | ||
|
|
dae5f9394b | ||
|
|
22320536ee | ||
|
|
39d7dab2a9 | ||
|
|
8ec75e783d | ||
|
|
909342eb1c | ||
|
|
2ab6f7caa2 | ||
|
|
f116cc5801 | ||
|
|
9d75b810c8 | ||
|
|
d2f61fb70e | ||
|
|
1ff5b8ec0e | ||
|
|
52939392ba | ||
|
|
1964f4dfad | ||
|
|
d649456cfe | ||
|
|
f550931f71 | ||
|
|
a294c084b3 | ||
|
|
7172c7c107 | ||
|
|
f7933beaf8 | ||
|
|
3dbc3cbf82 | ||
|
|
41047e8668 | ||
|
|
d6df19dd32 | ||
|
|
79bff00465 | ||
|
|
4ce9701792 | ||
|
|
6ff5b7a8e3 | ||
|
|
25523058f0 | ||
|
|
d661c8016e | ||
|
|
ebcd6cdbf7 | ||
|
|
4fe5bd1bff | ||
|
|
d5679ead84 | ||
|
|
e666711eeb | ||
|
|
775add8c04 | ||
|
|
d4dc56b816 | ||
|
|
e720740507 | ||
|
|
3c327ff80d | ||
|
|
d05632e8d3 | ||
|
|
c208e186c3 | ||
|
|
328ca16b5c | ||
|
|
e15b82fe2d | ||
|
|
0a2c7966b5 | ||
|
|
57b78c4c0d | ||
|
|
eb0adb8f29 | ||
|
|
6e06f3875a | ||
|
|
b691be415a | ||
|
|
c149d7ae3c | ||
|
|
38757583bb | ||
|
|
dec82728cb | ||
|
|
49170bdd39 | ||
|
|
1bf67cf177 | ||
|
|
e669a3d08f | ||
|
|
39ed7752bc | ||
|
|
e4f61f4047 | ||
|
|
4e36ecc6f0 | ||
|
|
d2712f2a76 | ||
|
|
24d26aee75 | ||
|
|
39b3dee3e1 | ||
|
|
3d3f7d17ed | ||
|
|
89a68cf538 | ||
|
|
51db7b1e36 | ||
|
|
9d8d630b07 | ||
|
|
101f5a7946 | ||
|
|
50346e5d4b | ||
|
|
f0d22b3b01 | ||
|
|
7356e6e220 | ||
|
|
7d1331f1aa | ||
|
|
895dda6dee | ||
|
|
d7284ff3ef | ||
|
|
d04dcee369 | ||
|
|
db4f7cf122 | ||
|
|
015b992fcb | ||
|
|
a41c2ae6f9 | ||
|
|
f56d226cf8 | ||
|
|
5b5485dd4c | ||
|
|
1b11c7959b | ||
|
|
df72a42abf | ||
|
|
6d95ee89a4 | ||
|
|
57c769a4e8 | ||
|
|
020e1b707c | ||
|
|
3b8863a4b4 | ||
|
|
b45fe08fe2 | ||
|
|
a5c65505e4 | ||
|
|
6ab9318fa9 | ||
|
|
52728ba471 | ||
|
|
68ae915f57 | ||
|
|
3d0152e475 | ||
|
|
87060ef8e2 | ||
|
|
46dad281f5 | ||
|
|
f14b2a8b2e | ||
|
|
79a09e1df6 | ||
|
|
2de66b4f3c | ||
|
|
2bbf69f820 | ||
|
|
8fb6570882 | ||
|
|
df8d655cc8 | ||
|
|
d8914e2311 | ||
|
|
3afef45f86 | ||
|
|
4ae2604f0a | ||
|
|
973a7cdacf | ||
|
|
aadac18796 | ||
|
|
955217bdd2 | ||
|
|
1dbd659ddb | ||
|
|
57515b2941 | ||
|
|
ef1e7b82e8 | ||
|
|
1a7cb41a16 | ||
|
|
7a66306f78 | ||
|
|
a014fec23d | ||
|
|
d307699ab1 | ||
|
|
3f6e8754c6 | ||
|
|
742a56485a | ||
|
|
fa9905d8bd | ||
|
|
a3ecbe1d3f | ||
|
|
924bc72832 | ||
|
|
909605b074 | ||
|
|
f62904edb4 | ||
|
|
8d36fe22dd | ||
|
|
2e0d49537d | ||
|
|
572e31efcc | ||
|
|
8ec03f2636 | ||
|
|
95bef6f458 | ||
|
|
44038eb7a1 | ||
|
|
ae607a6071 | ||
|
|
c5de79b214 | ||
|
|
fa839705fc | ||
|
|
3d75b93f1a | ||
|
|
602f96e1ac | ||
|
|
3312a76cc6 | ||
|
|
88026872d9 | ||
|
|
ce2dfa8338 | ||
|
|
6e2a0f3e2b | ||
|
|
ccb513be49 | ||
|
|
84b5cb9506 | ||
|
|
337a2add7a | ||
|
|
4706fe6bcd | ||
|
|
88d78a7d42 | ||
|
|
b442fef333 | ||
|
|
f771f55017 | ||
|
|
267ba4fade | ||
|
|
c2ec779465 | ||
|
|
75b31696c5 | ||
|
|
f54d162298 | ||
|
|
2a0bcbc81e | ||
|
|
4d3183ea61 | ||
|
|
7c038a1776 | ||
|
|
822de81971 | ||
|
|
09e71400a2 | ||
|
|
18cafc8c39 | ||
|
|
593b7dbb89 | ||
|
|
de47e46fe7 | ||
|
|
509c98ee74 | ||
|
|
ddb63e68b7 | ||
|
|
5de2ba1c37 | ||
|
|
43f6281410 | ||
|
|
8166af0f1b | ||
|
|
25344c5ff4 | ||
|
|
b6ce0e3b16 | ||
|
|
a189b524ab | ||
|
|
84b00010a8 | ||
|
|
993958d346 | ||
|
|
1045587fbd | ||
|
|
659fd40fe9 | ||
|
|
fcb4615c82 | ||
|
|
8146627f18 | ||
|
|
99dde5a4a5 | ||
|
|
d04d3bdb15 | ||
|
|
78d49d419a | ||
|
|
df67594f29 | ||
|
|
8cc2ef3d3f | ||
|
|
ac93144789 | ||
|
|
93ebdce4e1 | ||
|
|
9ba7c3dba8 | ||
|
|
436db53de3 | ||
|
|
ebe6a0f64c | ||
|
|
20b2a7e2dc | ||
|
|
258c3b76af | ||
|
|
e87cc8586e | ||
|
|
eace5c5260 | ||
|
|
15e33ab751 | ||
|
|
fa5561d200 | ||
|
|
64da76ed64 | ||
|
|
86424d065c | ||
|
|
2128aded40 | ||
|
|
218ff8edfb | ||
|
|
02f7c5aad9 | ||
|
|
0fa394eaa1 | ||
|
|
8949bfaa02 | ||
|
|
c3a41bed59 | ||
|
|
903a4453bb | ||
|
|
761def1a24 | ||
|
|
e832d05b17 | ||
|
|
3b8720c6d4 | ||
|
|
2fb26975e2 | ||
|
|
93f1b67ba1 | ||
|
|
6daa4e28f5 | ||
|
|
9a72e40c03 | ||
|
|
9b2f138fd9 | ||
|
|
22db1fbbd6 | ||
|
|
a9f4bd4f0b | ||
|
|
31688eaa1c | ||
|
|
926a49737a | ||
|
|
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 |
@@ -1,10 +1,9 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 0.5.1
|
||||
Version: 0.13.2
|
||||
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)
|
||||
Replaces: af123-webif
|
||||
Conflicts: af123-webif
|
||||
Description: A web interface for the Humax. In development.
|
||||
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.
|
||||
|
||||
42
CONTROL/postinst
Executable file
42
CONTROL/postinst
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Postinstall $*"
|
||||
|
||||
export tmpf=/tmp/cronf.$$
|
||||
|
||||
# Add cron jobs
|
||||
|
||||
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
|
||||
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 &
|
||||
|
||||
[ -f /tmp/webif_auto.log ] && rm -f /tmp/webif_auto.log
|
||||
|
||||
if [ ! -f /mod/webif/.strip-updated ]; then
|
||||
echo "*********************************"
|
||||
echo "* Please wait while any shrunk recordings are flagged..."
|
||||
echo "*********************************"
|
||||
/mod/webif/lib/bin/strip-update
|
||||
|
||||
touch /mod/webif/.strip-updated
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
17
CONTROL/prerm
Executable file
17
CONTROL/prerm
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
export tmpf=/tmp/cronf.$$
|
||||
|
||||
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
|
||||
grep -v 'backup/backup.jim' $ana > $tmpf
|
||||
cp $tmpf $ana
|
||||
|
||||
exit 0
|
||||
|
||||
1
bin/status
Symbolic link
1
bin/status
Symbolic link
@@ -0,0 +1 @@
|
||||
../webif/cgi-bin/status.jim
|
||||
24
etc/init.d/S60parseepg
Executable file
24
etc/init.d/S60parseepg
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "`cat /etc/model`" = HD ]; then
|
||||
epg=/media/drive1/epgsavedata
|
||||
epgdb=/media/drive1/epg.db
|
||||
else
|
||||
epg=/mnt/hd1/dvbepg/epg.dat
|
||||
epgdb=/mnt/hd1/epg.db
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/mod/bin/epg -f $epg sqlitedumpd $epgdb > /tmp/epgd.log 2>&1 &
|
||||
;;
|
||||
stop)
|
||||
killall -q epg
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
83
var/mongoose/cgi-bin/backup/backup.jim
Executable file
83
var/mongoose/cgi-bin/backup/backup.jim
Executable 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
|
||||
|
||||
70
var/mongoose/cgi-bin/backup/backup.js
Executable file
70
var/mongoose/cgi-bin/backup/backup.js
Executable file
@@ -0,0 +1,70 @@
|
||||
|
||||
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);
|
||||
$('#view_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:checked').val();
|
||||
if (confirm('Confirm deletion of ' + backup))
|
||||
{
|
||||
$('#results').load('/cgi-bin/backup/delete.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#view_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
$('#results').load('/cgi-bin/backup/view.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#restore_button').click(function() {
|
||||
var backup = $('input.restore:checked').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');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
25
var/mongoose/cgi-bin/backup/delete.jim
Executable file
25
var/mongoose/cgi-bin/backup/delete.jim
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
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."
|
||||
} elseif {[catch { file delete $ffile } msg]} {
|
||||
puts "Deletion failed: $msg"
|
||||
} else {
|
||||
puts "Successfully deleted <i>$file</i>"
|
||||
}
|
||||
|
||||
48
var/mongoose/cgi-bin/backup/files.jim
Executable file
48
var/mongoose/cgi-bin/backup/files.jim
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
proc s_time {a b} {
|
||||
file stat $a l
|
||||
set at $l(ctime)
|
||||
file stat $b l
|
||||
set bt $l(ctime)
|
||||
|
||||
if {$at < $bt} { return -1 }
|
||||
if {$at > $bt} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
set backups [lsort -command s_time [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>
|
||||
"
|
||||
}
|
||||
|
||||
135
var/mongoose/cgi-bin/backup/restore.jim
Executable file
135
var/mongoose/cgi-bin/backup/restore.jim
Executable 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
|
||||
|
||||
54
var/mongoose/cgi-bin/backup/view.jim
Executable file
54
var/mongoose/cgi-bin/backup/view.jim
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
require rsv.class findhsvc
|
||||
|
||||
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 "Listing scheduled events from <i>$file</i>..."
|
||||
|
||||
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]
|
||||
|
||||
puts " [$rsv name] ([$rsv channel_name])"
|
||||
}
|
||||
|
||||
close $fd
|
||||
rsv cleanup
|
||||
|
||||
@@ -1,351 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
set ignore {.nts .thm .hmt .hmi}
|
||||
set standard {.avi .mpg .wmv .mkv}
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
#set _cgi(tsfile) "/media/My Video/Family Guy/2.19._Excellence_in_Broadcasting.ts"
|
||||
#set _cgi(action) "delete"
|
||||
#set env(REQUEST_URI) ''
|
||||
|
||||
proc tsfile {file bfile {ajax 0}} {{i 0}} {
|
||||
set ts [ts fetch $file]
|
||||
if {$ajax == 0} { puts "<div class=\"va tsfile\" id=[incr i]>" }
|
||||
puts "
|
||||
<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>"
|
||||
}
|
||||
set locked 0
|
||||
if {[$ts flag "Locked"] > 0} {
|
||||
set locked 1
|
||||
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 locked=$locked
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
"
|
||||
if {$ajax == 0} { puts "</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>
|
||||
"
|
||||
}
|
||||
|
||||
proc directory {file bfile} {
|
||||
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>"
|
||||
}
|
||||
|
||||
proc entry {file {ajax 0}} {
|
||||
set bfile [lindex [split $file /] end]
|
||||
if {[string index $bfile 0] == "\025"} {
|
||||
set bfile [string range $bfile 1 end]
|
||||
}
|
||||
if [file isdirectory "$file"] {
|
||||
directory $file $bfile
|
||||
continue
|
||||
}
|
||||
set ext [file extension $file]
|
||||
if {$ext eq ".ts"} {
|
||||
tsfile $file $bfile $ajax
|
||||
continue
|
||||
}
|
||||
if {$ext in $::ignore} { continue }
|
||||
if {$ext in $::standard} {
|
||||
genfile $file $bfile
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if {[dict exists $_cgi tsfile]} {
|
||||
set file [dict get $_cgi tsfile]
|
||||
set ts [ts fetch $file]
|
||||
|
||||
if {[dict exists $_cgi action]} {
|
||||
switch [dict get $_cgi action] {
|
||||
entry {
|
||||
entry $file 1
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
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>
|
||||
"
|
||||
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>[$ts size] MiB</td>
|
||||
</tr><tr>
|
||||
<th>Flags</th>
|
||||
<td>[$ts get flags]</td>
|
||||
</tr>
|
||||
</table>
|
||||
"
|
||||
exit
|
||||
}
|
||||
|
||||
if {[dict exists $_cgi dir]} {
|
||||
set dir [dict get $_cgi dir]
|
||||
} else {
|
||||
set dir "/media/My Video"
|
||||
}
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
|
||||
puts {
|
||||
|
||||
<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>
|
||||
|
||||
<div id=dialogue></div>
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
|
||||
<script type=text/javascript>
|
||||
function bindmenu(selector)
|
||||
{
|
||||
$(selector).contextMenu(
|
||||
{
|
||||
menu: 'optmenu',
|
||||
leftButton: true,
|
||||
beforeShow:
|
||||
function(el, menu)
|
||||
{
|
||||
if (el.attr('locked') == 1)
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Unlock');
|
||||
$('#optmenu').disableContextMenuItems('#delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Lock');
|
||||
$('#optmenu').enableContextMenuItems('#delete');
|
||||
}
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
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', function() {
|
||||
bindmenu(el + ' img.opt');
|
||||
});;
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// 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() {
|
||||
|
||||
$('#optmenu').disableContextMenuItems('#rename,#title');
|
||||
bindmenu('img.opt');
|
||||
|
||||
$('a.ts').click(function(e) {
|
||||
e.preventDefault();
|
||||
var file = $(this).attr('file');
|
||||
var url = window.location.pathname + '?tsfile=' +
|
||||
encodeURIComponent(file);
|
||||
$('#dialogue').load(url);
|
||||
$dialog.dialog('open');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
puts { <div style="border: 1px solid grey; padding: 1em"> }
|
||||
|
||||
# Breadcrumb path
|
||||
puts "<h1>"
|
||||
set stub ""
|
||||
foreach part [split $dir /] {
|
||||
if {$stub eq "/"} { set name $part } else { set name "/$part" }
|
||||
append stub $name
|
||||
puts "<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $stub]>$name</a>
|
||||
}
|
||||
puts "</h1>"
|
||||
|
||||
set parent [join [lrange [split $dir /] 0 end-1] /]
|
||||
if {$parent ne ""} {
|
||||
puts "
|
||||
<div class=va>
|
||||
<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $parent]>
|
||||
<img src=/images/711_3_09_Media_Folder_UP.png class=va>
|
||||
\[parent directory\]</a>
|
||||
</div>
|
||||
"
|
||||
}
|
||||
|
||||
regsub -all -- {\/+} "$dir/*" "/" dir
|
||||
|
||||
foreach file [lsort [glob -nocomplain "$dir"]] {
|
||||
entry $file
|
||||
}
|
||||
|
||||
puts "</div>"
|
||||
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
|
||||
25
var/mongoose/cgi-bin/cat.jim
Executable file
25
var/mongoose/cgi-bin/cat.jim
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class chunked pretty_size
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set file [cgi_get file "-"]
|
||||
if {$file eq "-"} { exit }
|
||||
|
||||
start_chunked
|
||||
|
||||
if {![file exists $file]} {
|
||||
chunk ">>> File $file does not exist.\r\n"
|
||||
} else {
|
||||
chunk ">>> Contents of $file [pretty_size [file size $file]]\r\n"
|
||||
set fp [open $file r]
|
||||
chunk [read $fp]
|
||||
close $fp
|
||||
}
|
||||
|
||||
end_chunked
|
||||
|
||||
18
var/mongoose/cgi-bin/cfwreset.cgi
Executable file
18
var/mongoose/cgi-bin/cfwreset.cgi
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -n "$QUERY_STRING" ] && rma="${QUERY_STRING##*=}" || rma=0
|
||||
|
||||
echo "Content-Type: text/plain"
|
||||
echo
|
||||
|
||||
if [ "$rma" = 1 ]; then
|
||||
modver="`cat /etc/modversion`"
|
||||
if [ "$modver" -ge 215 ]; then
|
||||
touch /var/lib/humaxtv_backup/.rma
|
||||
else
|
||||
touch /var/lib/humaxtv/.rma
|
||||
fi
|
||||
else
|
||||
touch /var/lib/humaxtv/mod/_RESET_CUSTOM_FIRMWARE_ENVIRONMENT
|
||||
fi
|
||||
|
||||
134
var/mongoose/cgi-bin/channel.jim
Executable file
134
var/mongoose/cgi-bin/channel.jim
Executable file
@@ -0,0 +1,134 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/webif/lib/setup
|
||||
require altrow progressbar epg.class
|
||||
|
||||
header
|
||||
|
||||
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>Network</th>
|
||||
<th>Mux</th>
|
||||
<th>Channels</th>
|
||||
<th>>799</th>
|
||||
</tr>
|
||||
"
|
||||
foreach tw [$db query {
|
||||
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
|
||||
|
||||
altrow
|
||||
puts "
|
||||
<td>[f2c $ulFrequency]</td>
|
||||
<td>[expr $ulFrequency / 1000.0] MHz</td>
|
||||
"
|
||||
puts "<td>[progressbar $ucLevel]</td>"
|
||||
puts "<td>[progressbar $ucQuality]</td>"
|
||||
puts "<td>[string range $netName 3 end]</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]
|
||||
|
||||
set mux "Local"
|
||||
set ehs 0
|
||||
foreach chan $channels {
|
||||
lassign $chan x lcn x name
|
||||
set name [string range $name 1 end]
|
||||
if {$lcn >= 800} { incr ehs }
|
||||
switch $name {
|
||||
"BBC ONE" { set mux "PSB1/BBC A" }
|
||||
"ITV1" { set mux "PSB2/D3&4" }
|
||||
"ITV" { set mux "PSB2/D3&4" }
|
||||
"BBC One HD" { set mux "PSB3/BBC B (HD)" }
|
||||
"ITV3" { set mux "COM4/SDN" }
|
||||
"Dave" { set mux "COM5/ARQ A" }
|
||||
"Film4" { set mux "COM6/ARQ B" }
|
||||
"Movies4Men" { set mux "Local" }
|
||||
}
|
||||
}
|
||||
puts "<td>$mux</td>"
|
||||
|
||||
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 "<td>$ehs</th>"
|
||||
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>
|
||||
}
|
||||
|
||||
74
var/mongoose/cgi-bin/db.jim
Executable file
74
var/mongoose/cgi-bin/db.jim
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/webif/lib/setup
|
||||
require altrow
|
||||
|
||||
set databases [glob /var/lib/humaxtv/*.db]
|
||||
lappend databases "/mnt/hd2/dms_cds.db"
|
||||
|
||||
header
|
||||
|
||||
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 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
|
||||
|
||||
9
var/mongoose/cgi-bin/env.jim
Executable file
9
var/mongoose/cgi-bin/env.jim
Executable 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)"
|
||||
}
|
||||
|
||||
23
var/mongoose/cgi-bin/epg/db.jim
Executable file
23
var/mongoose/cgi-bin/epg/db.jim
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
PATH=$PATH:/mod/bin export PATH
|
||||
|
||||
echo "Content-Type: text/plain"
|
||||
echo ""
|
||||
|
||||
[ -n "$QUERY_STRING" ] && data="${QUERY_STRING##*=}" || data=epg
|
||||
|
||||
case $data in
|
||||
channels)
|
||||
sqlite3 -header -batch -separator ' ' \
|
||||
/var/lib/humaxtv/channel.db '
|
||||
select * from TBL_SVC;
|
||||
'
|
||||
;;
|
||||
|
||||
|
||||
*) /mod/bin/epg -p dump ;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
27
var/mongoose/cgi-bin/epg/dump.jim
Executable file
27
var/mongoose/cgi-bin/epg/dump.jim
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class
|
||||
|
||||
header
|
||||
|
||||
set service [cgi_get service]
|
||||
set event [cgi_get event]
|
||||
set raw [cgi_get raw]
|
||||
|
||||
puts "<pre>"
|
||||
if { $raw == 0 } {
|
||||
puts [epg exec dump -raw 1 -service $service -event $event]
|
||||
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]
|
||||
}
|
||||
|
||||
puts "</pre>"
|
||||
|
||||
epg cleanup
|
||||
|
||||
footer
|
||||
|
||||
135
var/mongoose/cgi-bin/epg/info.jim
Executable file
135
var/mongoose/cgi-bin/epg/info.jim
Executable file
@@ -0,0 +1,135 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class
|
||||
|
||||
httpheader
|
||||
|
||||
set service [cgi_get service 0]
|
||||
set event [cgi_get event 0]
|
||||
if {![cgi_exists bare]} header
|
||||
|
||||
set record [lindex [epg fetch dump -service $service -event $event] 0]
|
||||
$record get_channel_info
|
||||
set others [$record othertimes]
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Programme</th>
|
||||
<td>[$record get name]</td>
|
||||
</tr><tr>
|
||||
<th>Synopsis</th>
|
||||
<td>[$record get text]</td>
|
||||
</tr><tr>
|
||||
<th>Start</th>
|
||||
<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]
|
||||
"
|
||||
if {[$record showing]} {
|
||||
puts [progressbar [$record percent]]
|
||||
}
|
||||
puts "
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Type</th>
|
||||
<td>[$record get content_type] ([$record get content_code])</td>
|
||||
</tr>
|
||||
"
|
||||
|
||||
if {[$record get warning] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th>Warning</th>
|
||||
<td>[$record get warning]</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
if {[$record get event_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<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>
|
||||
"
|
||||
}
|
||||
|
||||
if {[$record get series_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th nowrap>Series CRID</th><td>
|
||||
<a href=/cgi-bin/epg/search.jim?scrid=[$record get series_crid]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$record get channel_crid][$record get series_crid]
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
if {[$record get rec_crid] != ""} {
|
||||
set rec [$record recommended]
|
||||
if {$rec != ""} {
|
||||
puts "<tr><th>Recommends</th><td>
|
||||
<a href=/cgi-bin/epg/search.jim?crid=[$rec get event_crid]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$rec get name]
|
||||
([$rec get channel_crid][$rec get event_crid])
|
||||
</a>
|
||||
</td></tr>"
|
||||
}
|
||||
}
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<td colspan=2 valign=top>
|
||||
[$record channel_icon 70]
|
||||
[join [$record icon_set] " "]
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a class=footnote href=/cgi-bin/epg/dump.jim?service=[$record get service_id]&event=[$record get event_id]&raw=1>
|
||||
<img border=0 src=/images/532_1_00_Find_Path_Arrow.png>
|
||||
Show raw EPG info
|
||||
</a>
|
||||
"
|
||||
|
||||
puts "<div id=epginfo_extra class=footnote></div>"
|
||||
|
||||
epg cleanup
|
||||
if {![cgi_exists bare]} footer
|
||||
|
||||
38
var/mongoose/cgi-bin/epg/schedule.jim
Executable file
38
var/mongoose/cgi-bin/epg/schedule.jim
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set service [cgi_get service -]
|
||||
set event [cgi_get event -]
|
||||
set type [cgi_get type 1]
|
||||
|
||||
if {$service eq "-" || $event eq "-"} {
|
||||
puts "Error, insufficient parameters passed."
|
||||
exit
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
127
var/mongoose/cgi-bin/epg/search.jim
Executable file
127
var/mongoose/cgi-bin/epg/search.jim
Executable file
@@ -0,0 +1,127 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class spinner.class altrow settings.class
|
||||
|
||||
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 ""]
|
||||
|
||||
if {[cgi_exists term]} {
|
||||
set lterm [cgi_get term]
|
||||
|
||||
if {[string match {CRID:*} $lterm]} {
|
||||
set crid [string range $lterm 5 end]
|
||||
} elseif {[string match {SCRID:*} $lterm]} {
|
||||
set scrid [string range $lterm 6 end]
|
||||
}
|
||||
} elseif {$crid ne ""} {
|
||||
set _cgi(term) "CRID:$crid"
|
||||
} elseif {$scrid ne ""} {
|
||||
set _cgi(term) "SCRID:$scrid"
|
||||
}
|
||||
|
||||
require epg_search
|
||||
|
||||
[spinner new {
|
||||
text "Searching EPG..."
|
||||
size "1.2em"
|
||||
style "margin: 1em;"
|
||||
}] start
|
||||
|
||||
require epg_popup
|
||||
|
||||
set cmd "search"
|
||||
if {$searchfull} { set cmd "searchall" }
|
||||
|
||||
set dedup 0
|
||||
if {$ct > 0 } {
|
||||
set records [epg fetch dump -type $ct]
|
||||
if {[[settings] genrededup]} { set dedup 1 }
|
||||
} elseif {$crid ne ""} {
|
||||
set records [epg fetch dump -crid $crid]
|
||||
} elseif {$scrid ne ""} {
|
||||
set records [epg fetch dump -scrid $scrid]
|
||||
} elseif {$searchterm ne ""} {
|
||||
set records [epg dbfetch $cmd -term $searchterm]
|
||||
} else {
|
||||
set records {}
|
||||
}
|
||||
|
||||
set favlist [epg favlist]
|
||||
|
||||
if {[llength $records] > 0} {
|
||||
puts {
|
||||
<table class=borders id=results style="clear: both;margin: 0.5em 0 0 0">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th colspan=3>Channel</th>
|
||||
<th>Programme</th>
|
||||
<th>Synopsis</th>
|
||||
</tr>
|
||||
}
|
||||
} else {
|
||||
puts "No results found."
|
||||
}
|
||||
|
||||
proc rsort {v1 v2} {
|
||||
set v1s [$v1 get start]
|
||||
set v2s [$v2 get start]
|
||||
|
||||
if {$v1s == $v2s} { return 0 }
|
||||
if {$v1s > $v2s } { return 1 }
|
||||
return -1
|
||||
}
|
||||
|
||||
set seen {}
|
||||
set i 0
|
||||
foreach record [lsort -command rsort $records] {
|
||||
if {$dedup} {
|
||||
set ename [$record get name]
|
||||
if {$ename in $seen} continue
|
||||
lappend seen $ename
|
||||
}
|
||||
|
||||
if {$favlist != "" && [$record get service_id] ni $favlist} {
|
||||
continue
|
||||
}
|
||||
altrow
|
||||
$record get_channel_info
|
||||
|
||||
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"]"
|
||||
puts "</td>"
|
||||
puts "<td>[$record get channel_num]</td>"
|
||||
puts "<td>[$record channel_icon 50]</td>"
|
||||
puts "<td nowrap>
|
||||
<a href=/cgi-bin/epg/service.jim?service=[$record get service_id]>
|
||||
[$record get channel_name]
|
||||
</a></td>"
|
||||
puts [$record cell]
|
||||
puts "<td>[$record get text]</td><td>[$record get warning]</td>"
|
||||
puts "</tr>"
|
||||
}
|
||||
puts "</table>"
|
||||
|
||||
if {$searchterm != ""} {
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
\$('#results').highlight('$searchterm');
|
||||
</script>
|
||||
"
|
||||
}
|
||||
|
||||
epg cleanup
|
||||
footer
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
#!/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/webif/lib/setup
|
||||
require epg.class spinner.class altrow
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
header
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
require totop
|
||||
|
||||
[spinner new {
|
||||
text "Loading EPG Data..."
|
||||
@@ -17,15 +14,9 @@ source /mod/var/mongoose/html/lib/header.jim
|
||||
style "margin: 1em;"
|
||||
}] start
|
||||
|
||||
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 +47,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
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set service 0
|
||||
set service 4351
|
||||
catch { set service [dict get $_cgi service] }
|
||||
set event 0
|
||||
catch { set event [dict get $_cgi event] }
|
||||
set raw 0
|
||||
catch { set raw [dict get $_cgi raw] }
|
||||
|
||||
puts "<pre>"
|
||||
if { $raw == 0 } {
|
||||
puts [epg exec dump -raw 1 -service $service -event $event]
|
||||
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]
|
||||
}
|
||||
|
||||
puts "</pre>"
|
||||
|
||||
epg cleanup
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
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 record [lindex [epg fetch dump -service $service -event $event] 0]
|
||||
$record get_channel_info
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Programme</th>
|
||||
<td>[$record get name]</td>
|
||||
</tr><tr>
|
||||
<th>Synopsis</th>
|
||||
<td>[$record get text]</td>
|
||||
</tr><tr>
|
||||
<th>Start</th>
|
||||
<td>[clock format [$record get start] -format {%c %Z}]</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[clock format [$record get duration] -format %T]</td>
|
||||
</tr><tr>
|
||||
<th>Type</th>
|
||||
<td>[$record get content_type] ([$record get content_code])</td>
|
||||
</tr>
|
||||
"
|
||||
|
||||
if {[$record get warning] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th>Warning</th>
|
||||
<td>[$record get warning]</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
if {[$record get event_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th>CRID</th>
|
||||
<td>[$record get channel_crid][$record get event_crid]</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
if {[$record get series_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th nowrap>Series CRID</th><td>
|
||||
<a href=/cgi-bin/epg_search.jim?scrid=[$record get series_crid]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$record get channel_crid][$record get series_crid]
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
if {[$record get rec_crid] != ""} {
|
||||
set rec [$record recommended]
|
||||
if {$rec != ""} {
|
||||
puts "<tr><th>Recommends</th><td>
|
||||
<a href=/cgi-bin/epg_search.jim?crid=[$rec get event_crid]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$rec get name]
|
||||
([$rec get channel_crid][$rec get event_crid])
|
||||
</a>
|
||||
</td></tr>"
|
||||
}
|
||||
}
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<td colspan=2 valign=top>
|
||||
[$record channel_icon 70]
|
||||
[join [$record icon_set] " "]
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a class=footnote href=/cgi-bin/epg_dump.jim?service=[$record get service_id]&event=[$record get event_id]&raw=1>
|
||||
<img border=0 src=/images/532_1_00_Find_Path_Arrow.png>
|
||||
Show raw EPG info
|
||||
</a>
|
||||
"
|
||||
|
||||
epg cleanup
|
||||
if {! [dict exists $_cgi bare]} {
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
#!/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
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
|
||||
puts "<script type=text/javascript src=/js/highlight.js></script>"
|
||||
|
||||
source /mod/var/mongoose/lib/epg_popup
|
||||
|
||||
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 ""
|
||||
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>
|
||||
"
|
||||
|
||||
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>"
|
||||
}
|
||||
puts "</tr>"
|
||||
}
|
||||
puts "</table>"
|
||||
|
||||
$db close
|
||||
|
||||
puts "</form>"
|
||||
|
||||
if {$ct > 0 } {
|
||||
set records [epg fetch dump -type $ct]
|
||||
} elseif {$crid ne ""} {
|
||||
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]
|
||||
}
|
||||
|
||||
set favlist [epg favlist]
|
||||
|
||||
puts {
|
||||
<table class=borders id=results style="clear: both;margin: 0.5em 0 0 0">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th colspan=3>Channel</th>
|
||||
<th>Programme</th>
|
||||
<th>Synopsis</th>
|
||||
</tr>
|
||||
}
|
||||
|
||||
proc rsort {v1 v2} {
|
||||
set v1s [$v1 get start]
|
||||
set v2s [$v2 get start]
|
||||
|
||||
if {$v1s == $v2s} { return 0 }
|
||||
if {$v1s > $v2s } { return 1 }
|
||||
return -1
|
||||
}
|
||||
|
||||
set i 0
|
||||
foreach record [lsort -command rsort $records] {
|
||||
if {$favlist != "" && [$record get service_id] ni $favlist} {
|
||||
continue
|
||||
}
|
||||
altrow
|
||||
$record get_channel_info
|
||||
puts "<td nowrap>
|
||||
[clock format [$record get start] -format "%a %d %b %Y"]<br>
|
||||
[clock format [$record get start] -format "%H:%M %Z"]</td>"
|
||||
puts "<td>[$record get channel_num]</td>"
|
||||
puts "<td>[$record channel_icon 50]</td>"
|
||||
puts "<td nowrap>
|
||||
<a href=/cgi-bin/epg_service.jim?service=[$record get service_id]>
|
||||
[$record get channel_name]
|
||||
</a></td>"
|
||||
puts [$record cell]
|
||||
puts "<td>[$record get text]</td><td>[$record get warning]</td>"
|
||||
puts "</tr>"
|
||||
flush stdout
|
||||
}
|
||||
puts "</table>"
|
||||
|
||||
if {$term != ""} {
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
highlight(document.getElementById(\"results\"), \"$term\");
|
||||
</script>
|
||||
"
|
||||
}
|
||||
|
||||
epg cleanup
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
|
||||
39
var/mongoose/cgi-bin/opkg.jim
Executable file
39
var/mongoose/cgi-bin/opkg.jim
Executable 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
|
||||
|
||||
59
var/mongoose/cgi-bin/restart.jim
Executable file
59
var/mongoose/cgi-bin/restart.jim
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require rsv.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
if {[cgi_get act] eq "cancel"} {
|
||||
file delete /tmp/.restartpending
|
||||
exit
|
||||
}
|
||||
|
||||
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()", 350);
|
||||
$.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
7
var/mongoose/cgi-bin/restartblock.jim
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
httpheader
|
||||
|
||||
source /mod/webif/include/restart.jim
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
httpheader
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
catch { set service [dict get $_cgi service] }
|
||||
catch { set action [dict get $_cgi action] }
|
||||
set service [cgi_get service]
|
||||
set action [cgi_get action]
|
||||
|
||||
catch { puts [exec /mod/bin/service $action $service] }
|
||||
|
||||
|
||||
@@ -1,24 +1,49 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/var/mongoose/lib/settings.class
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class plugin system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
httpheader
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
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
|
||||
|
||||
#set _cgi(smtp_server) "fred.bob"
|
||||
#set env(REQUEST_URI) ''
|
||||
if {![dict exists $env REQUEST_URI]} { set env(REQUEST_URI) "" }
|
||||
|
||||
proc _handle_update {class var old text} {
|
||||
global _cgi
|
||||
@@ -49,54 +74,138 @@ 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"
|
||||
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"
|
||||
|
||||
source /mod/var/mongoose/html/lib/header.jim
|
||||
puts {<script type="text/javascript" src="/js/jquery.form.js"></script>}
|
||||
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>
|
||||
$(document).ready(function () {
|
||||
//$(":submit").button();
|
||||
//$(":submit").height(20);
|
||||
$('form').each(function(i, el) {
|
||||
var id = $(this).attr('id');
|
||||
var output = '#' + id + '_output'
|
||||
$(this).ajaxForm({
|
||||
target: output,
|
||||
success: function() {
|
||||
$(output).css('font-style', 'italic');
|
||||
$(output).show('slow');
|
||||
$(output).delay(2000).fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<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 "
|
||||
<h1>Settings</h1>
|
||||
<table class=keyval>
|
||||
<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>
|
||||
</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 id=smtp_server method=get action=$env(REQUEST_URI)>
|
||||
<th>SMTP Server for outbound email</th>
|
||||
<td><input name=smtp_server value=\"$smtp_server\"
|
||||
length=20 maxlength=50>
|
||||
<input id=smtp_server_submit value=\"change\" type=submit>
|
||||
<div id=smtp_server_output></div>
|
||||
<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>
|
||||
@@ -104,10 +213,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
|
||||
value=[$settings channel_group]>
|
||||
class=\"text ui-widget-content ui-corner-all\">
|
||||
"
|
||||
|
||||
set i 0
|
||||
@@ -123,7 +232,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>
|
||||
@@ -131,12 +242,201 @@ puts "
|
||||
"
|
||||
|
||||
puts "
|
||||
</table>
|
||||
</form>
|
||||
<br>
|
||||
More coming soon...
|
||||
<br>
|
||||
<br>
|
||||
<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\">
|
||||
"
|
||||
source /mod/var/mongoose/html/lib/footer.jim
|
||||
|
||||
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> </td></tr>"
|
||||
puts "<tr><td colspan=5> </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
|
||||
|
||||
|
||||
160
var/mongoose/cgi-bin/settings.js
Normal file
160
var/mongoose/cgi-bin/settings.js
Normal 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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,54 +1,183 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class findhsvc epg.class rsv.class
|
||||
|
||||
#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>"
|
||||
set runmode cli
|
||||
if {[string match {*jim} $argv0]} { set runmode cgi }
|
||||
|
||||
if {[catch {set pid [exec pgrep humaxtv]}]} { exit }
|
||||
|
||||
if {[catch {set data [exec lsof -p $pid | grep Video | fgrep .ts]} ]} {
|
||||
exit
|
||||
set schedtime 1200
|
||||
case $runmode {
|
||||
cgi {
|
||||
set type [cgi_get type "full"]
|
||||
httpheader
|
||||
}
|
||||
cli {
|
||||
set type "full"
|
||||
if {"-X" in $argv} { set schedtime 7200 }
|
||||
}
|
||||
}
|
||||
|
||||
set lines [split $data "\n"]
|
||||
foreach line $lines {
|
||||
regsub -all -- {[[:space:]]+} $line " " line
|
||||
set fields [split $line " "]
|
||||
set name [lindex [split $line "/"] end]
|
||||
set size($name) [lindex $fields 6]
|
||||
set seen($name) 0
|
||||
if {[catch {set pid [exec pgrep humaxtv]}]} {
|
||||
puts "Cannot find humaxtv process."
|
||||
exit
|
||||
}
|
||||
|
||||
sleep 2
|
||||
proc get_data {} {
|
||||
global pid
|
||||
|
||||
set data [exec lsof -p $pid | grep Video | fgrep .ts]
|
||||
regsub -all -- {[[:space:]]+} $line " " line
|
||||
set lines [split $data "\n"]
|
||||
foreach line $lines {
|
||||
regsub -all -- {[[:space:]]+} $line " " line
|
||||
set fields [split $line " "]
|
||||
set name [lindex [split $line "/"] end]
|
||||
set size2 [lindex $fields 6]
|
||||
|
||||
if { $size2 > $size($name) && $seen($name) < 1 } {
|
||||
set mode "Recording"
|
||||
set icon "745_1_11_Video_1REC.png"
|
||||
set ret {}
|
||||
if {[catch {set data \
|
||||
[exec /mod/bin/lsof -p $pid | grep Video | fgrep .ts]} ]} {
|
||||
set ret {}
|
||||
} else {
|
||||
set mode "Watching"
|
||||
set icon "745_1_10_Video_2Live.png"
|
||||
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
|
||||
}
|
||||
|
||||
incr seen($name)
|
||||
set play 0
|
||||
set rec 0
|
||||
set seen {}
|
||||
set output {}
|
||||
|
||||
lappend output "<img style=\"vertical-align: middle\"
|
||||
src=/images/$icon><span
|
||||
style=\"vertical-align: middle\">$mode $name</span>"
|
||||
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 <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]} {
|
||||
puts [join $output " "]
|
||||
if {$runmode eq "cgi"} {
|
||||
puts [join $output "\n<br>\n"]
|
||||
} else {
|
||||
puts [join $output "\n"]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
282
var/mongoose/cgi-bin/xepg.jim
Executable file
282
var/mongoose/cgi-bin/xepg.jim
Executable file
@@ -0,0 +1,282 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
header
|
||||
|
||||
require epg.class spinner.class altrow epg_search totop
|
||||
|
||||
puts {
|
||||
<link type="text/css" href="/css/xepg.css" rel="Stylesheet" />
|
||||
<script type=text/javascript src=/js/enadis.js></script>
|
||||
}
|
||||
|
||||
[spinner new {
|
||||
text "Loading EPG Information..."
|
||||
size "1.2em"
|
||||
style "margin: 1em;"
|
||||
}] start
|
||||
|
||||
require epg_popup
|
||||
|
||||
set now [clock seconds]
|
||||
set stt [cgi_get stt $now]
|
||||
if {$stt <= $now} {
|
||||
set stt $now
|
||||
set current 1
|
||||
} else {
|
||||
set current 0
|
||||
}
|
||||
|
||||
set favgroup [[settings] channel_group]
|
||||
|
||||
set hours [expr 1.0 * [[settings] xepghours]]
|
||||
if {$hours == 0} { set hours 4.0 }
|
||||
set seconds $($hours * 3600)
|
||||
|
||||
set ostt $stt
|
||||
set stt [expr int($stt / 1800.0) * 1800]
|
||||
|
||||
set ett $(int($stt + $seconds))
|
||||
set offset $(($ostt - $stt) / 1800.0)
|
||||
|
||||
set chanpx 160
|
||||
set eventpx 1000
|
||||
set totalpx $($chanpx + $eventpx)
|
||||
set contwidth $($totalpx + 50)
|
||||
|
||||
set hourpx $($eventpx / $hours)
|
||||
set minpx $($hourpx / 60.0)
|
||||
set secpx $($minpx / 60.0)
|
||||
|
||||
set start [clock milliseconds]
|
||||
if {$::qepg} {
|
||||
if {$favgroup} {
|
||||
set records [epg dbfetch dump \
|
||||
-trange "$stt:$ett" -fav $favgroup]
|
||||
} else {
|
||||
set records [epg dbfetch dump -trange "$stt:$ett"]
|
||||
}
|
||||
|
||||
} else {
|
||||
require channelsort
|
||||
set records [channelsort [epg fetch dump -trange "$stt:$ett"]]
|
||||
}
|
||||
set got [clock milliseconds]
|
||||
|
||||
proc but {label time {active 1}} {
|
||||
puts -nonewline "<button style=\"margin-right: 2em\" tt=$time"
|
||||
if {$active} {
|
||||
puts -nonewline " class=nav"
|
||||
} else {
|
||||
puts -nonewline " disabled class=\"nav ui-state-disabled\""
|
||||
}
|
||||
puts " active=$active>$label</button>"
|
||||
}
|
||||
|
||||
puts "<!-- Hours $hours ($seconds) -->"
|
||||
puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
|
||||
|
||||
but "<< -1 Week" $($stt - 3600 * 24 * 7) \
|
||||
$($stt - $now + 3600 >= 3600 * 24 * 7)
|
||||
but "<< -1 Day" $($stt - 3600 * 24) $($stt - $now >= 3600 * 23)
|
||||
but "<< Earlier", $($stt - 3600 * 4) $($stt > $now)
|
||||
but "< Now >" $now $($current == 0)
|
||||
but ">> Later" $ett;
|
||||
but ">> +1 Day" $($stt + 3600 * 24) $($stt < $now + 8 * 3600 * 24)
|
||||
but ">> +1 Week" $($stt + 3600 * 24 * 7) $($stt < $now + 8 * 3600 * 24)
|
||||
|
||||
puts "</div>"
|
||||
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
\$('button.nav').button();
|
||||
</script>
|
||||
<div id=xepg style=\"min-width: ${contwidth}px; overflow: auto\">
|
||||
<div id=xepgnow></div>
|
||||
<div id=xegrid>
|
||||
"
|
||||
|
||||
puts "<div id=epgdate style=\"width: ${eventpx}px; margin-left: ${chanpx}px;\">"
|
||||
puts [clock format $stt -format {%a %d/%m/%Y}]
|
||||
puts "<input type=hidden id=xepg_dp stt=$stt>"
|
||||
puts "</div>"
|
||||
|
||||
puts "<div class=xechan style=\"width: ${chanpx}px;\"> </div>"
|
||||
for {set i 0} {$i < $hours * 2} {incr i} {
|
||||
puts "<div class=xetime id=xe$i
|
||||
style=\"width: [expr $minpx * 30]px\">"
|
||||
puts "[clock format $($stt + 1800 * $i) -format "%H:%M"]</div>"
|
||||
}
|
||||
|
||||
set lim 0
|
||||
set lcn 0
|
||||
set bg "odd"
|
||||
|
||||
foreach e $records {
|
||||
set chnum [$e get channel_num]
|
||||
if {$chnum == 0} { continue }
|
||||
|
||||
if {$chnum != $lcn} {
|
||||
puts "<div class=xechan style=\"width: ${chanpx}px;\">"
|
||||
|
||||
puts "[$e channel_icon 30] "
|
||||
puts "$chnum
|
||||
<a href=/cgi-bin/epg/service.jim?service=[$e get service_id]
|
||||
title=\"[$e get channel_name]\">
|
||||
[$e get channel_name]
|
||||
</a></div>"
|
||||
|
||||
set lcn $chnum
|
||||
set le 0
|
||||
set pos 0
|
||||
if {$bg eq "odd"} { set bg "even" } else { set bg "odd" }
|
||||
}
|
||||
|
||||
set es [$e get start]
|
||||
set ee [expr $es + [$e get duration]]
|
||||
|
||||
if {$es < $le} continue
|
||||
|
||||
if {$es < $stt} { set es $stt }
|
||||
if {$ee > $ett} { set ee $ett }
|
||||
set le $ee
|
||||
|
||||
set left [expr int(($es - $stt) * $secpx)]
|
||||
set right [expr int(($ee - $stt - 1) * $secpx)]
|
||||
set px $($right - $left)
|
||||
if {$pos < $left} {
|
||||
set px $($px + $left - $pos - 1)
|
||||
} elseif {$pos > $left} {
|
||||
set px $($px - ($pos - $left - 1))
|
||||
}
|
||||
incr pos $px
|
||||
|
||||
$e process_sched
|
||||
|
||||
set recopts 1
|
||||
if {[$e get series_crid] ne ""} { set recopts 2 }
|
||||
|
||||
set perc [$e percent]
|
||||
set showing 0
|
||||
if {$perc > 0 && $perc < 100} { set showing 1 }
|
||||
|
||||
set txt "[cgi_quote_html [$e get name]] <span>([\
|
||||
clock format $es -format "%H:%M"] - [\
|
||||
clock format $ee -format "%H:%M"])"
|
||||
if {$showing} { append txt " ($perc%)" }
|
||||
append txt "</span>"
|
||||
|
||||
set htxt "[cgi_quote_html [$e get name]] ([\
|
||||
clock format $es -format "%H:%M"] - [\
|
||||
clock format $ee -format "%H:%M"])"
|
||||
if {$showing} { append hxt " ($perc%)" }
|
||||
|
||||
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]
|
||||
rec=$recopts>"
|
||||
puts $txt
|
||||
puts "</a>"
|
||||
puts "</div>"
|
||||
}
|
||||
puts "<div id=keypos style=\"float: left; clear: left;\"></div>"
|
||||
puts "</div>"
|
||||
puts "</div>"
|
||||
|
||||
set earlier $($stt - 3600 * 4)
|
||||
|
||||
puts "
|
||||
|
||||
<div style=\"clear: both;\">
|
||||
<small><button id=epgswitch>
|
||||
Switch to standard now/next display.
|
||||
</button></small>
|
||||
</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 {
|
||||
|
||||
var kt = $('#xe0');
|
||||
var ktpos = kt.position();
|
||||
|
||||
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=/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>
|
||||
"
|
||||
|
||||
epg cleanup
|
||||
|
||||
set end [clock milliseconds]
|
||||
puts "<font class=footnote>
|
||||
Retrieved in: [expr [expr $got - $start] / 1000.0] seconds.
|
||||
</font>"
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<!--#exec cmd="/mod/var/mongoose/include/sched.jim" -->
|
||||
<!--#exec cmd="/mod/webif/include/backup.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
24
var/mongoose/html/browse/aexpiry.jim
Executable file
24
var/mongoose/html/browse/aexpiry.jim
Executable 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."
|
||||
|
||||
282
var/mongoose/html/browse/assets.jim
Executable file
282
var/mongoose/html/browse/assets.jim
Executable file
@@ -0,0 +1,282 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
|
||||
<div id=jbar></div>
|
||||
|
||||
<ul id=optmenu class=contextMenu style="width: 160px">
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<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><a href=#rename>Rename</a></li>
|
||||
<li><a href=#download>Download</a></li>
|
||||
|
||||
}
|
||||
if {$model eq "HDR"} {
|
||||
puts { <li class="separator decrypt"><a href=#decrypt>Decrypt</a></li> }
|
||||
puts { <li class="compress"><a href=#strip>Shrink</a></li> }
|
||||
} else {
|
||||
puts { <li class="compress separator"><a href=#strip>Shrink</a></li> }
|
||||
}
|
||||
if {[system pkginst ffmpeg]} {
|
||||
puts {
|
||||
<li><a href=#audio>Extract Audio</a></li>
|
||||
<li><a href=#mpg>Extract to MPG</a></li>
|
||||
}
|
||||
}
|
||||
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><a href=#lock>Toggle Lock</a></li>
|
||||
<li><a href=#new>Toggle New</a></li>
|
||||
</ul>
|
||||
|
||||
<ul id=ooptmenu class=contextMenu style="width: 160px">
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<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><a href=#rename>Rename</a></li>
|
||||
<li><a href=#download>Download</a></li>
|
||||
</ul>
|
||||
|
||||
<ul id=dooptmenu class=contextMenu style="width: 250px">
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<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><a href=#rename>Rename</a></li>
|
||||
</ul>
|
||||
|
||||
<ul id=doptmenu class=contextMenu style="width: 250px">
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<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><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=dedup><a href=#dedup>Auto-Dedup</a></li>
|
||||
}
|
||||
if {$model eq "HDR"} {
|
||||
puts {
|
||||
<li class=decrypt><a href=#decrypt>Auto-Decrypt</a></li>
|
||||
<li class=decryptr><a href=#decryptr>Recursive Auto-Decrypt
|
||||
</a></li>
|
||||
}
|
||||
}
|
||||
if $flatten {
|
||||
puts { <li class="separator"><a href=#flat>No-Flatten</a></li> }
|
||||
}
|
||||
|
||||
puts {
|
||||
<li class=clock><a href=#expire>Auto-Expire</a></li>
|
||||
<li class=mpg><a href=#mpg>Auto-MPG Extract</a></li>
|
||||
</ul>
|
||||
|
||||
<div id=renameform title="Rename media file" style="display: none">
|
||||
<form id=renameform_form>
|
||||
<input type=hidden name="renamefile" id="renamefile" 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="rename_title" style="padding-top: 0.5em">
|
||||
<b>New Medialist Title</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="rename_title" id="rename_title"
|
||||
value="" size=70 maxlength=48
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="rename_synopsis" style="padding-top: 0.5em">
|
||||
<b>New Synopsis</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<textarea name="rename_synopsis" id="rename_synopsis"
|
||||
value="" cols=70 rows=4
|
||||
class="text ui-widget-content ui-corner-all"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="rename_guidance" style="padding-top: 0.5em">
|
||||
<b>New Guidance Text</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="rename_guidance" id="rename_guidance"
|
||||
value="" size=70 maxlength=74
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="rename_genre" style="padding-top: 0.5em">
|
||||
<b>New Genre</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<select name="rename_genre" id="rename_genre"
|
||||
style="vertical-align: middle"
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
}
|
||||
|
||||
set glist [ts genrelist]
|
||||
foreach genre [array names glist] {
|
||||
lassign $glist($genre) txt img
|
||||
if {$img eq "Unclassified"} {
|
||||
set img /images/173_3_26_G3_$img.png
|
||||
} else {
|
||||
set img /images/173_3_00_G3_$img.png
|
||||
}
|
||||
puts "<option value=$genre style=\"
|
||||
background: url($img) no-repeat left;
|
||||
padding: 8px 0 8px 30px;
|
||||
vertical-align: middle;
|
||||
\" onclick=\"this.parentNode.setAttribute('style',
|
||||
this.getAttribute('style'));\">$txt"
|
||||
}
|
||||
|
||||
puts {
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=drenameform title="Rename directory" style="display: none">
|
||||
<form id=drenameform_form>
|
||||
<input type=hidden name="renamefile" id="drenameorig" value="">
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="drename">
|
||||
<b>New Directory Name</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="rename" id="drename"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=savestreamform title="Save streamed content"
|
||||
style="display: none">
|
||||
<div class=pre id=savestream_detail></div>
|
||||
<form id=savestream_form>
|
||||
}
|
||||
puts "<input type=hidden name=dir value=\"$dir\">"
|
||||
puts {
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="savestream_name">
|
||||
<b>Filename</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="savestream_name"
|
||||
id="savestream_name"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
<img id=savestream_spin src=/img/loading.gif>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=newdirform title="New Folder" style="display: none">
|
||||
<form id=newdirform_form>
|
||||
}
|
||||
puts "<input type=hidden name=dir value=\"$dir\">"
|
||||
puts {
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="newdirname">
|
||||
<b>New Folder Name</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="newdirname" id="newdirname"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<label for="aexpiry_days">
|
||||
<b>Expire after</b>
|
||||
<span class=blood>(in days)</span>
|
||||
</label>
|
||||
</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>
|
||||
</table>
|
||||
<div id=aexpiry_working class=hidden>
|
||||
<img src=/img/loading.gif> Applying auto-expiry...
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=dialogue></div>
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
<div id=pwdialogue style="display: none">
|
||||
<center>
|
||||
<img src=/img/loading.gif>
|
||||
<br><br>
|
||||
Please wait...
|
||||
<div id=pwfeedback></div>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
47
var/mongoose/html/browse/audio/audio.jim
Executable file
47
var/mongoose/html/browse/audio/audio.jim
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
header
|
||||
|
||||
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>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
|
||||
</table>
|
||||
|
||||
<span class=hidden id=params
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
rfile=\"[cgi_quote_url $rfile]\"
|
||||
></span>
|
||||
|
||||
<div id=audiodiv style=\"padding: 1em\">
|
||||
<button id=audioit>Perform audio extraction</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Extracting audio: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
35
var/mongoose/html/browse/audio/audio.js
Executable file
35
var/mongoose/html/browse/audio/audio.js
Executable file
@@ -0,0 +1,35 @@
|
||||
|
||||
var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
$.get('progress.jim?file=' + $('#params').attr('rfile'),
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#audioit').button().click(function() {
|
||||
$('#audiodiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').load('execute.jim?file=' + $('#params').attr('rfile'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
36
var/mongoose/html/browse/audio/execute.jim
Executable file
36
var/mongoose/html/browse/audio/execute.jim
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
|
||||
set xstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
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 \
|
||||
--song "[$ts get title]" \
|
||||
--comment "[$ts get synopsis]" \
|
||||
--album "[$ts get channel_name]" \
|
||||
--year "[clock format [$ts get start] -format {%Y}]" \
|
||||
"${base}.mp3"]
|
||||
}
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
23
var/mongoose/html/browse/audio/progress.jim
Executable file
23
var/mongoose/html/browse/audio/progress.jim
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set tsfile [cgi_get file]
|
||||
set rfile [file normalize $tsfile]
|
||||
set bfile [file rootname $rfile]
|
||||
|
||||
if {![file exists "${bfile}.mp3"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [expr [file size "${bfile}.mp3"] / 0.3]
|
||||
|
||||
set perc [expr $nsz * 100 / $sz]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
6
var/mongoose/html/browse/chunk/chunk.css
Normal file
6
var/mongoose/html/browse/chunk/chunk.css
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
div.progressbar
|
||||
{
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
67
var/mongoose/html/browse/chunk/chunk.jim
Executable file
67
var/mongoose/html/browse/chunk/chunk.jim
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
header
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
# 45 minute chunks
|
||||
set max $(45 * 60)
|
||||
|
||||
set len [$ts duration 1]
|
||||
|
||||
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>
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
|
||||
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
|
||||
<tr><th>Time:</th>
|
||||
<td>Splitting will take around [clock format $esttime -format "%T"]</td></tr>
|
||||
"
|
||||
|
||||
set bytesperminute $([$ts size] / ($len / 60))
|
||||
|
||||
while {$len > 0} {
|
||||
incr part
|
||||
incr len -$max
|
||||
puts "<tr class=\"part hidden\">
|
||||
<th>Part $part</th><td>
|
||||
<div id=progresspart$part class=progressbar></div>
|
||||
<div id=progressstat$part class=also>waiting...</div>
|
||||
</td></tr>"
|
||||
}
|
||||
|
||||
puts "
|
||||
</table>
|
||||
<span class=hidden id=params parts=$part bpm=$bytesperminute
|
||||
file=\"[cgi_quote_url $rfile]\">
|
||||
</span>
|
||||
|
||||
<div id=chunkdiv style=\"padding: 1em\">
|
||||
<button id=chunkit>Split recording into $part parts</button>
|
||||
</div>
|
||||
|
||||
<div id=findiv style=\"padding: 1em\" class=hidden>
|
||||
<button id=back dir=\"[cgi_quote_url [file dirname $rfile]]\">
|
||||
Back to Media Browser
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
"
|
||||
|
||||
76
var/mongoose/html/browse/chunk/chunk.js
Normal file
76
var/mongoose/html/browse/chunk/chunk.js
Normal file
@@ -0,0 +1,76 @@
|
||||
var handle;
|
||||
var currentpart = 0;
|
||||
var stime = 0;
|
||||
|
||||
function xprogress()
|
||||
{
|
||||
var file = $('#params').attr('file');
|
||||
var bpm = $('#params').attr('bpm');
|
||||
|
||||
if (currentpart > 0)
|
||||
$.get('progress.jim?part=' + currentpart + '&file=' + file,
|
||||
function(data) {
|
||||
if (currentpart > 0)
|
||||
{
|
||||
perc = (data / bpm) * 100 / 45;
|
||||
$('#progresspart' + currentpart)
|
||||
.reportprogress(perc);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function xpart(part)
|
||||
{
|
||||
var parts = $('#params').attr('parts');
|
||||
var file = $('#params').attr('file');
|
||||
|
||||
if (part++ < parts)
|
||||
{
|
||||
currentpart = part;
|
||||
$('#progressstat' + part)
|
||||
.text('extracting...')
|
||||
.addClass('blood');
|
||||
stime = new Date().getTime();
|
||||
$.get('extract.jim?parts=' + parts +
|
||||
'&part=' + part +
|
||||
'&file=' + file,
|
||||
function(data) {
|
||||
var taken = (new Date().getTime() - stime) / 1000;
|
||||
$('#progressstat' + part)
|
||||
.text('done... (' + taken + ' seconds)')
|
||||
.removeClass('blood');
|
||||
currentpart = 0;
|
||||
$('#progresspart' + part)
|
||||
.reportprogress(100);
|
||||
xpart(part);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
clearInterval(handle);
|
||||
$('#findiv').show('slow');
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
$('div.progressbar').reportprogress(0);
|
||||
|
||||
$('#chunkit').button().click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#chunkdiv').hide('slow');
|
||||
$('tr.part').show('slow');
|
||||
|
||||
handle = setInterval("xprogress()", 1000);
|
||||
xpart(0);
|
||||
});
|
||||
|
||||
$('#back').button().click(function(e) {
|
||||
e.preventDefault();
|
||||
var dir = $(this).attr('dir');
|
||||
|
||||
window.location = '../index.jim?dir=' + dir;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
35
var/mongoose/html/browse/chunk/extract.jim
Executable file
35
var/mongoose/html/browse/chunk/extract.jim
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set part [cgi_get part -]
|
||||
set parts [cgi_get parts "?"]
|
||||
|
||||
if {$part eq "-"} exit
|
||||
|
||||
set start $(($part - 1) * 45 * 600 - 600)
|
||||
set end $($part * 45 * 600 + 600)
|
||||
|
||||
puts "START: $start"
|
||||
puts "END: $end"
|
||||
|
||||
set ts [ts fetch $rfile]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
|
||||
set cmd [list /mod/bin/nicesplice -in $base -out "$base.part$part"]
|
||||
if {$start > 0} { lappend cmd -cut 0 $start }
|
||||
lappend cmd -cut $end 9999999
|
||||
|
||||
puts "CMD: ($cmd)"
|
||||
|
||||
puts [exec {*}$cmd]
|
||||
|
||||
set ts [ts fetch "$base.part$part.ts"]
|
||||
$ts settitle "$part/$parts. [string range [ts get $title] 0 40]"
|
||||
|
||||
14
var/mongoose/html/browse/chunk/progress.jim
Executable file
14
var/mongoose/html/browse/chunk/progress.jim
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
heepheader
|
||||
|
||||
set file [cgi_get file]
|
||||
set part [cgi_get part]
|
||||
|
||||
set rfile "[file rootname $file].part$part"
|
||||
puts [file size $rfile]
|
||||
|
||||
121
var/mongoose/html/browse/clipboard.jim
Executable file
121
var/mongoose/html/browse/clipboard.jim
Executable file
@@ -0,0 +1,121 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require clipboard.class ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
cgi_input 1
|
||||
|
||||
set cb [[clipboard new {path "/tmp/webif-browse.cb"}] load]
|
||||
|
||||
set action [cgi_get act list]
|
||||
|
||||
switch $action {
|
||||
list {
|
||||
if {![$cb size]} {
|
||||
puts "<i>Clipboard is empty</i>"
|
||||
break
|
||||
}
|
||||
puts "<div class=cliplist>"
|
||||
foreach file [$cb get items] {
|
||||
set img "page_white_copy"
|
||||
if {[$file get action] eq "cut"} {
|
||||
set img "cut"
|
||||
}
|
||||
set path [$file get path]
|
||||
set xpath [cgi_quote_html $path]
|
||||
puts "<span title=\"$xpath\" alt=\"$xpath\">"
|
||||
puts "<img src=/img/context/$img.png>"
|
||||
set dfile [file tail $path]
|
||||
if {[string length $dfile] > 25} {
|
||||
set dfile "[string range $dfile 0 22]..."
|
||||
}
|
||||
if {[file isdirectory $path]} {
|
||||
puts "<img height=16
|
||||
src=/images/711_1_09_Media_Folder.png>"
|
||||
}
|
||||
puts [cgi_quote_html $dfile]
|
||||
puts "<a class=clipdel href=# alt=\"Remove\" title=\"Remove\"
|
||||
path=\"[cgi_quote_url $path]\">
|
||||
<img border=0 src=/img/close.png height=16></a>"
|
||||
puts "</span>"
|
||||
}
|
||||
puts "</div>"
|
||||
puts "<button id=paste>Paste to current folder</button>"
|
||||
puts "<button id=clipclear>Empty clipboard</button>"
|
||||
}
|
||||
add {
|
||||
if {[set path [cgi_get path]] eq "0"} {
|
||||
puts "No path."
|
||||
exit
|
||||
}
|
||||
set dir [cgi_unquote_input [cgi_get dir]]
|
||||
set mode [cgi_get mode copy]
|
||||
foreach p $path {
|
||||
set p [cgi_unquote_input $p]
|
||||
if {$dir ne "0" && [string first "$dir/" $p] != 0} {
|
||||
puts "$p not in directory<br>"
|
||||
continue
|
||||
}
|
||||
if {![$cb present $p]} {
|
||||
$cb add $mode $p
|
||||
puts "Added $p for $mode<br>"
|
||||
}
|
||||
}
|
||||
$cb save
|
||||
}
|
||||
remove {
|
||||
$cb remove [cgi_unquote_input [cgi_get path]]
|
||||
$cb save
|
||||
}
|
||||
clear {
|
||||
$cb clear
|
||||
$cb save
|
||||
}
|
||||
paste {
|
||||
set dir [cgi_unquote_input [cgi_get dir]]
|
||||
foreach item [$cb get items] {
|
||||
set path [$item get path]
|
||||
set file [file tail $path]
|
||||
set mode [$item get action]
|
||||
|
||||
puts "Pasting $file"
|
||||
|
||||
if {[file isdirectory $path]} {
|
||||
# Directory
|
||||
if {$mode eq "cut"} {
|
||||
catch {file rename $path "$dir/$file"}
|
||||
} else {
|
||||
catch {puts [exec /mod/bin/busybox/cp -r \
|
||||
$path $dir]}
|
||||
}
|
||||
} elseif {[string match {*.ts} $path]} {
|
||||
set ts [ts fetch $path]
|
||||
if {![catch {$ts get file}]} {
|
||||
foreach f [$ts fileset] {
|
||||
if {$mode eq "cut"} {
|
||||
catch {file rename $f \
|
||||
"$dir/[file tail $f]"}
|
||||
} else {
|
||||
catch {file copy $f \
|
||||
"$dir/[file tail $f]"}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if {$mode eq "cut"} {
|
||||
catch {file rename $path \
|
||||
"$dir/[file tail $path]"}
|
||||
} else {
|
||||
catch {file copy $path \
|
||||
"$dir/[file tail $path]"}
|
||||
}
|
||||
}
|
||||
}
|
||||
$cb clear
|
||||
$cb save
|
||||
}
|
||||
}
|
||||
|
||||
112
var/mongoose/html/browse/crop/crop.jim
Executable file
112
var/mongoose/html/browse/crop/crop.jim
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
header
|
||||
|
||||
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=crop.js></script>
|
||||
|
||||
<fieldset class=cleft>
|
||||
<legend>Crop recording</legend>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format \"%T\"]</td></tr>
|
||||
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
|
||||
<tr><th>Bookmarks:</th><td>[$ts get bookmarks] @ "
|
||||
|
||||
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>"
|
||||
|
||||
puts "<div style=\"position: relative; top: -10px\">"
|
||||
|
||||
proc div {type left right} {
|
||||
set width $($right - $left)
|
||||
puts "<div class=$type style=\"left: ${left}px; width: ${width}px\">
|
||||
$type</div>"
|
||||
}
|
||||
|
||||
set keeping 0
|
||||
set last 0
|
||||
set start -1
|
||||
foreach b [$ts bookmarks] {
|
||||
if {$start < 0} {
|
||||
set start $b
|
||||
continue
|
||||
}
|
||||
set end $b
|
||||
|
||||
incr keeping $($end - $start)
|
||||
|
||||
set left $($start * 500 / $len)
|
||||
set right $($end * 500 / $len)
|
||||
|
||||
div cut $last $($left - 1)
|
||||
div keep $left $($right - 1)
|
||||
|
||||
set last $right
|
||||
|
||||
set start -1
|
||||
}
|
||||
|
||||
if {$start > 0} {
|
||||
incr keeping $($len - $start)
|
||||
set left $($start * 500 / $len)
|
||||
div cut $last $($left - 1)
|
||||
div keep $left 500
|
||||
} else {
|
||||
div cut $last 500
|
||||
}
|
||||
|
||||
set keepperc $($keeping * 100.0 / $len)
|
||||
set esttime $(int($keeping * 0.025))
|
||||
if {[$ts get definition] eq "HD"} { set esttime $($esttime * 4) }
|
||||
|
||||
puts "
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr><th>Keeping:</th><td>
|
||||
[clock format $keeping -format "%T"] ([format "%.2f" $keepperc]%)
|
||||
</td></tr>
|
||||
<tr><th>Time:</th>
|
||||
<td>Cropping will take around [clock format $esttime -format "%T"]</td></tr>
|
||||
</table>
|
||||
|
||||
<span class=hidden id=params
|
||||
file=\"[cgi_quote_url $rfile]\"
|
||||
perc=\"$keepperc\"
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
></span>
|
||||
|
||||
<div id=cropdiv style=\"padding: 1em\">
|
||||
<button id=cropit>Perform crop operation</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Cropping: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
38
var/mongoose/html/browse/crop/crop.js
Executable file
38
var/mongoose/html/browse/crop/crop.js
Executable file
@@ -0,0 +1,38 @@
|
||||
var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
var perc = $('#params').attr('perc');
|
||||
var file = $('#params').attr('file');
|
||||
|
||||
$.get('progress.jim' + '?perc=' + perc + '&file=' + file,
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#cropit').button().click(function() {
|
||||
$('#cropdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').text('Please do not interrupt...')
|
||||
.load('execute.jim?file=' + $('#params').attr('file'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
55
var/mongoose/html/browse/crop/execute.jim
Executable file
55
var/mongoose/html/browse/crop/execute.jim
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
|
||||
if {[system inuse $rfile]} {
|
||||
puts "This file is in use. Cannot process at the moment."
|
||||
exit
|
||||
}
|
||||
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
set len [$ts duration 1]
|
||||
|
||||
set cropstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set origdir "$dir/_original"
|
||||
if {![file exists $origdir]} { file mkdir $origdir }
|
||||
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
if {[file exists "$origdir/$shname.ts"]} {
|
||||
puts "This recording already exists within _original"
|
||||
puts "Cannot continue."
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Moving recording to $origdir"
|
||||
foreach f [glob -nocomplain "${base}.*"] {
|
||||
set tail [file tail $f]
|
||||
puts " $tail"
|
||||
file rename $f "$origdir/$tail"
|
||||
}
|
||||
|
||||
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"
|
||||
|
||||
set croptime [expr [expr [clock milliseconds] - $cropstart] / 1000.0]
|
||||
puts "Time taken: $croptime"
|
||||
|
||||
26
var/mongoose/html/browse/crop/progress.jim
Executable file
26
var/mongoose/html/browse/crop/progress.jim
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set perc [cgi_get perc 100]
|
||||
set tsfile [file normalize [cgi_get file]]
|
||||
|
||||
set origfile "[file dirname $tsfile]/_original/[file tail $tsfile]"
|
||||
set newfile [file rootname $tsfile]
|
||||
|
||||
if {![file exists $newfile]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $origfile]
|
||||
set expected $($sz / 100 * $perc)
|
||||
set nsz [file size $newfile]
|
||||
|
||||
set perc [expr $nsz * 100 / $expected]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
67
var/mongoose/html/browse/decrypt/decrypt.jim
Executable file
67
var/mongoose/html/browse/decrypt/decrypt.jim
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
header
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
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>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
|
||||
<tr><th>DLNA URL</th><td>$url</td></tr>
|
||||
</table>
|
||||
"
|
||||
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
||||
exit
|
||||
}
|
||||
|
||||
if {![system is_listening 9000]} {
|
||||
puts "The Humax media server is not running, cannot decrypt."
|
||||
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
||||
puts "It can sometimes turn itself off so it's worth double checking."
|
||||
puts "If it is on then try turning sharing off and on again."
|
||||
exit
|
||||
}
|
||||
|
||||
puts "
|
||||
|
||||
<span class=hidden id=params
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
file=\"[cgi_quote_url $rfile]\"
|
||||
></span>
|
||||
|
||||
<div id=decryptdiv style=\"padding: 1em\">
|
||||
<button id=decryptit>Perform decryption</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Decrypting: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
35
var/mongoose/html/browse/decrypt/decrypt.js
Executable file
35
var/mongoose/html/browse/decrypt/decrypt.js
Executable file
@@ -0,0 +1,35 @@
|
||||
|
||||
var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
$.get('progress.jim?file=' + $('#params').attr('file'),
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#decryptit').button().click(function() {
|
||||
$('#decryptdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').load('execute.jim?file=' + $('#params').attr('file'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
68
var/mongoose/html/browse/decrypt/execute.jim
Executable file
68
var/mongoose/html/browse/decrypt/execute.jim
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
lassign [$ts dlnaloc] url
|
||||
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
exit
|
||||
}
|
||||
|
||||
if {[system inuse $rfile]} {
|
||||
puts "This file is in use. Cannot decrypt at the moment."
|
||||
exit
|
||||
}
|
||||
|
||||
set xstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set origdir "$dir/_original"
|
||||
if {![file exists $origdir]} { file mkdir $origdir }
|
||||
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
if {[file exists "$origdir/$shname.ts"]} {
|
||||
puts "The file already exists in _original, cannot decrypt."
|
||||
exit
|
||||
}
|
||||
|
||||
exec wget -O "$rfile.decrypting" $url
|
||||
|
||||
puts "Moving recording to $origdir"
|
||||
|
||||
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
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
|
||||
if {[file exists "$dir/$shname.hmt"]} {
|
||||
exec /mod/bin/hmt -encrypted "$dir/$shname.hmt"
|
||||
}
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
20
var/mongoose/html/browse/decrypt/progress.jim
Executable file
20
var/mongoose/html/browse/decrypt/progress.jim
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set tsfile [cgi_get file]
|
||||
set rfile [file normalize $tsfile]
|
||||
|
||||
if {![file exists "$rfile.decrypting"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [file size "$rfile.decrypting"]
|
||||
|
||||
puts [expr $nsz * 100 / $sz]
|
||||
}
|
||||
|
||||
33
var/mongoose/html/browse/delete.jim
Executable file
33
var/mongoose/html/browse/delete.jim
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require safe_delete
|
||||
|
||||
httpheader
|
||||
|
||||
set dir [cgi_get dir]
|
||||
|
||||
#puts "DIR: ($dir)"
|
||||
|
||||
puts "<div id=deleting class=blood><img src=/img/loading.gif>Deleting...</div>"
|
||||
puts "<ul style=\"list-style-type: square\">"
|
||||
|
||||
foreach file [cgi_get files] {
|
||||
puts -nonewline "<li>\"$file\"..."
|
||||
|
||||
if {[string first "$dir/" $file] != 0} {
|
||||
puts "Error - outside directory."
|
||||
continue
|
||||
}
|
||||
|
||||
if {[safe_delete $file]} {
|
||||
puts -nonewline "Done..."
|
||||
} else {
|
||||
puts -nonewline "Error..."
|
||||
}
|
||||
|
||||
puts "</li>"
|
||||
}
|
||||
puts "</ul>"
|
||||
|
||||
43
var/mongoose/html/browse/download.jim
Executable file
43
var/mongoose/html/browse/download.jim
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
set file [cgi_get file]
|
||||
set urlbase [cgi_get base ""]
|
||||
|
||||
# Default to just downloading the raw file.
|
||||
set url $file
|
||||
set mime "video/ts"
|
||||
|
||||
if {[string match {*.ts} $file]} {
|
||||
if {![catch {set ts [ts fetch $file]}]} {
|
||||
|
||||
# If it's encrypted on disk and the DLNA option is available,
|
||||
# then use the server to perform decryption on the fly.
|
||||
if {[$ts flag "ODEncrypted"] > 0} {
|
||||
set dlna [$ts dlnaloc $urlbase]
|
||||
if {[llength $dlna]} { lassign $dlna url mime }
|
||||
|
||||
#puts "DLNA: $dlna"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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]"
|
||||
|
||||
22
var/mongoose/html/browse/enc.jim
Executable file
22
var/mongoose/html/browse/enc.jim
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get 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]"
|
||||
}
|
||||
}
|
||||
|
||||
19
var/mongoose/html/browse/epgtitle.jim
Executable file
19
var/mongoose/html/browse/epgtitle.jim
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set file [cgi_get file]
|
||||
if {$file == 0} exit
|
||||
set ts [ts fetch $file]
|
||||
|
||||
puts "{"
|
||||
puts "\"title\" : \"[$ts get title]\","
|
||||
puts "\"synopsis\" : \"[$ts get synopsis]\","
|
||||
puts "\"guidance\" : \"[$ts get guidance]\","
|
||||
puts "\"genre\" : [$ts get genre]"
|
||||
puts "}"
|
||||
|
||||
14
var/mongoose/html/browse/ffmpeg.jim
Executable file
14
var/mongoose/html/browse/ffmpeg.jim
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
if [file exists /mod/bin/ffmpeg] {
|
||||
set file [cgi_get file]
|
||||
puts [exec /mod/webif/lib/bin/ffmpeg -i $file]
|
||||
} else {
|
||||
puts "Install ffmpeg package for more information..."
|
||||
}
|
||||
|
||||
156
var/mongoose/html/browse/file.jim
Executable file
156
var/mongoose/html/browse/file.jim
Executable file
@@ -0,0 +1,156 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pretty_size
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get file]
|
||||
set type [cgi_get type]
|
||||
|
||||
if {$file == 0} exit
|
||||
|
||||
file stat $file st
|
||||
set sz [pretty_size $st(size)]
|
||||
|
||||
if {$type eq "ts"} {
|
||||
require epg.class 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 "<font class=also>(Scheduled: [
|
||||
clock format [$ts get schedstart] -format "%c %Z"])</font>"
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>End Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get end] -format "%c %Z"]
|
||||
puts "<font class=also>(Scheduled: [clock format \
|
||||
[expr [$ts get schedstart] + [$ts get scheddur]] \
|
||||
-format "%c %Z"])</font>"
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[$ts duration] minute(s).
|
||||
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
|
||||
</font></td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>$sz</td>
|
||||
"
|
||||
lassign [$ts dlnaloc] url
|
||||
if {$url ne ""} {
|
||||
puts "</tr><tr><th>DLNA URL</th>
|
||||
<td><a href=\"$url\">$url</a></td>"
|
||||
}
|
||||
puts "
|
||||
</tr><tr>
|
||||
<th>Files</th>
|
||||
<td>
|
||||
"
|
||||
|
||||
set fileset [$ts fileset]
|
||||
puts -nonewline "<img id=xfileset class=va src=/img/tree/plusonly.png>"
|
||||
puts -nonewline "[llength $fileset] file"
|
||||
if {[llength $fileset] != 1} { puts -nonewline "s" }
|
||||
puts -nonewline " in set."
|
||||
puts "<div id=fileset class=hidden><ul>"
|
||||
foreach f $fileset {
|
||||
puts "<li>[file tail $f] ([pretty_size [file size $f]])</li>"
|
||||
}
|
||||
puts "</ul></div>"
|
||||
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Flags</th>
|
||||
<td>[$ts get flags]
|
||||
"
|
||||
if {[$ts get bookmarks]} {
|
||||
puts " \[Bookmarks: [$ts get bookmarks]\]"
|
||||
}
|
||||
|
||||
puts "</tr>"
|
||||
puts "</table>"
|
||||
puts {
|
||||
<script type=text/javascript>
|
||||
$('#xfileset').click(function() {
|
||||
$('#fileset').slideToggle('slow', function() {
|
||||
if ($('#fileset').is(':visible'))
|
||||
$('#xfileset').attr('src', '/img/tree/minustop.png');
|
||||
else
|
||||
$('#xfileset').attr('src', '/img/tree/plusonly.png');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
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 "/bin/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
|
||||
puts { <script type="text/javascript"> }
|
||||
puts "var url = \"$url\";"
|
||||
puts {
|
||||
$('#ffmpeg').load(url);
|
||||
</script>
|
||||
}
|
||||
|
||||
18
var/mongoose/html/browse/flagdir.jim
Executable file
18
var/mongoose/html/browse/flagdir.jim
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
set dir [cgi_get dir]
|
||||
set flag [cgi_get flag]
|
||||
if {![file isdirectory $dir]} { exit }
|
||||
if {[file exists "$dir/.$flag"]} {
|
||||
file delete "$dir/.$flag"
|
||||
puts "Unflagged directory as $flag."
|
||||
} else {
|
||||
close [open "$dir/.$flag" w]
|
||||
puts "Flagged directory as $flag."
|
||||
}
|
||||
|
||||
14
var/mongoose/html/browse/iconset.jim
Executable file
14
var/mongoose/html/browse/iconset.jim
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require browse.class
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get file]
|
||||
|
||||
if {[file isdirectory $file]} {
|
||||
lassign [{dir iconset} $file] icons #attrs
|
||||
puts [join $icons ""]
|
||||
}
|
||||
389
var/mongoose/html/browse/index.jim
Executable file
389
var/mongoose/html/browse/index.jim
Executable file
@@ -0,0 +1,389 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class settings.class escape browse.class
|
||||
|
||||
header
|
||||
|
||||
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}
|
||||
|
||||
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 order [cgi_get order -]
|
||||
if {$order eq "-"} {
|
||||
set order [[settings new] sortorder]
|
||||
} else {
|
||||
[settings new] sortorder $order
|
||||
}
|
||||
|
||||
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"
|
||||
if {$hover ne ""} {
|
||||
puts -nonewline " alt=\"$hover\" title=\"$hover\""
|
||||
}
|
||||
puts ">"
|
||||
}
|
||||
|
||||
proc directory {file bfile tbfile} {
|
||||
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>"
|
||||
puts "<input class=\"fs fsdir\" type=checkbox>"
|
||||
puts "<a class=dbf
|
||||
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
|
||||
|
||||
puts "<span class=iconset>"
|
||||
puts [join $icons ""]
|
||||
puts "</span>"
|
||||
|
||||
if {[string first $::mroot $file] >= 0} {
|
||||
set class dopt
|
||||
} else {
|
||||
set class doopt
|
||||
}
|
||||
|
||||
puts -nonewline "
|
||||
<a href=#>
|
||||
<img class=\"$class va\" border=0 width=45 "
|
||||
puts -nonewline [join $attrs " "]
|
||||
puts "
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
"
|
||||
|
||||
puts "
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
"
|
||||
puts "</div>"
|
||||
}
|
||||
|
||||
proc entry {file} {{i 0}} {
|
||||
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"] {
|
||||
directory $file $bfile $tbfile
|
||||
return
|
||||
}
|
||||
set ext [string tolower [file extension $file]]
|
||||
if {$ext in $::ignore || $ext ni $::include} { return }
|
||||
|
||||
file stat $file st
|
||||
set rsz $st(size)
|
||||
set sz [pretty_size $rsz]
|
||||
|
||||
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
|
||||
set omenu opt
|
||||
} elseif {$ext eq ".hmt"} {
|
||||
if {[file exists "${base}.ts"]} { continue }
|
||||
# Sole hmt file indicates failure to track.
|
||||
set type bad
|
||||
set ts 0
|
||||
set img Video_Failed
|
||||
set omenu oopt
|
||||
} else {
|
||||
set type gen
|
||||
set ts 0
|
||||
set img Video_Other
|
||||
set omenu oopt
|
||||
}
|
||||
|
||||
set new 0
|
||||
if {$type eq "ts"} {
|
||||
if {[$ts flag "New"] > 0} { set new 1 }
|
||||
} elseif {$type eq "gen"} {
|
||||
if {![file exists "${base}.hmi"]} { set new 1 }
|
||||
}
|
||||
|
||||
if {$new} { append img _New }
|
||||
|
||||
set fscl "fs"
|
||||
set synopsis ""
|
||||
if {$type eq "ts"} {
|
||||
set fscl "fs fsts"
|
||||
set synopsis [cgi_quote_html [$ts get synopsis]]
|
||||
}
|
||||
|
||||
puts "
|
||||
<div class=\"va bf\" id=[incr i]>
|
||||
<img class=va border=0 src=/img/$img.png>
|
||||
<input class=\"$fscl\" type=checkbox>
|
||||
<a class=bf title=\"$synopsis\"
|
||||
file=\"[cgi_quote_url $file]\" type=$type href=#>
|
||||
$bfile
|
||||
</a>
|
||||
"
|
||||
|
||||
# Size
|
||||
puts "<span class=filesize> ($sz) </span>"
|
||||
|
||||
# Icons
|
||||
|
||||
set locked 0
|
||||
set encd 0
|
||||
set odencd 1
|
||||
set def unknown
|
||||
set bx 0
|
||||
set dlna 0
|
||||
set shrunk 0
|
||||
if {$type eq "ts"} {
|
||||
set genre [$ts get genre]
|
||||
set glist [ts genrelist]
|
||||
if {[dict exists $glist $genre]} {
|
||||
set ret $glist($genre)
|
||||
} else {
|
||||
set ret $glist(0)
|
||||
}
|
||||
lassign $ret txt img
|
||||
if {$img eq "Unclassified"} {
|
||||
icon "/images/173_3_26_G3_$img.png" $txt
|
||||
} else {
|
||||
icon "/images/173_3_00_G3_$img.png" $txt
|
||||
}
|
||||
|
||||
# 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"
|
||||
}
|
||||
icon "/images/$img.png"
|
||||
|
||||
# Locked
|
||||
if {[$ts flag "Locked"] > 0} {
|
||||
set locked 1
|
||||
icon "/images/178_1_00_Icon_Lock.png" "Locked"
|
||||
}
|
||||
|
||||
# Encrypted
|
||||
if {[$ts flag "Encrypted"] > 0} {
|
||||
set encd 1
|
||||
icon "/images/749_1_26_Video_Encryption.png" ""
|
||||
}
|
||||
if {![$ts flag "ODEncrypted"]} {
|
||||
set odencd 0
|
||||
icon "/img/Decrypted.png" "Decrypted"
|
||||
}
|
||||
|
||||
# Guidance
|
||||
if {[$ts flag "Guidance"] > 0} {
|
||||
icon "/images/174_1_26_GuidancePolicy.png"
|
||||
}
|
||||
|
||||
# Indexed
|
||||
if {$::model eq "HDR" && [llength [$ts dlnaloc]]} {
|
||||
icon "/img/dlna.png" "Indexed by DLNA Server"
|
||||
set dlna 1
|
||||
}
|
||||
|
||||
# Shrunk
|
||||
if {[$ts flag Shrunk]} {
|
||||
icon "/img/compress.png" "Shrunk"
|
||||
set shrunk 1
|
||||
}
|
||||
|
||||
set bx [$ts get bookmarks]
|
||||
}
|
||||
|
||||
# Opt+ button
|
||||
|
||||
puts "
|
||||
<a href=#>
|
||||
<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
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
"
|
||||
puts "</div>"
|
||||
}
|
||||
|
||||
set mroot [system mediaroot]
|
||||
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 "
|
||||
<span style=\"display:none\" id=dir>$dir</span>
|
||||
<span style=\"display:none\" id=mediaroot>$mroot</span>
|
||||
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
|
||||
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
|
||||
"
|
||||
|
||||
# Breadcrumb path
|
||||
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 "<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 border=0 src=/images/711_3_09_Media_Folder_UP.png class=va>
|
||||
\[parent directory\]</a>
|
||||
</div>
|
||||
"
|
||||
}
|
||||
|
||||
proc s_time {a b} {
|
||||
global dir
|
||||
|
||||
set a "$dir/$a"
|
||||
set b "$dir/$b"
|
||||
|
||||
set ad [file isdirectory $a]
|
||||
set bd [file isdirectory $b]
|
||||
|
||||
if {$ad && !$bd} { return -1 }
|
||||
if {$bd && !$ad} { return 1 }
|
||||
if {$ad && $bd} {
|
||||
if {$a < $b} { return -1 }
|
||||
if {$a > $b} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
if {[catch {file stat $a l}]} { return 0}
|
||||
set at $l(ctime)
|
||||
if {[catch {file stat $b l}]} { return 0}
|
||||
set bt $l(ctime)
|
||||
|
||||
if {$at < $bt} { return -1 }
|
||||
if {$at > $bt} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
set files [readdir -nocomplain $dir]
|
||||
switch $order {
|
||||
1 { set files [lsort -command s_time $files] }
|
||||
default { set files [lsort $files] }
|
||||
}
|
||||
|
||||
foreach file $files { entry "$dir/$file" }
|
||||
|
||||
puts "<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>"
|
||||
|
||||
# Sort icons
|
||||
puts "<div id=sortdiv>"
|
||||
set sortlist {{0 sort_name name} {1 sort_date date}}
|
||||
foreach sl $sortlist {
|
||||
lassign $sl index img descr
|
||||
|
||||
if {$index} { puts " | " }
|
||||
|
||||
set tag "Currently sorting"
|
||||
if {$order != $index} {
|
||||
puts "
|
||||
<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"
|
||||
if {$order != $index} {
|
||||
puts "</a>"
|
||||
}
|
||||
}
|
||||
puts "</div>"
|
||||
|
||||
puts "</fieldset>"
|
||||
|
||||
puts {
|
||||
<fieldset class=left style="margin: 0 1em 1em 1em">
|
||||
<legend style="font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em; color: #1e5bbd;">
|
||||
File Clipboard
|
||||
</legend>
|
||||
<div id=clipboard>
|
||||
<img src=/img/loading.gif> <i>Loading...</i>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
puts "<div class=brow>"
|
||||
|
||||
puts {
|
||||
<button id=copy>Copy</button>
|
||||
<button id=cut>Cut</button>
|
||||
<button id=delete>Delete</button>
|
||||
<button id=newdir>New Folder</button>
|
||||
<div id=deletewait class=blood style="display: none">
|
||||
<img src=/img/loading.gif>Deleting may take some time, please be patient...
|
||||
</div>
|
||||
}
|
||||
|
||||
# Join
|
||||
if $nicesplice {
|
||||
puts { <button id=join>Join</button> }
|
||||
}
|
||||
|
||||
puts "</div><div class=brow style=\"margin-top: 3px\">"
|
||||
|
||||
# De-duplicate
|
||||
|
||||
puts {
|
||||
<button id=dedup>De-duplicate/tidy this folder</button>
|
||||
}
|
||||
|
||||
# Streamer file
|
||||
|
||||
if {[file exists /mnt/hd3/Streamer_down_file]} {
|
||||
puts {
|
||||
<button id=save_stream file=/mnt/hd3/Streamer_down_file>
|
||||
Save last streamed content (e.g. iPlayer/YouTube)
|
||||
<div id=streamstatus></div>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
|
||||
puts "</div>"
|
||||
|
||||
footer
|
||||
|
||||
31
var/mongoose/html/browse/join/execute.jim
Executable file
31
var/mongoose/html/browse/join/execute.jim
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
httpheader
|
||||
|
||||
cgi_input 1
|
||||
|
||||
set joinstart [clock milliseconds]
|
||||
|
||||
set cmd {/mod/bin/nicesplice}
|
||||
set dst [file rootname [cgi_get dest "joined"]]
|
||||
|
||||
foreach file [split [cgi_get files] ","] {
|
||||
set file [cgi_unquote_input $file]
|
||||
lappend cmd "-in" [file rootname $file]
|
||||
set dir [file dirname $file]
|
||||
}
|
||||
lappend cmd "-out" "$dir/$dst"
|
||||
|
||||
puts "($cmd)"
|
||||
puts [exec {*}$cmd]
|
||||
|
||||
set ts [ts fetch "$dir/$dst.ts"]
|
||||
$ts settitle $dst
|
||||
|
||||
set jointime [expr [expr [clock milliseconds] - $joinstart] / 1000.0]
|
||||
puts "Time taken: $jointime"
|
||||
|
||||
6
var/mongoose/html/browse/join/join.css
Normal file
6
var/mongoose/html/browse/join/join.css
Normal file
@@ -0,0 +1,6 @@
|
||||
#filelist { list-style-type: none; margin: 0; padding: 0; }
|
||||
#filelist li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em;
|
||||
height: 35px; }
|
||||
#filelist li span { position: absolute; margin-left: -1.3em; }
|
||||
span.pl { padding-left: 2em; }
|
||||
|
||||
64
var/mongoose/html/browse/join/join.jim
Executable file
64
var/mongoose/html/browse/join/join.jim
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
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>
|
||||
"
|
||||
|
||||
puts "<ul id=filelist>"
|
||||
set esize 0
|
||||
foreach file [split [cgi_get files] ","] {
|
||||
set file [cgi_unquote_input $file]
|
||||
set dir [file dirname $file]
|
||||
set ts [ts fetch $file]
|
||||
puts "<li class=\"va ui-state-default\" id=\"$file\"><span
|
||||
class=\"va ui-icon ui-icon-arrowthick-2-n-s\"></span>
|
||||
<img class=va src=/img/Video_TS.png>
|
||||
<span class=pl>
|
||||
$file ([clock format [$ts duration 1] -format "%T"])
|
||||
\[[pretty_size [$ts size]]\]
|
||||
<br><i style=\"font-size: 0.8em\">[$ts get title]</i>
|
||||
</span>
|
||||
</li>"
|
||||
incr esize [$ts size]
|
||||
}
|
||||
puts "</ul>"
|
||||
|
||||
puts "
|
||||
<br><br>
|
||||
|
||||
<div id=joindiv>
|
||||
Name for joined file:
|
||||
<input id=dest name=dfile class=\"text ui-widget-content ui-corner-all\"
|
||||
length=20 maxlength=50>
|
||||
<button id=dojoin>Join</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv style=\"display: none\">
|
||||
Joining: <div id=progressbar></div>
|
||||
<button id=back
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
esize=\"$esize\"
|
||||
style=\"display: none\">Back to media list</button>
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</div>
|
||||
"
|
||||
|
||||
footer
|
||||
|
||||
62
var/mongoose/html/browse/join/join.js
Executable file
62
var/mongoose/html/browse/join/join.js
Executable file
@@ -0,0 +1,62 @@
|
||||
|
||||
$('#filelist li').hover(
|
||||
function() { $(this).css('cursor', 'pointer'); },
|
||||
function() { $(this).css('cursor', 'auto'); }
|
||||
);
|
||||
|
||||
var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
$.get('progress.jim'
|
||||
+ '?esize=' + $('#back').attr('esize')
|
||||
+ '&file=' + $('#back').attr('dir') + '/' + $('#dest').val(),
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $(this).attr('dir');
|
||||
});
|
||||
|
||||
$('#filelist').sortable().disableSelection();
|
||||
|
||||
$('#dojoin').button().attr('disabled', true).addClass('ui-state-disabled')
|
||||
.click(function() {
|
||||
var files = $('#filelist').sortable('toArray');
|
||||
var sfiles = new Array();
|
||||
for (x in files)
|
||||
sfiles.push(encodeURIComponent(files[x]));
|
||||
|
||||
$('#joindiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
|
||||
$('#output').text('Please do not interrupt...')
|
||||
.load('execute.jim?files=' +
|
||||
sfiles.join() + '&dest=' + $('#dest').val(),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
$('#dest').val('').keyup(function() {
|
||||
if ($(this).val().length > 0)
|
||||
$('#dojoin')
|
||||
.removeProp('disabled').removeClass('ui-state-disabled');
|
||||
else
|
||||
$('#dojoin')
|
||||
.prop('disabled', true).addClass('ui-state-disabled');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
20
var/mongoose/html/browse/join/progress.jim
Executable file
20
var/mongoose/html/browse/join/progress.jim
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
set expected [cgi_get esize 1]
|
||||
set file [file normalize [cgi_get file]]
|
||||
|
||||
if {![file exists $file]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $file]
|
||||
|
||||
set perc [expr $sz * 100 / $expected]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
22
var/mongoose/html/browse/lock.jim
Executable file
22
var/mongoose/html/browse/lock.jim
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get 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]"
|
||||
}
|
||||
}
|
||||
|
||||
12
var/mongoose/html/browse/mknewdir.jim
Executable file
12
var/mongoose/html/browse/mknewdir.jim
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
set dir [cgi_get dir -]
|
||||
set name [cgi_get newdirname "New Folder"]
|
||||
|
||||
file mkdir "$dir/$name"
|
||||
|
||||
28
var/mongoose/html/browse/mpg/execute.jim
Executable file
28
var/mongoose/html/browse/mpg/execute.jim
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
|
||||
set xstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
|
||||
-i $rfile \
|
||||
-map 0:0 -map 0:1 \
|
||||
-vcodec copy -acodec copy "${base}.mpg"]
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
47
var/mongoose/html/browse/mpg/mpg.jim
Executable file
47
var/mongoose/html/browse/mpg/mpg.jim
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
header
|
||||
|
||||
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=mpg.js></script>
|
||||
|
||||
<fieldset class=cleft>
|
||||
<legend>Extract to MPG</legend>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
|
||||
</table>
|
||||
|
||||
<span class=hidden id=params
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
rfile=\"[cgi_quote_url $rfile]\"
|
||||
></span>
|
||||
|
||||
<div id=mpgdiv style=\"padding: 1em\">
|
||||
<button id=mpgit>Perform mpg extraction</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Extracting mpg: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
35
var/mongoose/html/browse/mpg/mpg.js
Executable file
35
var/mongoose/html/browse/mpg/mpg.js
Executable file
@@ -0,0 +1,35 @@
|
||||
|
||||
var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
$.get('progress.jim?file=' + $('#params').attr('rfile'),
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#mpgit').button().click(function() {
|
||||
$('#mpgdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').load('execute.jim?file=' + $('#params').attr('rfile'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
23
var/mongoose/html/browse/mpg/progress.jim
Executable file
23
var/mongoose/html/browse/mpg/progress.jim
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set tsfile [cgi_get file]
|
||||
set rfile [file normalize $tsfile]
|
||||
set bfile [file rootname $rfile]
|
||||
|
||||
if {![file exists "${bfile}.mpg"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [expr [file size "${bfile}.mpg"] / 0.75]
|
||||
|
||||
set perc [expr $nsz * 100 / $sz]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
22
var/mongoose/html/browse/new.jim
Executable file
22
var/mongoose/html/browse/new.jim
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get 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]"
|
||||
}
|
||||
}
|
||||
|
||||
29
var/mongoose/html/browse/newdir.jim
Executable file
29
var/mongoose/html/browse/newdir.jim
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require pack
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set root [cgi_get 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 "}"
|
||||
|
||||
48
var/mongoose/html/browse/rename.jim
Executable file
48
var/mongoose/html/browse/rename.jim
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set file [cgi_get renamefile "-"]
|
||||
if {$file eq "-"} exit
|
||||
|
||||
set newfile [string trim [cgi_get rename]]
|
||||
set dir [file dirname $file]
|
||||
|
||||
if {[file isdirectory $file]} {
|
||||
#puts "Directory."
|
||||
if {$newfile ne ""} {
|
||||
set newfile "${dir}/${newfile}"
|
||||
file rename $file $newfile
|
||||
}
|
||||
} elseif {[set ts [ts fetch $file]] != 0} {
|
||||
#puts "TS file."
|
||||
|
||||
foreach attr {title synopsis guidance genre} {
|
||||
if {[catch {
|
||||
set new [string trim [cgi_get "rename_$attr"]]
|
||||
set old [$ts get $attr]
|
||||
if {$new ne $old} {
|
||||
if {$attr eq "guidance" ||
|
||||
[string length $new] > 0} {
|
||||
$ts set$attr $new
|
||||
}
|
||||
}
|
||||
} msg]} {
|
||||
puts "$attr: $msg"
|
||||
}
|
||||
}
|
||||
|
||||
if {"$dir/$newfile.ts" ne "$file"} { ts renamegroup $file $newfile }
|
||||
} else {
|
||||
#puts "Normal file."
|
||||
if {$newfile ne ""} {
|
||||
set newfile "$dir/$newfile[file extension $file]"
|
||||
puts "Rename ($file) -> ($newfile)"
|
||||
file rename $file $newfile
|
||||
}
|
||||
}
|
||||
|
||||
45
var/mongoose/html/browse/resetnew.jim
Executable file
45
var/mongoose/html/browse/resetnew.jim
Executable 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
|
||||
|
||||
18
var/mongoose/html/browse/savestream.jim
Executable file
18
var/mongoose/html/browse/savestream.jim
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set dir [cgi_get dir "/media/My Video"]
|
||||
set file [file tail [cgi_get savestream_name]]
|
||||
set sfile [cgi_get savestream_source "/mnt/hd3/Streamer_down_file"]
|
||||
if {$file == "0"} { exit }
|
||||
if {[string length [string trim $file]] == 0} { exit }
|
||||
|
||||
if {[file extension $file] ne ".mp4"} { append file ".mp4" }
|
||||
|
||||
file copy $sfile "$dir/$file"
|
||||
|
||||
924
var/mongoose/html/browse/script.js
Executable file
924
var/mongoose/html/browse/script.js
Executable file
@@ -0,0 +1,924 @@
|
||||
|
||||
var dir;
|
||||
|
||||
function disableall()
|
||||
{
|
||||
$('button,a,input').disable();
|
||||
}
|
||||
|
||||
function pastedialogue()
|
||||
{
|
||||
$('#pwdialogue').dialog({
|
||||
title: "Pasting from clipboard",
|
||||
modal: true, autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: false, resizable: false,
|
||||
closeOnEscape: false,
|
||||
open: function() {
|
||||
$('.ui-dialog-titlebar-close').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reloadclipboard()
|
||||
{
|
||||
$('#clipboard')
|
||||
.empty()
|
||||
.html('<img src=/img/loading.gif> <i>Loading...</i>')
|
||||
.load('/browse/clipboard.jim', function() {
|
||||
|
||||
// Start Clipboard post-load actions
|
||||
|
||||
if ($('#clipclear').length)
|
||||
{
|
||||
$('#paste').enable();
|
||||
$('#doptmenu,#dooptmenu').enableContextMenuItems('#paste');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#paste').disable();
|
||||
$('#doptmenu,#dooptmenu').disableContextMenuItems('#paste');
|
||||
}
|
||||
|
||||
$('#clipclear').button().click(function() {
|
||||
$.get('/browse/clipboard.jim?act=clear', function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
});
|
||||
|
||||
$('a.clipdel').click(function() {
|
||||
$.get('/browse/clipboard.jim?act=remove&path=' +
|
||||
$(this).attr('path'), function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
});
|
||||
|
||||
$('#paste').button()
|
||||
.click(function() {
|
||||
disableall();
|
||||
pastedialogue();
|
||||
$('#pwfeedback').load(
|
||||
'/browse/clipboard.jim?act=paste&dir='
|
||||
+ encodeURIComponent(dir), function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
window.location.reload(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// End Clipboard post-load actions
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function epginfo_callback(data, status, xhr)
|
||||
{
|
||||
//console.log(status);
|
||||
//console.dir(data);
|
||||
|
||||
if (status != 'success')
|
||||
return;
|
||||
|
||||
$('#rename_title').val(data.title);
|
||||
$('#rename_synopsis').val(data.synopsis);
|
||||
$('#rename_guidance').val(data.guidance);
|
||||
$('#rename_genre').val(data.genre);
|
||||
|
||||
$('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 (size.search(/\d$/) == -1)
|
||||
size += 'iB';
|
||||
else
|
||||
size += ' bytes';
|
||||
if (folder == "")
|
||||
$('#dirsize').text(' (' + size + ')');
|
||||
else
|
||||
$('#' + folder).text(' (' + size + ')');
|
||||
}
|
||||
|
||||
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 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;
|
||||
var results = el + ' .results';
|
||||
$(results)
|
||||
.html('<img src=/img/loading.gif>Deleting, please wait...')
|
||||
.slideDown('slow')
|
||||
.load('/browse/delete.jim', {
|
||||
'dir': dir,
|
||||
'files': [decodeURIComponent(file)]
|
||||
}, function() {
|
||||
$(el).delay(3000).slideUp(300, function() {
|
||||
$(el).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function lock_callback(file, type, id)
|
||||
{
|
||||
var url = '/browse/lock.jim?file=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function enc_callback(file, type, id)
|
||||
{
|
||||
var url = '/browse/enc.jim?file=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function new_callback(file, type, id)
|
||||
{
|
||||
var url = '/browse/new.jim?file=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function rename_submit()
|
||||
{
|
||||
var s = $('#renameform_form').serialize();
|
||||
$.post('/browse/rename.jim', s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function drename_submit()
|
||||
{
|
||||
var s = $('#drenameform_form').serialize();
|
||||
$.get('/browse/rename.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function aexpiry_submit()
|
||||
{
|
||||
$('#aexpiry_working').slideDown('slow');
|
||||
var s = $('#aexpiry_form').serialize();
|
||||
$.get('/browse/aexpiry.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function newdir_submit()
|
||||
{
|
||||
var s = $('#newdirform_form').serialize();
|
||||
$.get('/browse/mknewdir.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function savestream_submit()
|
||||
{
|
||||
var s = $('#savestream_form').serialize();
|
||||
var sf = $('#save_stream').attr('file');
|
||||
$('#savestream_spin').show();
|
||||
$.get('/browse/savestream.jim?sfile=' +
|
||||
encodeURIComponent(sf) + '&' + 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>' + decodeURIComponent(bfile) + '</i> ?'
|
||||
);
|
||||
$confirm.dialog('open');
|
||||
}
|
||||
|
||||
function preparemenu(el, menu)
|
||||
{
|
||||
if (el.attr('type') == 'ts')
|
||||
{
|
||||
// if (el.attr('def') == 'HD')
|
||||
// {
|
||||
// $(menu).enableContextMenuItems('#enc');
|
||||
// if (el.attr('encd') == 1)
|
||||
// $(menu).changeContextMenuItem('#enc',
|
||||
// 'Remove Enc');
|
||||
// else
|
||||
// $(menu).changeContextMenuItem('#enc',
|
||||
// 'Set Enc');
|
||||
// }
|
||||
|
||||
if (el.attr('bx') > 0)
|
||||
$(menu).enableContextMenuItems('#crop');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#crop');
|
||||
|
||||
$(menu).enableContextMenuItems('#strip');
|
||||
|
||||
if (el.attr('rsize') > 4294967296)
|
||||
$(menu).enableContextMenuItems('#chunk');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#chunk');
|
||||
|
||||
$(menu).enableContextMenuItems('#new');
|
||||
if (el.attr('new') == 1)
|
||||
$(menu).changeContextMenuItem('#new', 'Mark watched');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#new', 'Mark new');
|
||||
|
||||
|
||||
$(menu).enableContextMenuItems('#lock');
|
||||
if (el.attr('locked') == 1)
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Unlock');
|
||||
$(menu).disableContextMenuItems('#delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Lock');
|
||||
$(menu).enableContextMenuItems('#delete');
|
||||
}
|
||||
|
||||
if (el.attr('odencd') == 1 && el.attr('dlna') == 1 &&
|
||||
el.attr('encd') == 0)
|
||||
$(menu).enableContextMenuItems('#decrypt');
|
||||
else
|
||||
$(menu).disableContextMenuItems('#decrypt');
|
||||
|
||||
if (el.attr('odencd') == 1)
|
||||
{
|
||||
$(menu).disableContextMenuItems('#audio');
|
||||
$(menu).disableContextMenuItems('#mpg');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).enableContextMenuItems('#audio');
|
||||
if (el.attr('def') == 'HD')
|
||||
$(menu).disableContextMenuItems('#mpg');
|
||||
else
|
||||
$(menu).enableContextMenuItems('#mpg');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).enableContextMenuItems('#delete');
|
||||
$(menu).disableContextMenuItems('#lock');
|
||||
//$(menu).disableContextMenuItems('#enc');
|
||||
$(menu).disableContextMenuItems('#new');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fixdmenu(el, menu, flag, tag, descr, recurse)
|
||||
{
|
||||
var a = el.attr(flag);
|
||||
var b = el.attr(flag + 'r');
|
||||
|
||||
if (a == undefined) a = 0;
|
||||
if (b == undefined) b = 0;
|
||||
|
||||
if (a > 0)
|
||||
$(menu).changeContextMenuItem(tag, 'Disable ' + descr);
|
||||
else
|
||||
$(menu).changeContextMenuItem(tag, 'Enable ' + descr);
|
||||
|
||||
if (recurse)
|
||||
{
|
||||
if (b > 0)
|
||||
{
|
||||
$(menu).changeContextMenuItem(tag + 'r',
|
||||
'Disable Recursive ' + descr);
|
||||
$(menu).disableContextMenuItems(tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).changeContextMenuItem(tag + 'r',
|
||||
'Enable Recursive ' + descr);
|
||||
$(menu).enableContextMenuItems(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function preparedmenu(el, menu)
|
||||
{
|
||||
if (el.attr('noflat') != undefined)
|
||||
{
|
||||
if (el.attr('noflat') > 0)
|
||||
$(menu).changeContextMenuItem('#flat', 'Allow Flatten');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#flat',
|
||||
'Prevent Flatten');
|
||||
}
|
||||
|
||||
fixdmenu(el, menu, 'autoshrink', '#shrink', 'Auto-shrink', 1);
|
||||
fixdmenu(el, menu, 'autodedup', '#dedup', 'Auto-dedup', 0);
|
||||
fixdmenu(el, menu, 'autodecrypt', '#decrypt', 'Auto-decrypt', 1);
|
||||
fixdmenu(el, menu, 'autompg', '#mpg', 'Auto-mpg', 0);
|
||||
fixdmenu(el, menu, 'autoexpire', '#expire', 'Auto-expire', 0);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
dir = $('#dir').text();
|
||||
|
||||
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,
|
||||
dir, id);
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
if (!confirm('Are you sure? Copying recordings takes a long time!'))
|
||||
break;
|
||||
// Fallthrough
|
||||
case 'cut':
|
||||
$.get('/browse/clipboard.jim?act=add&mode=' + action +
|
||||
'&path=' + file, function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
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(decodeURIComponent(bfile));
|
||||
$('#renamefile').val(decodeURIComponent(file));
|
||||
|
||||
$('#rename_title').val('');
|
||||
$('#rename_synopsis').val('');
|
||||
$('#rename_guidance').val('');
|
||||
$('tr.tstype').css('display', 'none');
|
||||
|
||||
if (type == 'ts')
|
||||
{
|
||||
$.getJSON('/browse/epgtitle.jim?file=' +
|
||||
file, epginfo_callback);
|
||||
}
|
||||
|
||||
$('#renameform').dialog('open');
|
||||
break;
|
||||
|
||||
case 'download':
|
||||
window.location.href = '/browse/download.jim?file=' +
|
||||
file + '&base=' +
|
||||
encodeURIComponent(document.URL.match(/:\/\/(.[^/]+)/)[1]);
|
||||
break;
|
||||
|
||||
case 'crop':
|
||||
window.location.href = '/browse/crop/crop.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'strip':
|
||||
window.location.href = '/browse/strip/strip.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'chunk':
|
||||
window.location.href = '/browse/chunk/chunk.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'decrypt':
|
||||
window.location.href =
|
||||
'/browse/decrypt/decrypt.jim?file=' + file;
|
||||
break;
|
||||
|
||||
case 'audio':
|
||||
window.location.href = '/browse/audio/audio.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'mpg':
|
||||
window.location.href = '/browse/mpg/mpg.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
function flagdir(file, flag, iconset, output, options)
|
||||
{
|
||||
var url = '/browse/flagdir.jim?dir=' + file +
|
||||
'&flag=' + flag;
|
||||
|
||||
$(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
|
||||
$(options).attr(flag, 1);
|
||||
}).delay(3000).slideUp();
|
||||
}
|
||||
|
||||
var dmenuclick = function(action, el, pos)
|
||||
{
|
||||
var direl = $(el).parent().parent();
|
||||
var file = $(el).parent().prevAll('a.dbf').last().attr('file');
|
||||
var iconset = $(el).parent().prevAll('span.iconset').last();
|
||||
var bfile = file.replace(/.*\//g, '');
|
||||
bfile = bfile.replace(/[\x00-\x1f]+/g, '');
|
||||
var results = $(el).parent().next('div.results');
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case 'paste':
|
||||
pastedialogue();
|
||||
$('#pwfeedback').load(
|
||||
'/browse/clipboard.jim?act=paste&dir=' +
|
||||
file, function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
reloadclipboard();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
if (confirm('Are you sure you wish to delete "' +
|
||||
decodeURIComponent(file) +
|
||||
'" and all files within it?'))
|
||||
{
|
||||
$(results)
|
||||
.html('<img src=/img/loading.gif>' +
|
||||
'Deleting, please wait...')
|
||||
.slideDown('slow')
|
||||
.load('/browse/delete.jim', {
|
||||
'dir': dir,
|
||||
'files': [decodeURIComponent(file)]
|
||||
}, function() {
|
||||
$(direl).delay(3000).slideUp(300, function() {
|
||||
$(direl).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
if (!confirm('Are you sure? Copying directories can take a very long time!'))
|
||||
break;
|
||||
// Fallthrough
|
||||
case 'cut':
|
||||
$.get('/browse/clipboard.jim?act=add&mode=' + action +
|
||||
'&path=' + file, function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'rename':
|
||||
$('#drename').val(decodeURIComponent(bfile));
|
||||
$('#drenameorig').val(decodeURIComponent(file));
|
||||
$('#drenameform').dialog('open');
|
||||
break;
|
||||
|
||||
case 'expire':
|
||||
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':
|
||||
flagdir(file, 'noflatten', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'dedup':
|
||||
flagdir(file, 'autodedup', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'mpg':
|
||||
flagdir(file, 'autompg', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'shrink':
|
||||
flagdir(file, 'autoshrink', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'shrinkr':
|
||||
flagdir(file, 'autoshrinkr', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'decrypt':
|
||||
flagdir(file, 'autodecrypt', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'decryptr':
|
||||
flagdir(file, 'autodecryptr', iconset, results, el);
|
||||
break;
|
||||
|
||||
case 'resetnew':
|
||||
var url = '/browse/resetnew.jim?dir=' + file;
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// Bind context menu to opt+ image
|
||||
$('img.opt').contextMenu(
|
||||
{
|
||||
menu: 'optmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparemenu
|
||||
},
|
||||
menuclick
|
||||
);
|
||||
|
||||
// Bind context menu to opt+ image
|
||||
$('img.oopt').contextMenu(
|
||||
{
|
||||
menu: 'ooptmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparemenu
|
||||
},
|
||||
menuclick
|
||||
);
|
||||
|
||||
$('img.dopt').contextMenu(
|
||||
{
|
||||
menu: 'doptmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparedmenu
|
||||
},
|
||||
dmenuclick
|
||||
);
|
||||
|
||||
$('img.doopt').contextMenu(
|
||||
{
|
||||
menu: 'dooptmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparedmenu
|
||||
},
|
||||
dmenuclick
|
||||
);
|
||||
|
||||
// Disable items which are not yet implemented.
|
||||
$('#optmenu').disableContextMenuItems('#title');
|
||||
|
||||
var $buttons = {
|
||||
"Close" : function() {$(this).dialog('close');}
|
||||
};
|
||||
var $buttonsp = $.extend(
|
||||
{"Play" : function() { doplay(); }},
|
||||
$buttons);
|
||||
|
||||
// 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: $buttons,
|
||||
close: function(e,u) { $('#dialogue').empty().html(
|
||||
'<img src="/img/loading.gif" alt="loading">'); }
|
||||
});
|
||||
|
||||
function doplay()
|
||||
{
|
||||
var file = $dialog.attr('file');
|
||||
var type = $dialog.attr('type');
|
||||
|
||||
disableall();
|
||||
|
||||
window.location = '/play/play.jim?' +
|
||||
'dir=' + encodeURIComponent(dir) +
|
||||
'&file=' + file;
|
||||
}
|
||||
|
||||
// Bind dialogue open to filenames.
|
||||
$('a.bf').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var file = $(this).attr('file');
|
||||
var type = $(this).attr('type');
|
||||
var opt = $(this).nextAll('a').find('img.opt');
|
||||
|
||||
var url = '/browse/file.jim?file=' + file
|
||||
+ '&type=' + type;
|
||||
$dialog.load(url);
|
||||
|
||||
$dialog.attr('file', file);
|
||||
$dialog.attr('type', type);
|
||||
|
||||
if (type == 'ts' &&
|
||||
(opt.attr('odencd') == 0 || opt.attr('dlna') == 1))
|
||||
$dialog.dialog("option", "buttons", $buttonsp);
|
||||
else
|
||||
$dialog.dialog("option", "buttons", $buttons);
|
||||
$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(''); }
|
||||
});
|
||||
|
||||
$('#drenameform').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Update": drename_submit,
|
||||
"Close": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#drename').val(''); }
|
||||
});
|
||||
|
||||
$('#aexpiry').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Update": aexpiry_submit,
|
||||
"Close": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#aexpiry_days').val('0'); }
|
||||
});
|
||||
|
||||
$('#savestreamform').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Save": savestream_submit,
|
||||
"Cancel": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#savestream_name').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
|
||||
});
|
||||
|
||||
// Load folder sizes
|
||||
$.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);
|
||||
|
||||
// Load clipboard
|
||||
reloadclipboard();
|
||||
|
||||
// Uncheck everything
|
||||
$('input.fs:checked').attr('checked', false);
|
||||
|
||||
// Buttons
|
||||
|
||||
$('#dedup').button().click(function() {
|
||||
window.location = '/dedup/dedup.jim?dir='
|
||||
+ encodeURIComponent(dir);
|
||||
});
|
||||
|
||||
$('#save_stream').button().click(function() {
|
||||
$('#savestream_spin').hide();
|
||||
$('#savestreamform').dialog('open');
|
||||
$('#savestream_detail').load(
|
||||
'/browse/ffmpeg.jim?file=' +
|
||||
encodeURIComponent($('#save_stream').attr('file')));
|
||||
});
|
||||
|
||||
$('#selectall').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('input.fs').attr('checked', true).trigger('change');
|
||||
});
|
||||
$('#deselectall').click(function(e) {
|
||||
e.preventDefault();
|
||||
$('input.fs:checked').attr('checked', false).trigger('change');
|
||||
});
|
||||
|
||||
$('#join').button().disable()
|
||||
.click(function() {
|
||||
var files = new Array();
|
||||
var els = $('input.fsts:checked + a').each(function() {
|
||||
files.push($(this).attr('file'));
|
||||
});
|
||||
//console.log("%o", files);
|
||||
window.location.href = '/browse/join/join.jim?files=' +
|
||||
files.join();
|
||||
});
|
||||
|
||||
$('#delete').button().disable()
|
||||
.click(function() {
|
||||
var files = new Array();
|
||||
var els = $('input.fs:checked + a').each(function() {
|
||||
files.push(decodeURIComponent($(this).attr('file')));
|
||||
});
|
||||
//console.log("%o", files);
|
||||
var str = 'Are you sure you want to delete ' + files.length +
|
||||
' file';
|
||||
if (files.length != 1) str += 's';
|
||||
str += '?';
|
||||
if (confirm(str))
|
||||
{
|
||||
disableall();
|
||||
$('#deletewait').slideDown('slow');
|
||||
|
||||
$('#pwdialogue').dialog({
|
||||
title: "Deleting",
|
||||
modal: true, autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: false, resizable: false,
|
||||
closeOnEscape: false,
|
||||
open: function() {
|
||||
$('.ui-dialog-titlebar-close').hide();
|
||||
}
|
||||
});
|
||||
$('#pwfeedback').load(
|
||||
'/browse/delete.jim', {
|
||||
'dir': dir,
|
||||
'files': files
|
||||
}, function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
window.location.reload(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#copy,#cut').button().disable()
|
||||
.click(function() {
|
||||
var files = new Array();
|
||||
var els = $('input.fs:checked + a').each(function() {
|
||||
files.push(decodeURIComponent($(this).attr('file')));
|
||||
});
|
||||
//console.log("%o", files);
|
||||
var action = $(this).attr('id');
|
||||
if (action == 'copy' && !confirm('Are you sure? ' +
|
||||
'Copying recordings can take a very long time!'))
|
||||
return;
|
||||
|
||||
$.post('/browse/clipboard.jim', {
|
||||
'act': 'add',
|
||||
'dir': dir,
|
||||
'mode': action,
|
||||
'path': files
|
||||
}, function() {
|
||||
reloadclipboard();
|
||||
$('input.fs:checked').attr('checked', false);
|
||||
});
|
||||
});
|
||||
|
||||
$('#newdir').button().click(function() {
|
||||
$('#newdirform').dialog({
|
||||
autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Create": newdir_submit,
|
||||
"Cancel": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function() { $('#newdirname').val(''); }
|
||||
});
|
||||
});
|
||||
|
||||
$('input.fs').change(function() {
|
||||
var num = $('input.fs:checked').size();
|
||||
if (num > 0)
|
||||
$('#delete,#cut,#copy').enable();
|
||||
else
|
||||
$('#delete,#cut,#copy').disable();
|
||||
|
||||
var num = $('input.fsts:checked').size();
|
||||
if (num > 1)
|
||||
$('#join').enable();
|
||||
else
|
||||
$('#join').disable();
|
||||
|
||||
});
|
||||
|
||||
var streamsize = 0;
|
||||
|
||||
function checkstream()
|
||||
{
|
||||
$.get('/browse/streamsize.jim', function(size) {
|
||||
//console.log('Stream size: %o', size);
|
||||
var mb = size / (1024 * 1024);
|
||||
mb = mb|0;
|
||||
if (streamsize && size > streamsize)
|
||||
{
|
||||
rate = (size - streamsize) * 8.0 /
|
||||
(3 * 1048576);
|
||||
$('#streamstatus').text(mb +
|
||||
' MiB (growing @' + rate.toFixed(2) +
|
||||
' Mib/s)');
|
||||
}
|
||||
else
|
||||
$('#streamstatus').text(mb + ' MiB');
|
||||
streamsize = size;
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#streamstatus').length)
|
||||
setInterval(checkstream, 3000);
|
||||
|
||||
});
|
||||
|
||||
34
var/mongoose/html/browse/shrunk.jim
Executable file
34
var/mongoose/html/browse/shrunk.jim
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set dir [cgi_get dir "-"]
|
||||
if {$dir eq "-"} exit
|
||||
|
||||
puts "{"
|
||||
foreach file [readdir -nocomplain $dir] {
|
||||
if {![string match {*.ts} $file]} { continue }
|
||||
|
||||
if {[catch {set ts [ts fetch "$dir/$file"]}]} continue
|
||||
|
||||
set eit 1
|
||||
if {[$ts flag "Shrunk"]} { set eit 0 }
|
||||
|
||||
if {$eit} {
|
||||
set xfile [file rootname $file]
|
||||
if {[catch {set eit [\
|
||||
exec /mod/bin/stripts -cq "$dir/$xfile"]}]} {
|
||||
continue
|
||||
}
|
||||
if {!$eit} { $ts set_shrunk }
|
||||
}
|
||||
|
||||
puts " \"$file\": $eit,"
|
||||
}
|
||||
puts " \"dummy\": 0"
|
||||
puts "}"
|
||||
|
||||
40
var/mongoose/html/browse/sizes.jim
Executable file
40
var/mongoose/html/browse/sizes.jim
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set dir [cgi_get dir]
|
||||
set dlen [string length "$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 -d 1 "$dir/"] "\n"] {
|
||||
lassign [split $line "\t"] size node
|
||||
set node [string range $node $dlen end]
|
||||
puts "\"$node\" : \"$size\","
|
||||
}
|
||||
|
||||
# Handle symbolic links.
|
||||
foreach file [readdir $dir] {
|
||||
set file "$dir/$file"
|
||||
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 "}"
|
||||
|
||||
13
var/mongoose/html/browse/streamsize.jim
Executable file
13
var/mongoose/html/browse/streamsize.jim
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
set stream "/mnt/hd3/Streamer_down_file"
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
httpheader "text/plain"
|
||||
|
||||
if {[file exists $stream]} {
|
||||
puts -nonewline [file size $stream]
|
||||
} else {
|
||||
puts -nonewline 0
|
||||
}
|
||||
|
||||
13
var/mongoose/html/browse/strip/analyse.jim
Executable file
13
var/mongoose/html/browse/strip/analyse.jim
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set base [file rootname $rfile]
|
||||
|
||||
puts [exec /mod/bin/stripts -aq $base]
|
||||
|
||||
50
var/mongoose/html/browse/strip/execute.jim
Executable file
50
var/mongoose/html/browse/strip/execute.jim
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
set len [$ts duration 1]
|
||||
|
||||
set stripstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set origdir "$dir/_original"
|
||||
if {![file exists $origdir]} { file mkdir $origdir }
|
||||
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
if {[file exists "$origdir/$shname.ts"]} {
|
||||
puts "This recording already exists within _original"
|
||||
puts "Cannot continue."
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Moving recording to $origdir"
|
||||
foreach f [glob -nocomplain "${base}.*"] {
|
||||
set tail [file tail $f]
|
||||
puts " $tail"
|
||||
file rename $f "$origdir/$tail"
|
||||
}
|
||||
|
||||
puts [exec /mod/bin/stripts \
|
||||
"$origdir/$shname" \
|
||||
"$dir/$shname" \
|
||||
]
|
||||
|
||||
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"
|
||||
exec /mod/bin/hmt "+shrunk" "$dir/$newname.hmt"
|
||||
|
||||
set striptime [expr [expr [clock milliseconds] - $stripstart] / 1000.0]
|
||||
puts "Time taken: $striptime"
|
||||
|
||||
24
var/mongoose/html/browse/strip/progress.jim
Executable file
24
var/mongoose/html/browse/strip/progress.jim
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
httpheader
|
||||
|
||||
set tsfile [file normalize [cgi_get file]]
|
||||
set ntsfile "[file rootname $tsfile].nts"
|
||||
|
||||
set origfile "[file dirname $tsfile]/_original/[file tail $ntsfile]"
|
||||
|
||||
if {![file exists $ntsfile]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $origfile]
|
||||
set nsz [file size $ntsfile]
|
||||
|
||||
set perc [expr $nsz * 100 / $sz]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
61
var/mongoose/html/browse/strip/strip.jim
Executable file
61
var/mongoose/html/browse/strip/strip.jim
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
header
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
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>
|
||||
|
||||
<p><i>This process will remove freeview EPG data from the recording.<br>
|
||||
These data are not required and can increase the size of the
|
||||
recording file by as much as 20%.<br>
|
||||
Your original recording files will be retained in a folder called _original.
|
||||
</i>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format %T]</td></tr>
|
||||
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
|
||||
<tr><th>Time:</th>
|
||||
<td>Shrinking will take around [clock format $esttime -format "%T"]</td></tr>
|
||||
<tr><th>Estimated Saving:</th>
|
||||
<td class=va><span id=analysis class=va>
|
||||
<img class=va src=/img/loading.gif> Analysing file, please wait...
|
||||
</span></td></tr>
|
||||
</table>
|
||||
|
||||
<span class=hidden id=params
|
||||
file=\"[cgi_quote_url $rfile]\"
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
></span>
|
||||
|
||||
<div id=stripdiv class=hidden style=\"padding: 1em\">
|
||||
<button id=stripit>Shrink recording</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Shrinking: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
"
|
||||
|
||||
48
var/mongoose/html/browse/strip/strip.js
Executable file
48
var/mongoose/html/browse/strip/strip.js
Executable file
@@ -0,0 +1,48 @@
|
||||
var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
var file = $('#params').attr('file');
|
||||
|
||||
$.get('progress.jim' + '?file=' + file,
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#analysis').load('analyse.jim?file=' + $('#params').attr('file'),
|
||||
function(t) {
|
||||
if ($.trim(t) == '0%')
|
||||
{
|
||||
$('#output').text('Recording is already stripped.');
|
||||
$('#back').slideDown();
|
||||
}
|
||||
else
|
||||
$('#stripdiv').slideDown();
|
||||
});
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#stripit').button().click(function() {
|
||||
$('#stripdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').text('Please do not interrupt...')
|
||||
.load('execute.jim?file=' + $('#params').attr('file'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
17
var/mongoose/html/browse/style.css
Normal file
17
var/mongoose/html/browse/style.css
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
div.brow
|
||||
{
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
div.cliplist span
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
#clipclear
|
||||
{
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
75
var/mongoose/html/css/iphone-style-checkboxes.css
Normal file
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'); }
|
||||
37
var/mongoose/html/css/jconfirmaction.jquery.css
Normal file
37
var/mongoose/html/css/jconfirmaction.jquery.css
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
.jcaquestion {
|
||||
position: absolute;
|
||||
display: inline;
|
||||
text-align: center;
|
||||
width: 174px;
|
||||
height: 78px;
|
||||
font-size: 13px;
|
||||
line-height: 1.5em;
|
||||
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;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.jcayes, .jcacancel {
|
||||
margin-top: .5em;
|
||||
margin-right: .5em;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
width: 63px;
|
||||
height: 21px;
|
||||
color: #fff;
|
||||
text-shadow: 0px 1px 0px #000;
|
||||
background: url('/img/button.png') left top no-repeat;
|
||||
}
|
||||
|
||||
.jcatitle {
|
||||
font-size: 30px;
|
||||
margin-bottom: 1.5em;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
text-shadow: 0px 2px 0px #fff;
|
||||
}
|
||||
|
||||
57
var/mongoose/html/css/jquery.alerts.css
Normal file
57
var/mongoose/html/css/jquery.alerts.css
Normal file
@@ -0,0 +1,57 @@
|
||||
#popup_container {
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
min-width: 300px; /* Dialog will be no smaller than this */
|
||||
max-width: 600px; /* Dialog will wrap after this width */
|
||||
background: #FFF;
|
||||
border: solid 5px #999;
|
||||
color: #000;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#popup_title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
line-height: 1.75em;
|
||||
color: #666;
|
||||
background: #CCC url(/img/jalert/title.gif) top repeat-x;
|
||||
border: solid 1px #FFF;
|
||||
border-bottom: solid 1px #999;
|
||||
cursor: default;
|
||||
padding: 0em;
|
||||
margin: 0em;
|
||||
}
|
||||
|
||||
#popup_content {
|
||||
background: 16px 16px no-repeat url(/img/jalert/info.gif);
|
||||
padding: 1em 1.75em;
|
||||
margin: 0em;
|
||||
}
|
||||
|
||||
#popup_content.alert {
|
||||
background-image: url(/img/jalert/info.gif);
|
||||
}
|
||||
|
||||
#popup_content.confirm {
|
||||
background-image: url(/img/jalert/important.gif);
|
||||
}
|
||||
|
||||
#popup_content.prompt {
|
||||
background-image: url(/img/jalert/help.gif);
|
||||
}
|
||||
|
||||
#popup_message {
|
||||
padding-left: 48px;
|
||||
}
|
||||
|
||||
#popup_panel {
|
||||
text-align: center;
|
||||
margin: 1em 0em 0em 1em;
|
||||
}
|
||||
|
||||
#popup_prompt {
|
||||
margin: .5em 0em;
|
||||
}
|
||||
48
var/mongoose/html/css/jquery.bar.css
Normal file
48
var/mongoose/html/css/jquery.bar.css
Normal file
@@ -0,0 +1,48 @@
|
||||
.jbar{
|
||||
height:50px;
|
||||
width:100%;
|
||||
background-color: #ffffcc;
|
||||
color: #ff4000;
|
||||
position:fixed;
|
||||
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=95);
|
||||
opacity: 0.95;
|
||||
-moz-opacity: 0.95;
|
||||
text-align:center;
|
||||
left:0px;
|
||||
z-index:9999999;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
.jbar-top{
|
||||
top:0px;
|
||||
border-top:2px solid #fff;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
.jbar-bottom{
|
||||
bottom:0px;
|
||||
border-bottom:2px solid #fff;
|
||||
border-top: 1px solid #ebebeb;
|
||||
color:#777;
|
||||
}
|
||||
.jbar-content{
|
||||
line-height:46px;
|
||||
font-size: 18px;
|
||||
font-family:'Lucida Grande',sans-serif;
|
||||
}
|
||||
a.jbar-cross{
|
||||
position:absolute;
|
||||
width:31px;
|
||||
height:31px;
|
||||
background:transparent url(/images/cross.png) no-repeat top left;
|
||||
cursor:pointer;
|
||||
right:10px;
|
||||
}
|
||||
a.jbar-cross:hover{
|
||||
background-image: url(/images/cross_hover.png)
|
||||
}
|
||||
.jbar-top a.jbar-cross{
|
||||
top:8px;
|
||||
}
|
||||
.jbar-bottom a.jbar-cross{
|
||||
bottom:8px;
|
||||
}
|
||||
@@ -1,62 +1,75 @@
|
||||
/* 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.pwedit A { background-image: url(/img/context/page_white_edit.png); }
|
||||
.contextMenu LI.pwcopy A { background-image: url(/img/context/page_white_copy.png); }
|
||||
.contextMenu LI.pwpaste A { background-image: url(/img/context/page_white_paste.png); }
|
||||
.contextMenu LI.pwdelete A { background-image: url(/img/context/page_white_delete.png); }
|
||||
.contextMenu LI.edit A { background-image: url(/img/context/edit.png); }
|
||||
.contextMenu LI.copy A { background-image: url(/img/context/copy.png); }
|
||||
.contextMenu LI.paste A { background-image: url(/img/context/paste.png); }
|
||||
.contextMenu LI.delete A { background-image: url(/img/context/delete.png); }
|
||||
.contextMenu LI.cut A { background-image: url(/img/context/cut.png); }
|
||||
.contextMenu LI.quit A { background-image: url(/img/context/door.png); }
|
||||
.contextMenu LI.compress A { background-image: url(/img/context/compress.png); }
|
||||
.contextMenu LI.compressr A { background-image: url(/img/context/compressr.png); }
|
||||
.contextMenu LI.dedup A { background-image: url(/img/context/dedup.png); }
|
||||
.contextMenu LI.decrypt A { background-image: url(/img/context/decrypt.png); }
|
||||
.contextMenu LI.decryptr A { background-image: url(/img/context/decryptr.png); }
|
||||
.contextMenu LI.mpg A { background-image: url(/img/context/mpg.png); }
|
||||
.contextMenu LI.clock A { background-image: url(/img/context/clock.png); }
|
||||
|
||||
|
||||
|
||||
31
var/mongoose/html/css/jquery.progressbar.css
Normal file
31
var/mongoose/html/css/jquery.progressbar.css
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
/* progress bar container */
|
||||
.progressbar, #progressbar{
|
||||
border:1px solid black;
|
||||
width:200px;
|
||||
height:20px;
|
||||
position:relative;
|
||||
color:black;
|
||||
}
|
||||
/* color bar */
|
||||
.progressbar div.progress,#progressbar div.progress{
|
||||
position:absolute;
|
||||
width:0;
|
||||
height:100%;
|
||||
overflow:hidden;
|
||||
background-color:#369;
|
||||
}
|
||||
/* text on bar */
|
||||
.progressbar div.progress .text,#progressbar div.progress .text{
|
||||
position:absolute;
|
||||
text-align:center;
|
||||
color:white;
|
||||
}
|
||||
/* text off bar */
|
||||
.progressbar div.text,#progressbar div.text{
|
||||
position:absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
91
var/mongoose/html/css/jqueryFileTree.css
Normal file
91
var/mongoose/html/css/jqueryFileTree.css
Normal file
@@ -0,0 +1,91 @@
|
||||
UL.jqueryFileTree {
|
||||
font-family: Verdana, sans-serif;
|
||||
font-size: 11px;
|
||||
line-height: 18px;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
UL.jqueryFileTree LI {
|
||||
list-style: none;
|
||||
padding: 0px;
|
||||
padding-left: 20px;
|
||||
margin: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
UL.jqueryFileTree A {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
padding: 0px 2px;
|
||||
}
|
||||
|
||||
UL.jqueryFileTree A:hover {
|
||||
background: #BDF;
|
||||
}
|
||||
|
||||
/* Core Styles */
|
||||
.jqueryFileTree LI.directory { background: url(/img/filetree/directory.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.expanded { background: url(/img/filetree/folder_open.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.file { background: url(/img/filetree/file.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.wait { background: url(/img/filetree/spinner.gif) left top no-repeat; }
|
||||
/* File Extensions*/
|
||||
.jqueryFileTree LI.ext_3gp { background: url(/img/filetree/film.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_afp { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_afpa { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_asp { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_aspx { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_avi { background: url(/img/filetree/film.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_bat { background: url(/img/filetree/application.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_bmp { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_c { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_cfm { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_cgi { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_com { background: url(/img/filetree/application.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_cpp { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_css { background: url(/img/filetree/css.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_doc { background: url(/img/filetree/doc.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_exe { background: url(/img/filetree/application.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_gif { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_fla { background: url(/img/filetree/flash.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_h { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_htm { background: url(/img/filetree/html.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_html { background: url(/img/filetree/html.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_jar { background: url(/img/filetree/java.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_jpg { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_jpeg { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_js { background: url(/img/filetree/script.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_lasso { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_log { background: url(/img/filetree/txt.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_m4p { background: url(/img/filetree/music.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_mov { background: url(/img/filetree/film.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_mp3 { background: url(/img/filetree/music.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_mp4 { background: url(/img/filetree/film.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_mpg { background: url(/img/filetree/film.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_mpeg { background: url(/img/filetree/film.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_ogg { background: url(/img/filetree/music.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_pcx { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_pdf { background: url(/img/filetree/pdf.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_php { background: url(/img/filetree/php.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_png { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_ppt { background: url(/img/filetree/ppt.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_psd { background: url(/img/filetree/psd.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_pl { background: url(/img/filetree/script.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_py { background: url(/img/filetree/script.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_rb { background: url(/img/filetree/ruby.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_rbx { background: url(/img/filetree/ruby.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_rhtml { background: url(/img/filetree/ruby.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_rpm { background: url(/img/filetree/linux.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_ruby { background: url(/img/filetree/ruby.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_sql { background: url(/img/filetree/db.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_swf { background: url(/img/filetree/flash.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_tif { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_tiff { background: url(/img/filetree/picture.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_txt { background: url(/img/filetree/txt.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_vb { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_wav { background: url(/img/filetree/music.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_wmv { background: url(/img/filetree/film.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_xls { background: url(/img/filetree/xls.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_xml { background: url(/img/filetree/code.png) left top no-repeat; }
|
||||
.jqueryFileTree LI.ext_zip { background: url(/img/filetree/zip.png) left top no-repeat; }
|
||||
@@ -13,6 +13,19 @@ html>body
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.left, .cleft
|
||||
{
|
||||
float: left;
|
||||
}
|
||||
.cleft
|
||||
{
|
||||
clear: left;
|
||||
}
|
||||
fieldset.left, fieldset.cleft
|
||||
{
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.container
|
||||
{
|
||||
position: relative;
|
||||
@@ -52,6 +65,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,18 +83,24 @@ table.borders, table.borders td, table.borders th
|
||||
empty-cells: show;
|
||||
}
|
||||
|
||||
table tr.odd
|
||||
.odd
|
||||
{
|
||||
background: #ccff99;
|
||||
color: black;
|
||||
}
|
||||
|
||||
table tr.even
|
||||
.even
|
||||
{
|
||||
background: #ffffcc;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.hover
|
||||
{
|
||||
background: #f6ff5b;
|
||||
color: black;
|
||||
}
|
||||
|
||||
table td,table th
|
||||
{
|
||||
font-size: small;
|
||||
@@ -86,7 +112,7 @@ table th
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.keyval th
|
||||
table.keyval th, th.key
|
||||
{
|
||||
background: #ccff99;
|
||||
font-weight: bold;
|
||||
@@ -101,7 +127,7 @@ table.keyval td
|
||||
color: black;
|
||||
}
|
||||
|
||||
pre
|
||||
pre, .pre, .prelike
|
||||
{
|
||||
font-family: Consolas, 'Courier New', Courier, monospace;
|
||||
color: black;
|
||||
@@ -119,7 +145,10 @@ pre
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-moz-border-radius-topright: 4px;
|
||||
-khtml-border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
pre, .pre
|
||||
{
|
||||
white-space: pre-wrap;
|
||||
white-space: -moz-pre-wrap !important;
|
||||
white-space: -pre-wrap;
|
||||
@@ -174,6 +203,12 @@ pre
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.filesize
|
||||
{
|
||||
color: #6a6aff;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.footnote
|
||||
{
|
||||
color: #ff4000;
|
||||
@@ -200,6 +235,11 @@ pre
|
||||
color: black;
|
||||
}
|
||||
|
||||
.strike
|
||||
{
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.greenshade
|
||||
{
|
||||
background: #e4faa8;
|
||||
@@ -212,6 +252,12 @@ pre
|
||||
color: black;
|
||||
}
|
||||
|
||||
.redshade
|
||||
{
|
||||
background: #ff4000;
|
||||
color: white;
|
||||
}
|
||||
|
||||
img.progress
|
||||
{
|
||||
background: transparent url(/img/percentback.png) top left no-repeat;
|
||||
@@ -225,3 +271,142 @@ img.progress
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.block
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.hidden
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
input.text
|
||||
{
|
||||
padding: .4em;
|
||||
}
|
||||
|
||||
.highlight
|
||||
{
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
.focused
|
||||
{
|
||||
border: 2px solid red;
|
||||
}
|
||||
|
||||
div.cut, div.keep
|
||||
{
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
}
|
||||
|
||||
div.keep
|
||||
{
|
||||
background: green;
|
||||
color: white;
|
||||
}
|
||||
|
||||
div.cut
|
||||
{
|
||||
background: #ff4000;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ui-button-text
|
||||
{
|
||||
font-size: inherit !important;
|
||||
}
|
||||
|
||||
.ui-button, .ui-button-text
|
||||
{
|
||||
padding: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.also
|
||||
{
|
||||
font-size: 0.9em;
|
||||
font-style: italic;
|
||||
color: #333;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
div.toolbarouter
|
||||
{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
div.toolbar
|
||||
{
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
left: 30px;
|
||||
z-index: 29;
|
||||
display: none;
|
||||
width: 80%;
|
||||
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;
|
||||
margin-top: -1px;
|
||||
background: #d2e0ea;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
span.toolbarcell
|
||||
{
|
||||
float: left;
|
||||
border-right: 1px solid #ccc;
|
||||
text-align: center;
|
||||
padding: 0 1em;
|
||||
}
|
||||
|
||||
.tbhover
|
||||
{
|
||||
background: #dfe8ef;
|
||||
border-top: solid 1px #ccc;
|
||||
border-left: solid 1px #ccc;
|
||||
}
|
||||
|
||||
#tbstatus
|
||||
{
|
||||
width: 100%;
|
||||
border-top: 1px solid #ccc;
|
||||
margin: 1em 0;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
button.blue
|
||||
{
|
||||
background: url(/img/gloss_wave_blue.png) repeat-x center;
|
||||
border: 1px solid blue;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
button.green
|
||||
{
|
||||
background: url(/img/gloss_wave_green.png) repeat-x center;
|
||||
border: 1px solid green;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
button.red
|
||||
{
|
||||
background: url(/img/gloss_wave_red.png) repeat-x center;
|
||||
border: 1px solid green;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
div#restart_block
|
||||
{
|
||||
z-index: 31;
|
||||
}
|
||||
|
||||
|
||||
31
var/mongoose/html/css/tsort.css
Normal file
31
var/mongoose/html/css/tsort.css
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
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 .headerplain {
|
||||
background-image: url(/img/tsort/bgplain.png);
|
||||
background-repeat: no-repeat;
|
||||
border-left: 1px solid #FFF;
|
||||
border-right: 1px solid #000;
|
||||
border-top: 1px solid #FFF;
|
||||
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
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;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user