Compare commits
12 Commits
0.9.8@1008
...
0.9.12@214
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d8d630b07 | ||
|
|
101f5a7946 | ||
|
|
50346e5d4b | ||
|
|
f0d22b3b01 | ||
|
|
7356e6e220 | ||
|
|
7d1331f1aa | ||
|
|
895dda6dee | ||
|
|
d7284ff3ef | ||
|
|
d04dcee369 | ||
|
|
db4f7cf122 | ||
|
|
015b992fcb | ||
|
|
a41c2ae6f9 |
@@ -1,9 +1,9 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 0.9.7-3
|
||||
Version: 0.9.12
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends: webif-channelicons(>=1.0.1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.1)
|
||||
Depends: webif-channelicons(>=1.0.1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.0.3)
|
||||
Suggests: ffmpeg,webif-iphone
|
||||
Description: An evolving web interface for the Humax.
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
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 >> /tmp/webif_auto.log 2>&1'
|
||||
) > $cronf
|
||||
|
||||
# Add anacron jobs
|
||||
|
||||
ana=$PKG_ROOT/etc/anacrontab
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
require rsv.class
|
||||
|
||||
@@ -68,16 +68,17 @@ set grp 0
|
||||
foreach res [$rsvdb query {
|
||||
select eFavGroup,
|
||||
TBL_FAV.eSvcType,
|
||||
substr(szSvcName, 2) as szSvcName
|
||||
substr(szSvcName, 2) as szSvcName,
|
||||
favIdx
|
||||
from TBL_FAV join TBL_SVC using (hSvc)
|
||||
order by eFavGroup
|
||||
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)"
|
||||
puts $fd "fav\t$res(eFavGroup)\t$res(eSvcType)\t$res(szSvcName)\t$res(favIdx)"
|
||||
}
|
||||
puts "Done."
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
set dir /mod/var/backup
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
require rsv.class findhsvc system.class
|
||||
|
||||
@@ -108,6 +108,8 @@ foreach line $data {
|
||||
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} {
|
||||
@@ -123,8 +125,8 @@ foreach line $data {
|
||||
}
|
||||
|
||||
set query "
|
||||
insert into pending.fav(hSvc, eFavGroup, eSvcType)
|
||||
values($hsvc, $group, $type);
|
||||
insert into pending.fav(favIdx, hSvc, eFavGroup, eSvcType)
|
||||
values($idx, $hsvc, $group, $type);
|
||||
"
|
||||
|
||||
$rsvdb query $query
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class settings.class escape
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
@@ -33,18 +33,17 @@ if {$order eq "-"} {
|
||||
set model [system model]
|
||||
set dustbin [system dustbin 1]
|
||||
|
||||
proc icon {img {hover ""} {extra ""}} {
|
||||
puts -nonewline "<img src=$img class=va height=21 $extra"
|
||||
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} {
|
||||
proc directory {file bfile tbfile} {
|
||||
global flatten
|
||||
|
||||
regsub -all " +" $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" }
|
||||
@@ -63,9 +62,30 @@ proc directory {file bfile} {
|
||||
if $noflat { icon "/img/flat-tyre.png" "No-flatten" }
|
||||
}
|
||||
|
||||
set autoshrink 0
|
||||
if {[file exists "$file/.autoshrink"]} {
|
||||
set autoshrink 1
|
||||
icon "/img/compress.png" "Auto-shrink"
|
||||
}
|
||||
|
||||
set autodedup 0
|
||||
if {[file exists "$file/.autodedup"]} {
|
||||
set autodedup 1
|
||||
icon "/img/dedup.png" "Auto-dedup"
|
||||
}
|
||||
|
||||
set autodecrypt 0
|
||||
if {[file exists "$file/.autodecrypt"]} {
|
||||
set autodecrypt 1
|
||||
icon "/img/decrypt.png" "Auto-decrypt"
|
||||
}
|
||||
|
||||
puts -nonewline "
|
||||
<a href=#>
|
||||
<img class=\"dopt va\" border=0 width=45 "
|
||||
puts -nonewline "autoshrink=$autoshrink "
|
||||
puts -nonewline "autodedup=$autodedup "
|
||||
puts -nonewline "autodecrypt=$autodecrypt "
|
||||
if $flatten { puts -nonewline "noflat=$noflat " }
|
||||
puts "
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
@@ -80,11 +100,12 @@ proc directory {file bfile} {
|
||||
|
||||
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
|
||||
directory $file $bfile $tbfile
|
||||
continue
|
||||
}
|
||||
set ext [file extension $file]
|
||||
@@ -100,16 +121,19 @@ proc entry {file} {{i 0}} {
|
||||
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
|
||||
@@ -187,6 +211,10 @@ proc entry {file} {{i 0}} {
|
||||
set dlna 1
|
||||
}
|
||||
|
||||
# Shrunk (shown when necessary via Ajax)
|
||||
icon "/img/compress.png" "Shrunk" \
|
||||
"id=\"sp_$tbfile\"" "va hidden"
|
||||
|
||||
set bx [$ts get bookmarks]
|
||||
}
|
||||
|
||||
@@ -194,7 +222,7 @@ proc entry {file} {{i 0}} {
|
||||
|
||||
puts "
|
||||
<a href=#>
|
||||
<img class=\"opt va\" border=0 width=45 type=$type did=$i
|
||||
<img class=\"$omenu va\" border=0 width=45 type=$type did=$i
|
||||
locked=$locked encd=$encd def=$def new=$new bx=$bx
|
||||
rsize=$rsz
|
||||
odencd=$odencd dlna=$dlna
|
||||
@@ -222,7 +250,7 @@ puts {
|
||||
<link type=text/css rel=stylesheet href=/cgi-bin/browse/style.css />
|
||||
}
|
||||
|
||||
source /mod/var/mongoose/cgi-bin/browse/assets.jim
|
||||
source browse/assets.jim
|
||||
|
||||
puts "
|
||||
<span style=\"display:none\" id=dir>$dir</span>
|
||||
|
||||
@@ -14,7 +14,10 @@ puts {
|
||||
|
||||
}
|
||||
if {$model eq "HDR"} {
|
||||
puts { <li class="separator"><a href=#decrypt>Decrypt</a></li> }
|
||||
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 {
|
||||
@@ -33,14 +36,27 @@ puts {
|
||||
<li><a href=#new>Toggle New</a></li>
|
||||
</ul>
|
||||
|
||||
<ul id=doptmenu class=contextMenu style="width: 160px">
|
||||
<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=doptmenu class=contextMenu style="width: 180px">
|
||||
<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 class=separator><a href=#resetnew>Reset new flag</a></li>
|
||||
<li class="separator compress"><a href=#shrink>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> }
|
||||
}
|
||||
|
||||
if $flatten {
|
||||
puts { <li class="separator"><a href=#flat>No-Flatten</a></li> }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -112,6 +112,24 @@ function new_folder_callback(data, status, xhr)
|
||||
$.each(data, set_folder_new);
|
||||
}
|
||||
|
||||
function insert_shrunk(file, perc)
|
||||
{
|
||||
if (perc == 0)
|
||||
{
|
||||
file = file.replace(/[ ]/g, '');
|
||||
file = file.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||
//console.log("File: (%s) = (%s)", file, perc);
|
||||
$('#sp_' + file).show();
|
||||
}
|
||||
}
|
||||
|
||||
function shrunk_callback(data, status, xhr)
|
||||
{
|
||||
//console.log("Status: %s", status);
|
||||
//console.dir(data);
|
||||
$.each(data, insert_shrunk);
|
||||
}
|
||||
|
||||
function delete_callback(file, dir, id)
|
||||
{
|
||||
var el = 'div.bf#' + id;
|
||||
@@ -218,6 +236,13 @@ function preparemenu(el, menu)
|
||||
else
|
||||
$(menu).disableContextMenuItems('#crop');
|
||||
|
||||
/*
|
||||
if (el.attr('def') == 'HD')
|
||||
$(menu).disableContextMenuItems('#strip');
|
||||
else
|
||||
*/
|
||||
$(menu).enableContextMenuItems('#strip');
|
||||
|
||||
if (el.attr('rsize') > 4294967296)
|
||||
$(menu).enableContextMenuItems('#chunk');
|
||||
else
|
||||
@@ -264,11 +289,6 @@ function preparemenu(el, menu)
|
||||
$(menu).disableContextMenuItems('#lock');
|
||||
//$(menu).disableContextMenuItems('#enc');
|
||||
$(menu).disableContextMenuItems('#new');
|
||||
$(menu).disableContextMenuItems('#decrypt');
|
||||
$(menu).disableContextMenuItems('#audio');
|
||||
$(menu).disableContextMenuItems('#mpg');
|
||||
$(menu).disableContextMenuItems('#crop');
|
||||
$(menu).disableContextMenuItems('#chunk');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -283,6 +303,33 @@ function preparedmenu(el, menu)
|
||||
$(menu).changeContextMenuItem('#flat',
|
||||
'Prevent Flatten');
|
||||
}
|
||||
if (el.attr('autoshrink') != undefined)
|
||||
{
|
||||
if (el.attr('autoshrink') > 0)
|
||||
$(menu).changeContextMenuItem('#shrink',
|
||||
'Disable Auto-shrink');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#shrink',
|
||||
'Enable Auto-shrink');
|
||||
}
|
||||
if (el.attr('autodedup') != undefined)
|
||||
{
|
||||
if (el.attr('autodedup') > 0)
|
||||
$(menu).changeContextMenuItem('#dedup',
|
||||
'Disable Auto-dedup');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#dedup',
|
||||
'Enable Auto-dedup');
|
||||
}
|
||||
if (el.attr('autodecrypt') != undefined)
|
||||
{
|
||||
if (el.attr('autodecrypt') > 0)
|
||||
$(menu).changeContextMenuItem('#decrypt',
|
||||
'Disable Auto-decrypt');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#decrypt',
|
||||
'Enable Auto-decrypt');
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
@@ -357,6 +404,11 @@ var menuclick = function(action, el, pos)
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'strip':
|
||||
window.location.href = '/cgi-bin/browse/strip/strip.jim?file=' +
|
||||
file;
|
||||
break;
|
||||
|
||||
case 'chunk':
|
||||
window.location.href = '/cgi-bin/browse/chunk/chunk.jim?file=' +
|
||||
file;
|
||||
@@ -432,7 +484,26 @@ var dmenuclick = function(action, el, pos)
|
||||
break;
|
||||
|
||||
case 'flat':
|
||||
var url = '/cgi-bin/browse/flat.jim?dir=' + file;
|
||||
var url = '/cgi-bin/browse/flagdir.jim?dir=' + file +
|
||||
'&flag=noflatten';
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
case 'dedup':
|
||||
var url = '/cgi-bin/browse/flagdir.jim?dir=' + file +
|
||||
'&flag=autodedup';
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
case 'shrink':
|
||||
var url = '/cgi-bin/browse/flagdir.jim?dir=' + file +
|
||||
'&flag=autoshrink';
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
case 'decrypt':
|
||||
var url = '/cgi-bin/browse/flagdir.jim?dir=' + file +
|
||||
'&flag=autodecrypt';
|
||||
$.get(url, function() { window.location.reload(true); });
|
||||
break;
|
||||
|
||||
@@ -457,6 +528,16 @@ var dmenuclick = function(action, el, pos)
|
||||
menuclick
|
||||
);
|
||||
|
||||
// Bind context menu to opt+ image
|
||||
$('img.oopt').contextMenu(
|
||||
{
|
||||
menu: 'ooptmenu',
|
||||
leftButton: true,
|
||||
beforeShow: preparemenu
|
||||
},
|
||||
menuclick
|
||||
);
|
||||
|
||||
$('img.dopt').contextMenu(
|
||||
{
|
||||
menu: 'doptmenu',
|
||||
@@ -574,6 +655,10 @@ var dmenuclick = function(action, el, pos)
|
||||
$.getJSON('/cgi-bin/browse/sizes.jim?dir=' + encodeURIComponent(dir),
|
||||
folder_size_callback);
|
||||
|
||||
// Flag shrunk recordings
|
||||
$.getJSON('/cgi-bin/browse/shrunk.jim?dir=' + encodeURIComponent(dir),
|
||||
shrunk_callback);
|
||||
|
||||
// Flag folders with unwatched items
|
||||
$.getJSON('/cgi-bin/browse/newdir.jim?dir=' + encodeURIComponent(dir),
|
||||
new_folder_callback);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require clipboard.class ts.class
|
||||
|
||||
puts "Content-Type: text/html; no-cache"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class pretty_size
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -10,6 +10,12 @@ cgi_input
|
||||
#cgi_dump
|
||||
|
||||
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]
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -22,6 +22,11 @@ if {$url eq ""} {
|
||||
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]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class tdelete
|
||||
|
||||
puts "Content-Type: text/html\r\n"
|
||||
@@ -56,10 +56,8 @@ foreach file [cgi_get files] {
|
||||
puts -nonewline "Directory..."
|
||||
if {$ldustbin ne ""} {
|
||||
set ndir "[bindir $file]/[file tail $file]"
|
||||
if {$force} {
|
||||
while {[file isdirectory $ndir]} {
|
||||
append ndir "_"
|
||||
}
|
||||
while {[file isdirectory $ndir]} {
|
||||
append ndir "_"
|
||||
}
|
||||
file rename $file $ndir
|
||||
touch $ndir
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
#puts "Content-Type: text/plain\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
source /mod/webif/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
source /mod/webif/lib/ts.class
|
||||
|
||||
puts "Content-Type: application/json"
|
||||
puts ""
|
||||
|
||||
@@ -10,7 +10,7 @@ cgi_input
|
||||
|
||||
if [file exists /mod/bin/ffmpeg] {
|
||||
set file [dict get $_cgi file]
|
||||
puts [exec /mod/var/mongoose/lib/ffmpeg -i $file]
|
||||
puts [exec /mod/webif/lib/bin/ffmpeg -i $file]
|
||||
} else {
|
||||
puts "Install ffmpeg package for more information..."
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/pretty_size
|
||||
source /mod/webif/lib/setup
|
||||
require pretty_size
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
@@ -20,8 +21,7 @@ file stat $file st
|
||||
set sz [pretty_size $st(size)]
|
||||
|
||||
if {$type eq "ts"} {
|
||||
source /mod/var/mongoose/lib/epg.class
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
require epg.class ts.class
|
||||
|
||||
set ts [ts fetch $file]
|
||||
|
||||
|
||||
22
var/mongoose/cgi-bin/browse/flagdir.jim
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
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."
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set dir [cgi_get dir]
|
||||
if {![file isdirectory $dir]} { exit }
|
||||
set noflat 0
|
||||
if {[string match {\[*\]} [file tail $dir]]} {
|
||||
set ndir [string range [file tail $dir] 1 end-1]
|
||||
file rename $dir "[file dirname $dir]/$ndir"
|
||||
puts "Unflagged directory as noflatten."
|
||||
exit
|
||||
}
|
||||
if {[file exists "$dir/.noflatten"]} {
|
||||
file delete "$dir/.noflatten"
|
||||
puts "Unflagged directory as noflatten."
|
||||
} else {
|
||||
close [open "$dir/.noflatten" w]
|
||||
puts "Flagged directory as noflatten."
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
#source /mod/var/mongoose/lib/setup
|
||||
#source /mod/webif/lib/setup
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
package require pack
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class hexdump
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/ts.class
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
33
var/mongoose/cgi-bin/browse/shrunk.jim
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
|
||||
#puts "Content-Type: text/plain"
|
||||
puts "Content-Type: application/json"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set dir [cgi_get dir "/media/My Video/Children"]
|
||||
|
||||
puts "{"
|
||||
regsub -all {([\\["$])} $dir {\\\1} xdir
|
||||
foreach file [readdir -nocomplain $dir] {
|
||||
if {![string match {*.ts} $file]} { continue }
|
||||
|
||||
regsub -all {([\\["$])} [file rootname $file] {\\\1} xfile
|
||||
if {[catch {set perc [exec /mod/bin/stripts -Aq "$xdir/$xfile"]}]} {
|
||||
continue
|
||||
}
|
||||
if {[string match {*%} $perc]} {
|
||||
set perc [string range $perc 0 end-1]
|
||||
} else {
|
||||
set perc 0
|
||||
}
|
||||
|
||||
puts " \"$file\": $perc,"
|
||||
}
|
||||
puts " \"dummy\": 0"
|
||||
puts "}"
|
||||
|
||||
16
var/mongoose/cgi-bin/browse/strip/analyse.jim
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set base [file rootname $rfile]
|
||||
|
||||
puts [exec /mod/bin/stripts -aq $base]
|
||||
|
||||
52
var/mongoose/cgi-bin/browse/strip/execute.jim
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
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"
|
||||
|
||||
set striptime [expr [expr [clock milliseconds] - $stripstart] / 1000.0]
|
||||
puts "Time taken: $striptime"
|
||||
|
||||
27
var/mongoose/cgi-bin/browse/strip/progress.jim
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
66
var/mongoose/cgi-bin/browse/strip/strip.jim
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
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)
|
||||
|
||||
header
|
||||
|
||||
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>Squeezing 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>Perform squeeze operation</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Squeezing: <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/cgi-bin/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 = '/cgi-bin/browse.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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require system.class chunked pretty_size
|
||||
|
||||
cgi_input
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require altrow progressbar epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require altrow
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
8
var/mongoose/cgi-bin/env.jim
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts "Content-type: text/plain\n"
|
||||
|
||||
foreach f [dict keys $env] {
|
||||
puts "$f = $env($f)"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class spinner.class altrow
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class spinner.class altrow
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require pkg.class chunked
|
||||
|
||||
cgi_input
|
||||
@@ -11,7 +11,7 @@ set cmd [cgi_get cmd update]
|
||||
|
||||
proc opkg {cmd} {
|
||||
chunk ">>> opkg $cmd\r\n"
|
||||
set bcmd "|/mod/var/mongoose/lib/opkg $cmd"
|
||||
set bcmd "|/mod/webif/lib/bin/opkg $cmd"
|
||||
set fd [open $bcmd r]
|
||||
while {[gets $fd line] >= 0} {
|
||||
chunk "$line\r\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class pkg.class altrow
|
||||
|
||||
if {[[settings] pkgdev]} { set filter 0 } else { set filter 1 }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require rsv.class system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
source /mod/var/mongoose/include/restart.jim
|
||||
source /mod/webif/include/restart.jim
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class
|
||||
require plugin
|
||||
|
||||
@@ -29,6 +29,7 @@ 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]
|
||||
|
||||
# Handle updates
|
||||
|
||||
@@ -65,6 +66,7 @@ _handle_update ascii smtp_server $smtp_server "SMTP Server"
|
||||
handle_int_update channel_group $channel_group "Channel Group"
|
||||
handle_str_update epg_style $epg_style "EPG Type"
|
||||
handle_int_update pkgdev $pkgdev "Development Package Display"
|
||||
handle_int_update notoolbar $notoolbar "Disable toolbar"
|
||||
|
||||
set acluser [cgi_get acluser "-"]
|
||||
set aclpass [cgi_get aclpass "-"]
|
||||
@@ -140,6 +142,17 @@ puts ">
|
||||
</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 "
|
||||
<tr>
|
||||
<form class=auto id=epg_style method=get action=$env(REQUEST_URI)>
|
||||
|
||||
@@ -73,5 +73,24 @@ $(document).ready(function () {
|
||||
.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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require system.class findhsvc epg.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts "Pragma: no-cache"
|
||||
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
|
||||
puts ""
|
||||
|
||||
if {[catch {set pid [exec pgrep humaxtv]}]} {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
@@ -29,7 +29,7 @@ if {$stt <= [clock seconds]} {
|
||||
set current 0
|
||||
}
|
||||
|
||||
set favlist [epg favlist]
|
||||
set favgroup [[settings] channel_group]
|
||||
|
||||
set hours 4.0
|
||||
set seconds $($hours * 3600)
|
||||
@@ -51,7 +51,13 @@ set secpx $($minpx / 60.0)
|
||||
|
||||
set start [clock milliseconds]
|
||||
if {$::qepg} {
|
||||
set records [epg dbfetch dump -trange "$stt:$ett"]
|
||||
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"]]
|
||||
@@ -87,9 +93,6 @@ set lcn 0
|
||||
set bg "odd"
|
||||
|
||||
foreach e $records {
|
||||
if {$favlist != "" && [$e get service_id] ni $favlist} {
|
||||
continue
|
||||
}
|
||||
set chnum [$e get channel_num]
|
||||
if {$chnum == 0} { continue }
|
||||
|
||||
@@ -218,12 +221,12 @@ puts "
|
||||
</a><br>
|
||||
"
|
||||
|
||||
epg cleanup
|
||||
|
||||
set end [clock milliseconds]
|
||||
puts "<font class=footnote>
|
||||
Retrieved in: [expr [expr $got - $start] / 1000.0] seconds.
|
||||
</font>"
|
||||
|
||||
epg cleanup
|
||||
|
||||
footer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<!--#exec cmd="/mod/var/mongoose/include/backup.jim" -->
|
||||
<!--#exec cmd="/mod/webif/include/backup.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -64,5 +64,8 @@
|
||||
.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.dedup A { background-image: url(/img/context/dedup.png); }
|
||||
.contextMenu LI.decrypt A { background-image: url(/img/context/decrypt.png); }
|
||||
|
||||
|
||||
|
||||
@@ -326,3 +326,50 @@ div.cut
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
source /mod/var/mongoose/html/dedup/normalise.jim
|
||||
source /mod/var/mongoose/html/dedup/process.jim
|
||||
source /mod/webif/html/dedup/normalise.jim
|
||||
source /mod/webif/html/dedup/process.jim
|
||||
|
||||
set dirs {}
|
||||
|
||||
@@ -23,6 +23,7 @@ foreach dir $dirs {
|
||||
set dir [string range $dir 0 end-1]
|
||||
}
|
||||
puts "\[$dir\]"
|
||||
loadseries $dir
|
||||
|
||||
foreach file [readdir $dir] {
|
||||
if {[file extension $file] ne ".hmt"} { continue }
|
||||
@@ -67,7 +68,7 @@ foreach dir $dirs {
|
||||
# Dooooo, it.
|
||||
$ts settitle $syn
|
||||
ts renamegroup $file $fn
|
||||
puts -nonewline "Done"
|
||||
puts -nonewline " ... Done"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size altrow
|
||||
|
||||
source normalise.jim
|
||||
@@ -31,8 +31,7 @@ puts "<fieldset style=\"display: inline\">
|
||||
</tr>
|
||||
"
|
||||
|
||||
set seen {}
|
||||
|
||||
loadseries $dir
|
||||
foreach file [readdir $dir] {
|
||||
set file "$dir/$file"
|
||||
if {[file extension $file] ne ".hmt"} { continue }
|
||||
|
||||
@@ -8,8 +8,32 @@ set dedup_prefixes {
|
||||
{^\.+}
|
||||
}
|
||||
|
||||
proc loadseries {dir} {
|
||||
global seriesmap
|
||||
set seriesmap [dict create]
|
||||
|
||||
if {![file exists "$dir/series.info"]} { return }
|
||||
|
||||
if {[catch {set fd [open "$dir/series.info" "r"]} msg]} {
|
||||
puts "Error opening series.info: $msg"
|
||||
return
|
||||
}
|
||||
|
||||
foreach line [split [read $fd] "\n\r"] {
|
||||
set i [string first " ==> " $line]
|
||||
if {$i == -1} { continue }
|
||||
set name [string range $line 0 $($i - 1)]
|
||||
set prefix [string range $line $($i + 5) end]
|
||||
if {$prefix eq ""} { continue }
|
||||
dict set seriesmap $name $prefix
|
||||
regsub -all -- {[[:space:]]+} [string tolower $name] "" name
|
||||
dict set seriesmap $name $prefix
|
||||
}
|
||||
$fd close
|
||||
}
|
||||
|
||||
proc dedupnormalise {title {reserve ""}} {
|
||||
global dedup_prefixes
|
||||
global dedup_prefixes seriesmap
|
||||
|
||||
# Strip common prefixes
|
||||
foreach prefix $dedup_prefixes {
|
||||
@@ -38,6 +62,17 @@ proc dedupnormalise {title {reserve ""}} {
|
||||
}
|
||||
}
|
||||
|
||||
if {[dict exists $seriesmap $title]} {
|
||||
set ntitle "$seriesmap($title): $title"
|
||||
set title $ntitle
|
||||
} else {
|
||||
# Try lower case without spaces
|
||||
regsub -all -- {[[:space:]]+} [string tolower $title] "" ntitle
|
||||
if {[dict exists $seriesmap $ntitle]} {
|
||||
set title "$seriesmap($ntitle): $title"
|
||||
}
|
||||
}
|
||||
|
||||
# Shorten if too long.
|
||||
if {[string length $title] > 40} {
|
||||
set title [string range $title 0 39]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require pretty_size
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require system.class chunked
|
||||
|
||||
cgi_input
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
|
||||
18
var/mongoose/html/edit/create.jim
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set file [cgi_get file "/tmp/hosts"]
|
||||
if {$file eq "-"} { exit }
|
||||
|
||||
puts "Content-Type: text/plain\n"
|
||||
|
||||
if {[file exists $file]} {
|
||||
puts ">>> File already exists."
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
@@ -33,6 +33,7 @@ Use the <i>Open</i> button below to begin.
|
||||
<button class=xeditactive id=open>Open</button>
|
||||
<button class=editactive id=save>Save</button>
|
||||
<button class=editactive id=revert>Revert</button>
|
||||
<button class=xeditactive id=create>Create File</button>
|
||||
|
||||
<div id=result class="blood hidden" />
|
||||
|
||||
@@ -47,6 +48,26 @@ Use the <i>Open</i> button below to begin.
|
||||
<div id=chooser></div>
|
||||
</div>
|
||||
|
||||
<div id=createf title="Create new file" style="display: none">
|
||||
<form id=createf_form>
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="createf_name">
|
||||
<b>Filename</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="createf_name"
|
||||
id="createf_name"
|
||||
value="/mod/" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
require chunked pretty_size
|
||||
|
||||
cgi_input
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
@@ -103,5 +103,45 @@ $('#back').click(function() {
|
||||
window.location = '/diag/diag.jim';
|
||||
});
|
||||
|
||||
function createf_submit()
|
||||
{
|
||||
var f = $('#createf_name').val();
|
||||
console.log('Creating: ' + f);
|
||||
|
||||
$('#createf').dialog('close');
|
||||
$.get('create.jim?file=' + encodeURIComponent(f), function(data) {
|
||||
if (data.match('^>>>'))
|
||||
{
|
||||
$('#msg').text(data);
|
||||
file = null;
|
||||
changed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#editor').val('').enable();
|
||||
$('button.editactive').enable();
|
||||
$('#msg').html('Editing new file <i>' + f + '</i>');
|
||||
file = f;
|
||||
changed = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#createf').dialog({
|
||||
autoOpen: false,
|
||||
height: 'auto', width: 'auto',
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Create File": createf_submit,
|
||||
"Cancel": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#create').click(function() {
|
||||
console.log('opening dialog');
|
||||
$('#createf').dialog('open');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
<!--#exec cmd="/mod/var/mongoose/include/epg.jim" -->
|
||||
<!--#exec cmd="/mod/webif/include/epg.jim" -->
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
|
||||
1
var/mongoose/html/img/compress.png
Symbolic link
@@ -0,0 +1 @@
|
||||
context/compress.png
|
||||
BIN
var/mongoose/html/img/context/compress.png
Normal file
|
After Width: | Height: | Size: 704 B |
BIN
var/mongoose/html/img/context/decrypt.png
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
var/mongoose/html/img/context/dedup.png
Normal file
|
After Width: | Height: | Size: 612 B |
1
var/mongoose/html/img/decrypt.png
Symbolic link
@@ -0,0 +1 @@
|
||||
context/decrypt.png
|
||||
1
var/mongoose/html/img/dedup.png
Symbolic link
@@ -0,0 +1 @@
|
||||
context/dedup.png
|
||||
BIN
var/mongoose/html/img/jalert/help.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
var/mongoose/html/img/jalert/important.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
var/mongoose/html/img/jalert/info.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
var/mongoose/html/img/jalert/title.gif
Normal file
|
After Width: | Height: | Size: 317 B |
@@ -1,12 +1,11 @@
|
||||
<!--#include virtual="/lib/header.shtml" -->
|
||||
|
||||
<div id=status class=shadowbox
|
||||
style="width: 60%; display: none; margin: 1 0 1em 0">
|
||||
<div>
|
||||
<span id=status_txt>
|
||||
Status...
|
||||
</span>
|
||||
</div>
|
||||
<div class=toolbarouter>
|
||||
<div id=status class=toolbar>
|
||||
<span id=status_txt>
|
||||
Status...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type=text/javascript>
|
||||
@@ -14,15 +13,15 @@ $(document).ready(function() {
|
||||
$('#status_txt').load('/cgi-bin/status.jim',
|
||||
function(rt,tt,xml) {
|
||||
if (rt.length)
|
||||
$('#status').show('slow');
|
||||
$('#status').slideDown();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--#exec cmd="/mod/var/mongoose/include/menuicons.jim" -->
|
||||
<!--#exec cmd="/mod/webif/include/menuicons.jim" -->
|
||||
|
||||
<div style="clear: both; padding-top: 1em">
|
||||
<!--#exec cmd="/mod/var/mongoose/include/menuplugins.jim" -->
|
||||
<!--#exec cmd="/mod/webif/include/menuplugins.jim" -->
|
||||
</div>
|
||||
|
||||
<div class=footer>
|
||||
@@ -35,7 +34,7 @@ Firmware</a> |
|
||||
<a target=_blank href="http://wiki.hummy.tv/wiki/Webif_release_notes">Webif</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!--#exec cmd="/mod/var/mongoose/include/modversion.jim" -->
|
||||
<!--#exec cmd="/mod/webif/include/modversion.jim" -->
|
||||
</div>
|
||||
|
||||
<!--#include virtual="/lib/footer.shtml" -->
|
||||
|
||||
235
var/mongoose/html/js/jquery.alerts.js
Normal file
@@ -0,0 +1,235 @@
|
||||
// jQuery Alert Dialogs Plugin
|
||||
//
|
||||
// Version 1.1
|
||||
//
|
||||
// Cory S.N. LaViska
|
||||
// A Beautiful Site (http://abeautifulsite.net/)
|
||||
// 14 May 2009
|
||||
//
|
||||
// Visit http://abeautifulsite.net/notebook/87 for more information
|
||||
//
|
||||
// Usage:
|
||||
// jAlert( message, [title, callback] )
|
||||
// jConfirm( message, [title, callback] )
|
||||
// jPrompt( message, [value, title, callback] )
|
||||
//
|
||||
// History:
|
||||
//
|
||||
// 1.00 - Released (29 December 2008)
|
||||
//
|
||||
// 1.01 - Fixed bug where unbinding would destroy all resize events
|
||||
//
|
||||
// License:
|
||||
//
|
||||
// This plugin is dual-licensed under the GNU General Public License and the MIT License and
|
||||
// is copyright 2008 A Beautiful Site, LLC.
|
||||
//
|
||||
(function($) {
|
||||
|
||||
$.alerts = {
|
||||
|
||||
// These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time
|
||||
|
||||
verticalOffset: -75, // vertical offset of the dialog from center screen, in pixels
|
||||
horizontalOffset: 0, // horizontal offset of the dialog from center screen, in pixels/
|
||||
repositionOnResize: true, // re-centers the dialog on window resize
|
||||
overlayOpacity: .01, // transparency level of overlay
|
||||
overlayColor: '#FFF', // base color of overlay
|
||||
draggable: true, // make the dialogs draggable (requires UI Draggables plugin)
|
||||
okButton: ' OK ', // text for the OK button
|
||||
cancelButton: ' Cancel ', // text for the Cancel button
|
||||
dialogClass: null, // if specified, this class will be applied to all dialogs
|
||||
|
||||
// Public methods
|
||||
|
||||
alert: function(message, title, callback) {
|
||||
if( title == null ) title = 'Alert';
|
||||
$.alerts._show(title, message, null, 'alert', function(result) {
|
||||
if( callback ) callback(result);
|
||||
});
|
||||
},
|
||||
|
||||
confirm: function(message, title, callback) {
|
||||
if( title == null ) title = 'Confirm';
|
||||
$.alerts._show(title, message, null, 'confirm', function(result) {
|
||||
if( callback ) callback(result);
|
||||
});
|
||||
},
|
||||
|
||||
prompt: function(message, value, title, callback) {
|
||||
if( title == null ) title = 'Prompt';
|
||||
$.alerts._show(title, message, value, 'prompt', function(result) {
|
||||
if( callback ) callback(result);
|
||||
});
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
_show: function(title, msg, value, type, callback) {
|
||||
|
||||
$.alerts._hide();
|
||||
$.alerts._overlay('show');
|
||||
|
||||
$("BODY").append(
|
||||
'<div id="popup_container">' +
|
||||
'<h1 id="popup_title"></h1>' +
|
||||
'<div id="popup_content">' +
|
||||
'<div id="popup_message"></div>' +
|
||||
'</div>' +
|
||||
'</div>');
|
||||
|
||||
if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass);
|
||||
|
||||
// IE6 Fix
|
||||
var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed';
|
||||
|
||||
$("#popup_container").css({
|
||||
position: pos,
|
||||
zIndex: 99999,
|
||||
padding: 0,
|
||||
margin: 0
|
||||
});
|
||||
|
||||
$("#popup_title").text(title);
|
||||
$("#popup_content").addClass(type);
|
||||
$("#popup_message").text(msg);
|
||||
$("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') );
|
||||
|
||||
$("#popup_container").css({
|
||||
minWidth: $("#popup_container").outerWidth(),
|
||||
maxWidth: $("#popup_container").outerWidth()
|
||||
});
|
||||
|
||||
$.alerts._reposition();
|
||||
$.alerts._maintainPosition(true);
|
||||
|
||||
switch( type ) {
|
||||
case 'alert':
|
||||
$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>');
|
||||
$("#popup_ok").click( function() {
|
||||
$.alerts._hide();
|
||||
callback(true);
|
||||
});
|
||||
$("#popup_ok").focus().keypress( function(e) {
|
||||
if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click');
|
||||
});
|
||||
break;
|
||||
case 'confirm':
|
||||
$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
|
||||
$("#popup_ok").click( function() {
|
||||
$.alerts._hide();
|
||||
if( callback ) callback(true);
|
||||
});
|
||||
$("#popup_cancel").click( function() {
|
||||
$.alerts._hide();
|
||||
if( callback ) callback(false);
|
||||
});
|
||||
$("#popup_ok").focus();
|
||||
$("#popup_ok, #popup_cancel").keypress( function(e) {
|
||||
if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
|
||||
if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
|
||||
});
|
||||
break;
|
||||
case 'prompt':
|
||||
$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
|
||||
$("#popup_prompt").width( $("#popup_message").width() );
|
||||
$("#popup_ok").click( function() {
|
||||
var val = $("#popup_prompt").val();
|
||||
$.alerts._hide();
|
||||
if( callback ) callback( val );
|
||||
});
|
||||
$("#popup_cancel").click( function() {
|
||||
$.alerts._hide();
|
||||
if( callback ) callback( null );
|
||||
});
|
||||
$("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) {
|
||||
if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
|
||||
if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
|
||||
});
|
||||
if( value ) $("#popup_prompt").val(value);
|
||||
$("#popup_prompt").focus().select();
|
||||
break;
|
||||
}
|
||||
|
||||
// Make draggable
|
||||
if( $.alerts.draggable ) {
|
||||
try {
|
||||
$("#popup_container").draggable({ handle: $("#popup_title") });
|
||||
$("#popup_title").css({ cursor: 'move' });
|
||||
} catch(e) { /* requires jQuery UI draggables */ }
|
||||
}
|
||||
},
|
||||
|
||||
_hide: function() {
|
||||
$("#popup_container").remove();
|
||||
$.alerts._overlay('hide');
|
||||
$.alerts._maintainPosition(false);
|
||||
},
|
||||
|
||||
_overlay: function(status) {
|
||||
switch( status ) {
|
||||
case 'show':
|
||||
$.alerts._overlay('hide');
|
||||
$("BODY").append('<div id="popup_overlay"></div>');
|
||||
$("#popup_overlay").css({
|
||||
position: 'absolute',
|
||||
zIndex: 99998,
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: '100%',
|
||||
height: $(document).height(),
|
||||
background: $.alerts.overlayColor,
|
||||
opacity: $.alerts.overlayOpacity
|
||||
});
|
||||
break;
|
||||
case 'hide':
|
||||
$("#popup_overlay").remove();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_reposition: function() {
|
||||
var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset;
|
||||
var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset;
|
||||
if( top < 0 ) top = 0;
|
||||
if( left < 0 ) left = 0;
|
||||
|
||||
// IE6 fix
|
||||
if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop();
|
||||
|
||||
$("#popup_container").css({
|
||||
top: top + 'px',
|
||||
left: left + 'px'
|
||||
});
|
||||
$("#popup_overlay").height( $(document).height() );
|
||||
},
|
||||
|
||||
_maintainPosition: function(status) {
|
||||
if( $.alerts.repositionOnResize ) {
|
||||
switch(status) {
|
||||
case true:
|
||||
$(window).bind('resize', $.alerts._reposition);
|
||||
break;
|
||||
case false:
|
||||
$(window).unbind('resize', $.alerts._reposition);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Shortuct functions
|
||||
jAlert = function(message, title, callback) {
|
||||
$.alerts.alert(message, title, callback);
|
||||
}
|
||||
|
||||
jConfirm = function(message, title, callback) {
|
||||
$.alerts.confirm(message, title, callback);
|
||||
};
|
||||
|
||||
jPrompt = function(message, value, title, callback) {
|
||||
$.alerts.prompt(message, value, title, callback);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
9
var/mongoose/html/lib/footer.jim
Normal file → Executable file
@@ -1,12 +1,15 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
<!-- Start of footer -->
|
||||
<div class=footer>
|
||||
}
|
||||
|
||||
set rendertime [expr [expr [clock milliseconds] - $renderstart] / 1000.0]
|
||||
|
||||
puts "<font class=footnote>Rendered in: $rendertime seconds</font>"
|
||||
if {![catch {
|
||||
set rendertime [expr [expr [clock milliseconds] - $renderstart] / 1000.0]
|
||||
}]} {
|
||||
puts "<font class=footnote>Rendered in: $rendertime seconds</font>"
|
||||
}
|
||||
|
||||
puts {
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
<!-- Start of footer -->
|
||||
<div class=footer>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!--#exec cmd="/mod/webif/html/lib/footer.jim" -->
|
||||
|
||||
8
var/mongoose/html/lib/header.jim
Normal file → Executable file
@@ -1,10 +1,12 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
}
|
||||
source /mod/var/mongoose/include/model.jim
|
||||
source /mod/webif/include/model.jim
|
||||
puts {
|
||||
</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
|
||||
@@ -17,9 +19,9 @@ puts {
|
||||
<body>
|
||||
}
|
||||
|
||||
source /mod/var/mongoose/html/lib/topbar.jim
|
||||
source /mod/webif/html/lib/topbar.jim
|
||||
puts "<div id=restart_block>"
|
||||
source /mod/var/mongoose/include/restart.jim
|
||||
source /mod/webif/include/restart.jim
|
||||
puts "</div>"
|
||||
|
||||
puts {
|
||||
|
||||
@@ -1,23 +1 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title><!--#exec cmd="/mod/var/mongoose/include/model.jim" --></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
|
||||
<meta http-equiv="expires" value="Thu, 01 Jan 1970 00:00:00 GMT" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<link rel="shortcut icon" href=/img/favicon.ico />
|
||||
<link type="text/css" href="/css/jquery-ui.css" rel="Stylesheet" />
|
||||
<link href=/css/style.css rel=stylesheet type=text/css />
|
||||
<script type="text/javascript" src="/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="/js/jquery-ui.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--#include virtual="/lib/topbar.shtml" -->
|
||||
<div id=restart_block>
|
||||
<!--#exec cmd="/mod/var/mongoose/include/restart.jim" -->
|
||||
</div>
|
||||
|
||||
<div style="clear: both">
|
||||
|
||||
<!-- end of header -->
|
||||
<!--#exec cmd="/mod/webif/html/lib/header.jim" -->
|
||||
|
||||
@@ -6,19 +6,22 @@ puts {
|
||||
<div class=middle>
|
||||
<!-- Start include diskspace - above other items to work around IE feature.. -->
|
||||
}
|
||||
source /mod/var/mongoose/include/diskspace.jim
|
||||
source /mod/webif/include/diskspace.jim
|
||||
puts {
|
||||
<!-- End include diskspace -->
|
||||
<img border=0 src=/images/516_1_26_Freeview_Logo.png>
|
||||
<span style="display: inline; font-size: 150%;
|
||||
padding: 0 0 0 2em;">
|
||||
}
|
||||
source /mod/var/mongoose/include/model.jim
|
||||
source /mod/webif/include/model.jim
|
||||
puts {
|
||||
</span>
|
||||
</div>
|
||||
<div class=right><img src=/images/154_1_00_WIN_MD116_3R.png></div>
|
||||
</div>
|
||||
}
|
||||
source /mod/webif/include/toolbar.jim
|
||||
puts {
|
||||
<script type=text/javascript>
|
||||
$('#topbar').hover(
|
||||
function() { $(this).css('cursor', 'pointer'); },
|
||||
|
||||