From d7284ff3ef629931dc8c267baed17641838b328c Mon Sep 17 00:00:00 2001 From: hummypkg Date: Mon, 21 May 2012 20:23:41 +0000 Subject: [PATCH] 0.9.9 git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1016 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/cgi-bin/backup/backup.jim | 2 +- var/mongoose/cgi-bin/backup/delete.jim | 2 +- var/mongoose/cgi-bin/backup/restore.jim | 2 +- var/mongoose/cgi-bin/browse.jim | 4 +- var/mongoose/cgi-bin/browse/audio/audio.jim | 2 +- var/mongoose/cgi-bin/browse/audio/execute.jim | 2 +- .../cgi-bin/browse/audio/progress.jim | 2 +- var/mongoose/cgi-bin/browse/chunk/chunk.jim | 2 +- var/mongoose/cgi-bin/browse/chunk/extract.jim | 2 +- .../cgi-bin/browse/chunk/progress.jim | 2 +- var/mongoose/cgi-bin/browse/clipboard.jim | 2 +- var/mongoose/cgi-bin/browse/crop/crop.jim | 2 +- var/mongoose/cgi-bin/browse/crop/execute.jim | 2 +- var/mongoose/cgi-bin/browse/crop/progress.jim | 2 +- .../cgi-bin/browse/decrypt/decrypt.jim | 2 +- .../cgi-bin/browse/decrypt/execute.jim | 2 +- .../cgi-bin/browse/decrypt/progress.jim | 2 +- var/mongoose/cgi-bin/browse/delete.jim | 2 +- var/mongoose/cgi-bin/browse/download.jim | 2 +- var/mongoose/cgi-bin/browse/enc.jim | 2 +- var/mongoose/cgi-bin/browse/epgtitle.jim | 2 +- var/mongoose/cgi-bin/browse/ffmpeg.jim | 2 +- var/mongoose/cgi-bin/browse/file.jim | 6 +-- var/mongoose/cgi-bin/browse/flat.jim | 3 +- var/mongoose/cgi-bin/browse/join/execute.jim | 2 +- var/mongoose/cgi-bin/browse/join/join.jim | 2 +- var/mongoose/cgi-bin/browse/join/progress.jim | 2 +- var/mongoose/cgi-bin/browse/lock.jim | 3 +- var/mongoose/cgi-bin/browse/mpg/execute.jim | 2 +- var/mongoose/cgi-bin/browse/mpg/mpg.jim | 2 +- var/mongoose/cgi-bin/browse/mpg/progress.jim | 2 +- var/mongoose/cgi-bin/browse/new.jim | 2 +- var/mongoose/cgi-bin/browse/play.jim | 2 +- var/mongoose/cgi-bin/browse/rename.jim | 3 +- var/mongoose/cgi-bin/browse/resetnew.jim | 2 +- var/mongoose/cgi-bin/browse/savestream.jim | 3 +- var/mongoose/cgi-bin/cat.jim | 2 +- var/mongoose/cgi-bin/channel.jim | 2 +- var/mongoose/cgi-bin/db.jim | 2 +- var/mongoose/cgi-bin/epg/dump.jim | 2 +- var/mongoose/cgi-bin/epg/info.jim | 2 +- var/mongoose/cgi-bin/epg/schedule.jim | 2 +- var/mongoose/cgi-bin/epg/search.jim | 2 +- var/mongoose/cgi-bin/epg/service.jim | 2 +- var/mongoose/cgi-bin/opkg.jim | 4 +- var/mongoose/cgi-bin/pkg.jim | 2 +- var/mongoose/cgi-bin/restart.jim | 2 +- var/mongoose/cgi-bin/restartblock.jim | 2 +- var/mongoose/cgi-bin/settings.jim | 15 ++++++- var/mongoose/cgi-bin/settings.js | 19 +++++++++ var/mongoose/cgi-bin/status.jim | 2 +- var/mongoose/cgi-bin/xepg.jim | 2 +- var/mongoose/html/backup.shtml | 2 +- var/mongoose/html/dedup/dedup | 9 +++-- var/mongoose/html/dedup/dedup.jim | 5 +-- var/mongoose/html/dedup/normalise.jim | 36 ++++++++++++++++- var/mongoose/html/diag/diag.jim | 2 +- var/mongoose/html/diag/rundiag.jim | 2 +- var/mongoose/html/dlna/dlna.jim | 2 +- var/mongoose/html/dlna/reset.jim | 2 +- var/mongoose/html/edit/create.jim | 18 +++++++++ var/mongoose/html/edit/edit.jim | 23 ++++++++++- var/mongoose/html/edit/files.jim | 2 +- var/mongoose/html/edit/get.jim | 2 +- var/mongoose/html/edit/put.jim | 2 +- var/mongoose/html/edit/script.js | 40 +++++++++++++++++++ var/mongoose/html/epg.shtml | 2 +- var/mongoose/html/index.shtml | 6 +-- var/mongoose/html/lib/footer.jim | 0 var/mongoose/html/lib/footer.shtml | 8 +--- var/mongoose/html/lib/header.jim | 8 ++-- var/mongoose/html/lib/header.shtml | 24 +---------- var/mongoose/html/lib/topbar.jim | 6 +-- var/mongoose/html/lib/topbar.shtml | 27 ------------- var/mongoose/html/sched/ar.jim | 2 +- var/mongoose/html/sched/cancel.jim | 2 +- var/mongoose/html/sched/folder.jim | 2 +- var/mongoose/html/sched/info.jim | 2 +- var/mongoose/html/sched/pad.jim | 2 +- var/mongoose/html/sched/sched.jim | 2 +- var/mongoose/html/services.shtml | 2 +- var/mongoose/include/backup.jim | 2 +- var/mongoose/include/diskspace.jim | 7 ++-- var/mongoose/include/epg.jim | 2 +- var/mongoose/include/epgloc.jim | 2 +- var/mongoose/include/menuicons.jim | 2 +- var/mongoose/include/menuplugins.jim | 2 +- var/mongoose/include/model.jim | 2 +- var/mongoose/include/modversion.jim | 2 +- var/mongoose/include/pkg.jim | 2 +- var/mongoose/include/restart.jim | 2 +- var/mongoose/include/toolbar.jim | 25 ++++++++---- var/mongoose/lib/epg.class | 2 +- var/mongoose/lib/plugin | 2 +- var/mongoose/lib/rsv.class | 2 +- var/mongoose/lib/settings.class | 5 +++ var/mongoose/lib/setup | 6 +-- var/mongoose/lib/system.class | 5 ++- var/mongoose/lib/ts.class | 2 +- webif | 1 + 101 files changed, 291 insertions(+), 174 deletions(-) create mode 100755 var/mongoose/html/edit/create.jim mode change 100644 => 100755 var/mongoose/html/lib/footer.jim mode change 100644 => 100755 var/mongoose/html/lib/header.jim delete mode 100644 var/mongoose/html/lib/topbar.shtml create mode 120000 webif diff --git a/CONTROL/control b/CONTROL/control index 0a00d09..b500346 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.9.8-3 +Version: 0.9.9 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) diff --git a/var/mongoose/cgi-bin/backup/backup.jim b/var/mongoose/cgi-bin/backup/backup.jim index 47c2c5b..d803c93 100755 --- a/var/mongoose/cgi-bin/backup/backup.jim +++ b/var/mongoose/cgi-bin/backup/backup.jim @@ -1,7 +1,7 @@ #!/mod/bin/jimsh package require cgi -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require rsv.class diff --git a/var/mongoose/cgi-bin/backup/delete.jim b/var/mongoose/cgi-bin/backup/delete.jim index 7f4d4bc..799b80c 100755 --- a/var/mongoose/cgi-bin/backup/delete.jim +++ b/var/mongoose/cgi-bin/backup/delete.jim @@ -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 diff --git a/var/mongoose/cgi-bin/backup/restore.jim b/var/mongoose/cgi-bin/backup/restore.jim index 9ebcc97..723dc48 100755 --- a/var/mongoose/cgi-bin/backup/restore.jim +++ b/var/mongoose/cgi-bin/backup/restore.jim @@ -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 diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim index 49550ae..9676758 100755 --- a/var/mongoose/cgi-bin/browse.jim +++ b/var/mongoose/cgi-bin/browse.jim @@ -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" @@ -222,7 +222,7 @@ puts { } -source /mod/var/mongoose/cgi-bin/browse/assets.jim +source browse/assets.jim puts " $dir diff --git a/var/mongoose/cgi-bin/browse/audio/audio.jim b/var/mongoose/cgi-bin/browse/audio/audio.jim index 88667ce..15d1961 100755 --- a/var/mongoose/cgi-bin/browse/audio/audio.jim +++ b/var/mongoose/cgi-bin/browse/audio/audio.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/audio/execute.jim b/var/mongoose/cgi-bin/browse/audio/execute.jim index 483e4af..2fc4535 100755 --- a/var/mongoose/cgi-bin/browse/audio/execute.jim +++ b/var/mongoose/cgi-bin/browse/audio/execute.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/audio/progress.jim b/var/mongoose/cgi-bin/browse/audio/progress.jim index e8f761a..796eb91 100755 --- a/var/mongoose/cgi-bin/browse/audio/progress.jim +++ b/var/mongoose/cgi-bin/browse/audio/progress.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/chunk/chunk.jim b/var/mongoose/cgi-bin/browse/chunk/chunk.jim index 6d3ecc8..ba15b55 100755 --- a/var/mongoose/cgi-bin/browse/chunk/chunk.jim +++ b/var/mongoose/cgi-bin/browse/chunk/chunk.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/chunk/extract.jim b/var/mongoose/cgi-bin/browse/chunk/extract.jim index 3916f15..2db9720 100755 --- a/var/mongoose/cgi-bin/browse/chunk/extract.jim +++ b/var/mongoose/cgi-bin/browse/chunk/extract.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/chunk/progress.jim b/var/mongoose/cgi-bin/browse/chunk/progress.jim index a21b3c7..619b97e 100755 --- a/var/mongoose/cgi-bin/browse/chunk/progress.jim +++ b/var/mongoose/cgi-bin/browse/chunk/progress.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/clipboard.jim b/var/mongoose/cgi-bin/browse/clipboard.jim index 5beefd6..4dde470 100755 --- a/var/mongoose/cgi-bin/browse/clipboard.jim +++ b/var/mongoose/cgi-bin/browse/clipboard.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/crop/crop.jim b/var/mongoose/cgi-bin/browse/crop/crop.jim index f0c3d24..1022e9f 100755 --- a/var/mongoose/cgi-bin/browse/crop/crop.jim +++ b/var/mongoose/cgi-bin/browse/crop/crop.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/crop/execute.jim b/var/mongoose/cgi-bin/browse/crop/execute.jim index 581b51f..40465d1 100755 --- a/var/mongoose/cgi-bin/browse/crop/execute.jim +++ b/var/mongoose/cgi-bin/browse/crop/execute.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/crop/progress.jim b/var/mongoose/cgi-bin/browse/crop/progress.jim index 5374e51..a5a4429 100755 --- a/var/mongoose/cgi-bin/browse/crop/progress.jim +++ b/var/mongoose/cgi-bin/browse/crop/progress.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/decrypt/decrypt.jim b/var/mongoose/cgi-bin/browse/decrypt/decrypt.jim index 3311dea..24f46fc 100755 --- a/var/mongoose/cgi-bin/browse/decrypt/decrypt.jim +++ b/var/mongoose/cgi-bin/browse/decrypt/decrypt.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/decrypt/execute.jim b/var/mongoose/cgi-bin/browse/decrypt/execute.jim index 1d33d86..489fe24 100755 --- a/var/mongoose/cgi-bin/browse/decrypt/execute.jim +++ b/var/mongoose/cgi-bin/browse/decrypt/execute.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/decrypt/progress.jim b/var/mongoose/cgi-bin/browse/decrypt/progress.jim index f429df2..b34a53c 100755 --- a/var/mongoose/cgi-bin/browse/decrypt/progress.jim +++ b/var/mongoose/cgi-bin/browse/decrypt/progress.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/delete.jim b/var/mongoose/cgi-bin/browse/delete.jim index 106acfd..6a779d5 100755 --- a/var/mongoose/cgi-bin/browse/delete.jim +++ b/var/mongoose/cgi-bin/browse/delete.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/download.jim b/var/mongoose/cgi-bin/browse/download.jim index 91a56a5..3b74951 100755 --- a/var/mongoose/cgi-bin/browse/download.jim +++ b/var/mongoose/cgi-bin/browse/download.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/enc.jim b/var/mongoose/cgi-bin/browse/enc.jim index a1f4ea6..2ca7101 100755 --- a/var/mongoose/cgi-bin/browse/enc.jim +++ b/var/mongoose/cgi-bin/browse/enc.jim @@ -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 "" diff --git a/var/mongoose/cgi-bin/browse/epgtitle.jim b/var/mongoose/cgi-bin/browse/epgtitle.jim index 7aae0a0..cc5d642 100755 --- a/var/mongoose/cgi-bin/browse/epgtitle.jim +++ b/var/mongoose/cgi-bin/browse/epgtitle.jim @@ -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 "" diff --git a/var/mongoose/cgi-bin/browse/ffmpeg.jim b/var/mongoose/cgi-bin/browse/ffmpeg.jim index a5ac430..a3ff1cd 100755 --- a/var/mongoose/cgi-bin/browse/ffmpeg.jim +++ b/var/mongoose/cgi-bin/browse/ffmpeg.jim @@ -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/ffmpeg -i $file] } else { puts "Install ffmpeg package for more information..." } diff --git a/var/mongoose/cgi-bin/browse/file.jim b/var/mongoose/cgi-bin/browse/file.jim index c5450a1..fe535c6 100755 --- a/var/mongoose/cgi-bin/browse/file.jim +++ b/var/mongoose/cgi-bin/browse/file.jim @@ -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] diff --git a/var/mongoose/cgi-bin/browse/flat.jim b/var/mongoose/cgi-bin/browse/flat.jim index 33f2f37..e29a747 100755 --- a/var/mongoose/cgi-bin/browse/flat.jim +++ b/var/mongoose/cgi-bin/browse/flat.jim @@ -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 "" diff --git a/var/mongoose/cgi-bin/browse/join/execute.jim b/var/mongoose/cgi-bin/browse/join/execute.jim index a873222..66a97a9 100755 --- a/var/mongoose/cgi-bin/browse/join/execute.jim +++ b/var/mongoose/cgi-bin/browse/join/execute.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/join/join.jim b/var/mongoose/cgi-bin/browse/join/join.jim index 1806f89..95111cd 100755 --- a/var/mongoose/cgi-bin/browse/join/join.jim +++ b/var/mongoose/cgi-bin/browse/join/join.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/join/progress.jim b/var/mongoose/cgi-bin/browse/join/progress.jim index 53d2284..68d386a 100755 --- a/var/mongoose/cgi-bin/browse/join/progress.jim +++ b/var/mongoose/cgi-bin/browse/join/progress.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/lock.jim b/var/mongoose/cgi-bin/browse/lock.jim index b53679f..9055d1e 100755 --- a/var/mongoose/cgi-bin/browse/lock.jim +++ b/var/mongoose/cgi-bin/browse/lock.jim @@ -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 "" diff --git a/var/mongoose/cgi-bin/browse/mpg/execute.jim b/var/mongoose/cgi-bin/browse/mpg/execute.jim index 795b7cd..eac9847 100755 --- a/var/mongoose/cgi-bin/browse/mpg/execute.jim +++ b/var/mongoose/cgi-bin/browse/mpg/execute.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/mpg/mpg.jim b/var/mongoose/cgi-bin/browse/mpg/mpg.jim index 8993492..92f0c7d 100755 --- a/var/mongoose/cgi-bin/browse/mpg/mpg.jim +++ b/var/mongoose/cgi-bin/browse/mpg/mpg.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/mpg/progress.jim b/var/mongoose/cgi-bin/browse/mpg/progress.jim index 8728731..7073270 100755 --- a/var/mongoose/cgi-bin/browse/mpg/progress.jim +++ b/var/mongoose/cgi-bin/browse/mpg/progress.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/new.jim b/var/mongoose/cgi-bin/browse/new.jim index 01b6c33..338f5d1 100755 --- a/var/mongoose/cgi-bin/browse/new.jim +++ b/var/mongoose/cgi-bin/browse/new.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/play.jim b/var/mongoose/cgi-bin/browse/play.jim index 284bce9..f6e346d 100755 --- a/var/mongoose/cgi-bin/browse/play.jim +++ b/var/mongoose/cgi-bin/browse/play.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/rename.jim b/var/mongoose/cgi-bin/browse/rename.jim index 777f8cb..d05be4d 100755 --- a/var/mongoose/cgi-bin/browse/rename.jim +++ b/var/mongoose/cgi-bin/browse/rename.jim @@ -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 "" diff --git a/var/mongoose/cgi-bin/browse/resetnew.jim b/var/mongoose/cgi-bin/browse/resetnew.jim index 5bf9dab..d4d9ea4 100755 --- a/var/mongoose/cgi-bin/browse/resetnew.jim +++ b/var/mongoose/cgi-bin/browse/resetnew.jim @@ -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" diff --git a/var/mongoose/cgi-bin/browse/savestream.jim b/var/mongoose/cgi-bin/browse/savestream.jim index 464b682..b010c59 100755 --- a/var/mongoose/cgi-bin/browse/savestream.jim +++ b/var/mongoose/cgi-bin/browse/savestream.jim @@ -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 "" diff --git a/var/mongoose/cgi-bin/cat.jim b/var/mongoose/cgi-bin/cat.jim index 2c431bf..bdc5d53 100755 --- a/var/mongoose/cgi-bin/cat.jim +++ b/var/mongoose/cgi-bin/cat.jim @@ -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 diff --git a/var/mongoose/cgi-bin/channel.jim b/var/mongoose/cgi-bin/channel.jim index 7fe42b3..0840b48 100755 --- a/var/mongoose/cgi-bin/channel.jim +++ b/var/mongoose/cgi-bin/channel.jim @@ -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" diff --git a/var/mongoose/cgi-bin/db.jim b/var/mongoose/cgi-bin/db.jim index 71769e4..e64909a 100755 --- a/var/mongoose/cgi-bin/db.jim +++ b/var/mongoose/cgi-bin/db.jim @@ -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" diff --git a/var/mongoose/cgi-bin/epg/dump.jim b/var/mongoose/cgi-bin/epg/dump.jim index fd13b57..6a9384b 100755 --- a/var/mongoose/cgi-bin/epg/dump.jim +++ b/var/mongoose/cgi-bin/epg/dump.jim @@ -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" diff --git a/var/mongoose/cgi-bin/epg/info.jim b/var/mongoose/cgi-bin/epg/info.jim index dc7f710..9c66a3f 100755 --- a/var/mongoose/cgi-bin/epg/info.jim +++ b/var/mongoose/cgi-bin/epg/info.jim @@ -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" diff --git a/var/mongoose/cgi-bin/epg/schedule.jim b/var/mongoose/cgi-bin/epg/schedule.jim index 51b4823..af0b349 100755 --- a/var/mongoose/cgi-bin/epg/schedule.jim +++ b/var/mongoose/cgi-bin/epg/schedule.jim @@ -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" diff --git a/var/mongoose/cgi-bin/epg/search.jim b/var/mongoose/cgi-bin/epg/search.jim index 7de484a..c68d83e 100755 --- a/var/mongoose/cgi-bin/epg/search.jim +++ b/var/mongoose/cgi-bin/epg/search.jim @@ -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" diff --git a/var/mongoose/cgi-bin/epg/service.jim b/var/mongoose/cgi-bin/epg/service.jim index a89820f..396efc8 100755 --- a/var/mongoose/cgi-bin/epg/service.jim +++ b/var/mongoose/cgi-bin/epg/service.jim @@ -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" diff --git a/var/mongoose/cgi-bin/opkg.jim b/var/mongoose/cgi-bin/opkg.jim index ff036aa..6d32da6 100755 --- a/var/mongoose/cgi-bin/opkg.jim +++ b/var/mongoose/cgi-bin/opkg.jim @@ -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/opkg $cmd" set fd [open $bcmd r] while {[gets $fd line] >= 0} { chunk "$line\r\n" diff --git a/var/mongoose/cgi-bin/pkg.jim b/var/mongoose/cgi-bin/pkg.jim index a9ce161..b64dc92 100755 --- a/var/mongoose/cgi-bin/pkg.jim +++ b/var/mongoose/cgi-bin/pkg.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 pkg.class altrow if {[[settings] pkgdev]} { set filter 0 } else { set filter 1 } diff --git a/var/mongoose/cgi-bin/restart.jim b/var/mongoose/cgi-bin/restart.jim index 355ba4e..aff2a8f 100755 --- a/var/mongoose/cgi-bin/restart.jim +++ b/var/mongoose/cgi-bin/restart.jim @@ -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" diff --git a/var/mongoose/cgi-bin/restartblock.jim b/var/mongoose/cgi-bin/restartblock.jim index 3d3b1df..e3de965 100755 --- a/var/mongoose/cgi-bin/restartblock.jim +++ b/var/mongoose/cgi-bin/restartblock.jim @@ -3,5 +3,5 @@ puts "Content-Type: text/html" puts "" -source /mod/var/mongoose/include/restart.jim +source /mod/webif/include/restart.jim diff --git a/var/mongoose/cgi-bin/settings.jim b/var/mongoose/cgi-bin/settings.jim index 6804d29..33895f3 100755 --- a/var/mongoose/cgi-bin/settings.jim +++ b/var/mongoose/cgi-bin/settings.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 "> " +puts -nonewline " + + Slide-down toolbar? + +
+ + +" + puts "
diff --git a/var/mongoose/cgi-bin/settings.js b/var/mongoose/cgi-bin/settings.js index 18645b1..8689cd3 100644 --- a/var/mongoose/cgi-bin/settings.js +++ b/var/mongoose/cgi-bin/settings.js @@ -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'); + }); + }); }); diff --git a/var/mongoose/cgi-bin/status.jim b/var/mongoose/cgi-bin/status.jim index d7ad538..8e0d095 100755 --- a/var/mongoose/cgi-bin/status.jim +++ b/var/mongoose/cgi-bin/status.jim @@ -1,6 +1,6 @@ #!/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" diff --git a/var/mongoose/cgi-bin/xepg.jim b/var/mongoose/cgi-bin/xepg.jim index 76fbe51..5ad6a65 100755 --- a/var/mongoose/cgi-bin/xepg.jim +++ b/var/mongoose/cgi-bin/xepg.jim @@ -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 "" diff --git a/var/mongoose/html/backup.shtml b/var/mongoose/html/backup.shtml index 88e884b..cfb2fe2 100644 --- a/var/mongoose/html/backup.shtml +++ b/var/mongoose/html/backup.shtml @@ -1,4 +1,4 @@ - + diff --git a/var/mongoose/html/dedup/dedup b/var/mongoose/html/dedup/dedup index 72131e4..3f00d30 100755 --- a/var/mongoose/html/dedup/dedup +++ b/var/mongoose/html/dedup/dedup @@ -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" } } } diff --git a/var/mongoose/html/dedup/dedup.jim b/var/mongoose/html/dedup/dedup.jim index 19d4fad..72ec64a 100755 --- a/var/mongoose/html/dedup/dedup.jim +++ b/var/mongoose/html/dedup/dedup.jim @@ -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 "
" -set seen {} - +loadseries $dir foreach file [readdir $dir] { set file "$dir/$file" if {[file extension $file] ne ".hmt"} { continue } diff --git a/var/mongoose/html/dedup/normalise.jim b/var/mongoose/html/dedup/normalise.jim index 26b6d0e..a40d553 100755 --- a/var/mongoose/html/dedup/normalise.jim +++ b/var/mongoose/html/dedup/normalise.jim @@ -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,16 @@ proc dedupnormalise {title {reserve ""}} { } } + if {[dict exists $seriesmap $title]} { + set ntitle "$seriesmap($title): $title" + set title $ntitle + } else { + 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] diff --git a/var/mongoose/html/diag/diag.jim b/var/mongoose/html/diag/diag.jim index 6ec4337..b4a0b5a 100755 --- a/var/mongoose/html/diag/diag.jim +++ b/var/mongoose/html/diag/diag.jim @@ -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" diff --git a/var/mongoose/html/diag/rundiag.jim b/var/mongoose/html/diag/rundiag.jim index 586e23d..d073f66 100755 --- a/var/mongoose/html/diag/rundiag.jim +++ b/var/mongoose/html/diag/rundiag.jim @@ -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 diff --git a/var/mongoose/html/dlna/dlna.jim b/var/mongoose/html/dlna/dlna.jim index be2c793..dddd00b 100755 --- a/var/mongoose/html/dlna/dlna.jim +++ b/var/mongoose/html/dlna/dlna.jim @@ -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" diff --git a/var/mongoose/html/dlna/reset.jim b/var/mongoose/html/dlna/reset.jim index dd8eb87..c0d8826 100755 --- a/var/mongoose/html/dlna/reset.jim +++ b/var/mongoose/html/dlna/reset.jim @@ -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" diff --git a/var/mongoose/html/edit/create.jim b/var/mongoose/html/edit/create.jim new file mode 100755 index 0000000..386161f --- /dev/null +++ b/var/mongoose/html/edit/create.jim @@ -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 +} + diff --git a/var/mongoose/html/edit/edit.jim b/var/mongoose/html/edit/edit.jim index c114334..ba4c553 100755 --- a/var/mongoose/html/edit/edit.jim +++ b/var/mongoose/html/edit/edit.jim @@ -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 Open button below to begin. + + + } footer diff --git a/var/mongoose/html/edit/files.jim b/var/mongoose/html/edit/files.jim index 4ea7958..c233007 100755 --- a/var/mongoose/html/edit/files.jim +++ b/var/mongoose/html/edit/files.jim @@ -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 diff --git a/var/mongoose/html/edit/get.jim b/var/mongoose/html/edit/get.jim index f8d7a1f..8d2214a 100755 --- a/var/mongoose/html/edit/get.jim +++ b/var/mongoose/html/edit/get.jim @@ -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 diff --git a/var/mongoose/html/edit/put.jim b/var/mongoose/html/edit/put.jim index eb318da..66be68f 100755 --- a/var/mongoose/html/edit/put.jim +++ b/var/mongoose/html/edit/put.jim @@ -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 "" diff --git a/var/mongoose/html/edit/script.js b/var/mongoose/html/edit/script.js index dcbc00b..d7d148b 100644 --- a/var/mongoose/html/edit/script.js +++ b/var/mongoose/html/edit/script.js @@ -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 ' + f + ''); + 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'); +}); + +}); diff --git a/var/mongoose/html/epg.shtml b/var/mongoose/html/epg.shtml index 479e242..3ffe153 100644 --- a/var/mongoose/html/epg.shtml +++ b/var/mongoose/html/epg.shtml @@ -1,4 +1,4 @@ - + diff --git a/var/mongoose/html/index.shtml b/var/mongoose/html/index.shtml index 2d11ba4..9502360 100644 --- a/var/mongoose/html/index.shtml +++ b/var/mongoose/html/index.shtml @@ -18,10 +18,10 @@ $(document).ready(function() { }); - +
- +
diff --git a/var/mongoose/html/lib/footer.jim b/var/mongoose/html/lib/footer.jim old mode 100644 new mode 100755 diff --git a/var/mongoose/html/lib/footer.shtml b/var/mongoose/html/lib/footer.shtml index d01dd9a..069265d 100644 --- a/var/mongoose/html/lib/footer.shtml +++ b/var/mongoose/html/lib/footer.shtml @@ -1,7 +1 @@ - - - - - - + diff --git a/var/mongoose/html/lib/header.jim b/var/mongoose/html/lib/header.jim old mode 100644 new mode 100755 index 466f3cc..b378e84 --- a/var/mongoose/html/lib/header.jim +++ b/var/mongoose/html/lib/header.jim @@ -1,10 +1,12 @@ +#!/mod/bin/jimsh + puts { } -source /mod/var/mongoose/include/model.jim +source /mod/webif/include/model.jim puts { @@ -17,9 +19,9 @@ puts { } -source /mod/var/mongoose/html/lib/topbar.jim +source /mod/webif/html/lib/topbar.jim puts "
" -source /mod/var/mongoose/include/restart.jim +source /mod/webif/include/restart.jim puts "
" puts { diff --git a/var/mongoose/html/lib/header.shtml b/var/mongoose/html/lib/header.shtml index 4ab90a9..b1ba462 100644 --- a/var/mongoose/html/lib/header.shtml +++ b/var/mongoose/html/lib/header.shtml @@ -1,23 +1 @@ - - - -<!--#exec cmd="/mod/var/mongoose/include/model.jim" --> - - - - - - - - - - - - -
- -
- -
- - + diff --git a/var/mongoose/html/lib/topbar.jim b/var/mongoose/html/lib/topbar.jim index ccc4a71..85126fe 100644 --- a/var/mongoose/html/lib/topbar.jim +++ b/var/mongoose/html/lib/topbar.jim @@ -6,21 +6,21 @@ puts {
} -source /mod/var/mongoose/include/diskspace.jim +source /mod/webif/include/diskspace.jim puts { } -source /mod/var/mongoose/include/model.jim +source /mod/webif/include/model.jim puts {
} -source /mod/var/mongoose/include/toolbar.jim +source /mod/webif/include/toolbar.jim puts { - - diff --git a/var/mongoose/html/sched/ar.jim b/var/mongoose/html/sched/ar.jim index 9e6debf..405f964 100755 --- a/var/mongoose/html/sched/ar.jim +++ b/var/mongoose/html/sched/ar.jim @@ -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" diff --git a/var/mongoose/html/sched/cancel.jim b/var/mongoose/html/sched/cancel.jim index cd4317f..edd4b5e 100755 --- a/var/mongoose/html/sched/cancel.jim +++ b/var/mongoose/html/sched/cancel.jim @@ -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" diff --git a/var/mongoose/html/sched/folder.jim b/var/mongoose/html/sched/folder.jim index 9774bfc..d975449 100755 --- a/var/mongoose/html/sched/folder.jim +++ b/var/mongoose/html/sched/folder.jim @@ -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" diff --git a/var/mongoose/html/sched/info.jim b/var/mongoose/html/sched/info.jim index 4c5f9af..f2d5f18 100755 --- a/var/mongoose/html/sched/info.jim +++ b/var/mongoose/html/sched/info.jim @@ -1,7 +1,7 @@ #!/mod/bin/jimsh package require cgi -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require rsv.class progressbar puts "Content-Type: text/html" diff --git a/var/mongoose/html/sched/pad.jim b/var/mongoose/html/sched/pad.jim index 42b0d33..4e37066 100755 --- a/var/mongoose/html/sched/pad.jim +++ b/var/mongoose/html/sched/pad.jim @@ -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" diff --git a/var/mongoose/html/sched/sched.jim b/var/mongoose/html/sched/sched.jim index 4bb6455..c299c75 100755 --- a/var/mongoose/html/sched/sched.jim +++ b/var/mongoose/html/sched/sched.jim @@ -1,7 +1,7 @@ #!/mod/bin/jimsh package require cgi -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require altrow rsv.class progressbar epg.class system.class puts "Content-Type: text/html" diff --git a/var/mongoose/html/services.shtml b/var/mongoose/html/services.shtml index dad6438..6b541b2 100644 --- a/var/mongoose/html/services.shtml +++ b/var/mongoose/html/services.shtml @@ -40,6 +40,6 @@ Results... Auto Startup Status - + diff --git a/var/mongoose/include/backup.jim b/var/mongoose/include/backup.jim index b2724a5..7af8e18 100755 --- a/var/mongoose/include/backup.jim +++ b/var/mongoose/include/backup.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require altrow rsv.class puts { diff --git a/var/mongoose/include/diskspace.jim b/var/mongoose/include/diskspace.jim index fc90df0..71a59d5 100755 --- a/var/mongoose/include/diskspace.jim +++ b/var/mongoose/include/diskspace.jim @@ -1,9 +1,9 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require system.class -lassign [system diskspace] size used perc +lassign [system diskspace] size used perc free fperc set file [format "%02d" [expr {$perc * 25 / 100 + 1}]] # The HD model only has the USB images which are blue. I prefer the green @@ -25,7 +25,8 @@ puts "
Total space: $size
- Used: $used ($perc%) + Used: $used ($perc%)
+ Free: $free ($fperc%)
" diff --git a/var/mongoose/include/epg.jim b/var/mongoose/include/epg.jim index d4fd2fb..a421dfa 100755 --- a/var/mongoose/include/epg.jim +++ b/var/mongoose/include/epg.jim @@ -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 epg_search totop [spinner new { diff --git a/var/mongoose/include/epgloc.jim b/var/mongoose/include/epgloc.jim index 4db4b4a..b910cc1 100755 --- a/var/mongoose/include/epgloc.jim +++ b/var/mongoose/include/epgloc.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require settings.class if {[[settings] epg_style] eq "grid"} { diff --git a/var/mongoose/include/menuicons.jim b/var/mongoose/include/menuicons.jim index 01f9b73..b1fff12 100755 --- a/var/mongoose/include/menuicons.jim +++ b/var/mongoose/include/menuicons.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require settings.class proc menuitem {title icon link {width 217} {height 0} {extra ""}} { diff --git a/var/mongoose/include/menuplugins.jim b/var/mongoose/include/menuplugins.jim index e5cb2ef..34183f5 100755 --- a/var/mongoose/include/menuplugins.jim +++ b/var/mongoose/include/menuplugins.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require plugin system.class proc menuitem {title icon link {width 217} {height 0} {extra ""}} { diff --git a/var/mongoose/include/model.jim b/var/mongoose/include/model.jim index 8a64159..8b3da39 100755 --- a/var/mongoose/include/model.jim +++ b/var/mongoose/include/model.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require system.class puts "Humax [system model] Fox T2 ([system hostname])" diff --git a/var/mongoose/include/modversion.jim b/var/mongoose/include/modversion.jim index 968cf4c..33d3ab7 100755 --- a/var/mongoose/include/modversion.jim +++ b/var/mongoose/include/modversion.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require system.class puts " diff --git a/var/mongoose/include/pkg.jim b/var/mongoose/include/pkg.jim index b2270d5..bd87d33 100755 --- a/var/mongoose/include/pkg.jim +++ b/var/mongoose/include/pkg.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup puts { diff --git a/var/mongoose/include/restart.jim b/var/mongoose/include/restart.jim index e20d4ad..469879a 100755 --- a/var/mongoose/include/restart.jim +++ b/var/mongoose/include/restart.jim @@ -1,6 +1,6 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require system.class if {[file exists /tmp/.restartpending]} { diff --git a/var/mongoose/include/toolbar.jim b/var/mongoose/include/toolbar.jim index 2d92d6f..50f549e 100755 --- a/var/mongoose/include/toolbar.jim +++ b/var/mongoose/include/toolbar.jim @@ -1,7 +1,10 @@ #!/mod/bin/jimsh -source /mod/var/mongoose/lib/setup -require plugin settings.class system.class +source /mod/webif/lib/setup +require settings.class +if {[[settings] notoolbar] eq "0"} { + +require plugin system.class if {[[settings] epg_style] eq "grid"} { set epglink "/cgi-bin/xepg.jim" @@ -26,6 +29,8 @@ proc tb {icon txt link {height 50} {width 0}} { } puts { + +
} @@ -48,8 +53,8 @@ puts { var lastupd = 0; if (window.location.pathname != '/' && window.location.pathname != '/index.shtml') - $('#topbar, #toolbar').hover( - function() { +{ + var down = function() { $('#toolbar').stop(true, true).delay(200).slideDown(400, function() { if (+new Date() - lastupd > 5000) @@ -62,10 +67,12 @@ if (window.location.pathname != '/' && .load('/cgi-bin/status.jim'); } }); - }, function() { + }; + var up = function() { $('#toolbar').stop(true, true).delay(200).slideUp(); - } - ); + }; + $('#topbar, #toolbar').hover(down, up); +} $('span.toolbarcell').hover( function() { @@ -75,5 +82,9 @@ $('span.toolbarcell').hover( }); + + + } +} diff --git a/var/mongoose/lib/epg.class b/var/mongoose/lib/epg.class index ad27ee5..92bd9af 100644 --- a/var/mongoose/lib/epg.class +++ b/var/mongoose/lib/epg.class @@ -1,4 +1,4 @@ -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup if {![exists -proc class]} { package require oo } if {![exists -proc sqlite3.open]} { package require sqlite3 } diff --git a/var/mongoose/lib/plugin b/var/mongoose/lib/plugin index 03e0858..0f5cdc3 100644 --- a/var/mongoose/lib/plugin +++ b/var/mongoose/lib/plugin @@ -1,6 +1,6 @@ proc eval_plugins {hook} { - foreach plugin [glob -nocomplain /mod/var/mongoose/plugin/*] { + foreach plugin [glob -nocomplain /mod/webif/plugin/*] { if {[file isfile "$plugin/$hook.hook"]} { uplevel source "$plugin/$hook.hook" } diff --git a/var/mongoose/lib/rsv.class b/var/mongoose/lib/rsv.class index 0af666a..db85a25 100755 --- a/var/mongoose/lib/rsv.class +++ b/var/mongoose/lib/rsv.class @@ -1,4 +1,4 @@ -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup if {![exists -proc class]} { package require oo } if {![exists -proc sqlite3.open]} { package require sqlite3 } diff --git a/var/mongoose/lib/settings.class b/var/mongoose/lib/settings.class index baf7dc0..f256a7d 100644 --- a/var/mongoose/lib/settings.class +++ b/var/mongoose/lib/settings.class @@ -22,6 +22,7 @@ class settings { epg_style "standard" smtp_server "" pkgdev 0 + notoolbar 0 } settings method hostname {{name ""}} { @@ -116,6 +117,10 @@ settings method pkgdev {{val -1}} { return [$self _nval_setting pkgdev $val] } +settings method notoolbar {{val -1}} { + return [$self _nval_setting notoolbar $val] +} + settings method sortorder {{val -1}} { return [$self _nval_setting sortorder $val] } diff --git a/var/mongoose/lib/setup b/var/mongoose/lib/setup index 3ff18f6..2df6623 100644 --- a/var/mongoose/lib/setup +++ b/var/mongoose/lib/setup @@ -3,18 +3,18 @@ if {![exists -proc require]} { proc require {args} {{done {}}} { foreach file $args { if {$file ni $done} { - uplevel source "/mod/var/mongoose/lib/$file" + uplevel source "/mod/webif/lib/$file" lappend $done $file } } } proc header {} { - uplevel source /mod/var/mongoose/html/lib/header.jim + uplevel source /mod/webif/html/lib/header.jim } proc footer {} { - uplevel source /mod/var/mongoose/html/lib/footer.jim + uplevel source /mod/webif/html/lib/footer.jim } # Replace the built-in jim {file copy} command with one that is diff --git a/var/mongoose/lib/system.class b/var/mongoose/lib/system.class index 080f093..7fa97ea 100644 --- a/var/mongoose/lib/system.class +++ b/var/mongoose/lib/system.class @@ -68,6 +68,7 @@ proc {system diskspace} {} { set size 0 set used 0 + set free 0 set perc 0 foreach line [split [exec /mod/bin/busybox/df -h $part 2>>/dev/null] "\n\r"] { if {[string match "/*" $line]} { @@ -75,12 +76,14 @@ proc {system diskspace} {} { set fields [split $line] set size [lindex $fields 1] set used [lindex $fields 2] + set free [lindex $fields 3] set perc [string trimright [lindex $fields 4] "%"] + set fperc $(100 - $perc) break } } - return [list $size $used $perc] + return [list $size $used $perc $free $fperc] } proc {system busy} {} { diff --git a/var/mongoose/lib/ts.class b/var/mongoose/lib/ts.class index 5a2110d..4a92c87 100644 --- a/var/mongoose/lib/ts.class +++ b/var/mongoose/lib/ts.class @@ -1,6 +1,6 @@ if {![exists -proc class]} { package require oo } -source /mod/var/mongoose/lib/setup +source /mod/webif/lib/setup require tdelete set dmsfile /mnt/hd2/dms_cds.db diff --git a/webif b/webif new file mode 120000 index 0000000..92020b2 --- /dev/null +++ b/webif @@ -0,0 +1 @@ +var/mongoose \ No newline at end of file