diff --git a/CONTROL/control b/CONTROL/control
index f249511..6411a8a 100644
--- a/CONTROL/control
+++ b/CONTROL/control
@@ -1,10 +1,10 @@
Package: webif
Priority: optional
Section: web
-Version: 1.2.6-3
+Version: 1.2.7
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
-Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.37-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.1),hmt(>=2.0.9),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7)
+Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.39),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.1),hmt(>=2.0.9),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7)
Suggests:
Description: An evolving web interface for the Humax.
Tags: http://hummy.tv/forum/threads/6484/
diff --git a/webif/html/browse/audio/audio.jim b/webif/html/browse/audio/audio.jim
index 69a4b53..8ff01dc 100755
--- a/webif/html/browse/audio/audio.jim
+++ b/webif/html/browse/audio/audio.jim
@@ -35,13 +35,12 @@ puts "
+
-
-
diff --git a/webif/html/browse/audio/audio.js b/webif/html/browse/audio/audio.js
index ebdc542..a327ea9 100755
--- a/webif/html/browse/audio/audio.js
+++ b/webif/html/browse/audio/audio.js
@@ -15,12 +15,13 @@ $(document).ready(function() {
$('#progressbar').reportprogress(0);
$('#back').button().click(function() {
- window.location = '../index.jim?dir=' + $('#params').attr('dir');
+ window.location = '/go/browse?dir=' + $('#params').attr('dir');
});
$('#audioit').button().click(function() {
$('#audiodiv').hide('slow');
$('#progressdiv').show('slow');
+ $('#back').hide();
handle = setInterval("update()", 1000);
$('#output').load('execute.jim?file=' + $('#params').attr('rfile'),
function() {
diff --git a/webif/html/browse/bookmarks/script.js b/webif/html/browse/bookmarks/script.js
index b49e99e..1ff44a7 100644
--- a/webif/html/browse/bookmarks/script.js
+++ b/webif/html/browse/bookmarks/script.js
@@ -119,7 +119,7 @@ $('#save').button({icons: {primary: "ui-icon-disk"}})
$('#back').button({icons: {primary: "ui-icon-arrowreturnthick-1-w"}})
.on('click', function() {
- window.location = '../index.jim?dir=' + dir;
+ window.location = '/go/browse?dir=' + dir;
});
$('#update').button()
diff --git a/webif/html/browse/chunk/chunk.jim b/webif/html/browse/chunk/chunk.jim
index de2d545..b119b28 100755
--- a/webif/html/browse/chunk/chunk.jim
+++ b/webif/html/browse/chunk/chunk.jim
@@ -53,12 +53,9 @@ puts "
-
-
-
"
diff --git a/webif/html/browse/chunk/chunk.js b/webif/html/browse/chunk/chunk.js
index 2dad681..7539935 100644
--- a/webif/html/browse/chunk/chunk.js
+++ b/webif/html/browse/chunk/chunk.js
@@ -48,7 +48,7 @@ function xpart(part)
else
{
clearInterval(handle);
- $('#findiv').show('slow');
+ $('#back').show('slow');
}
}
@@ -60,6 +60,7 @@ $('#chunkit').button().click(function(e) {
e.preventDefault();
$('#chunkdiv').hide('slow');
$('tr.part').show('slow');
+ $('#back').hide();
handle = setInterval("xprogress()", 1000);
xpart(0);
@@ -69,7 +70,7 @@ $('#back').button().click(function(e) {
e.preventDefault();
var dir = $(this).attr('dir');
- window.location = '../index.jim?dir=' + dir;
+ window.location = '/go/browse?dir=' + dir;
});
});
diff --git a/webif/html/browse/crop/crop.jim b/webif/html/browse/crop/crop.jim
index 233c8fb..9ab6cc0 100755
--- a/webif/html/browse/crop/crop.jim
+++ b/webif/html/browse/crop/crop.jim
@@ -101,13 +101,12 @@ puts "
+
-
-
diff --git a/webif/html/browse/crop/crop.js b/webif/html/browse/crop/crop.js
index d7d7894..52b6c9c 100755
--- a/webif/html/browse/crop/crop.js
+++ b/webif/html/browse/crop/crop.js
@@ -17,12 +17,13 @@ $(document).ready(function() {
$('#progressbar').reportprogress(0);
$('#back').button().click(function() {
- window.location = '../index.jim?dir=' + $('#params').attr('dir');
+ window.location = '/go/browse?dir=' + $('#params').attr('dir');
});
$('#cropit').button().click(function() {
$('#cropdiv').hide('slow');
$('#progressdiv').show('slow');
+ $('#back').hide();
handle = setInterval("update()", 1000);
$('#output').show().text('Please do not interrupt...')
.load('execute.jim?file=' + $('#params').attr('file') +
diff --git a/webif/html/browse/decrypt/decrypt.jim b/webif/html/browse/decrypt/decrypt.jim
index 4abc414..616fd19 100755
--- a/webif/html/browse/decrypt/decrypt.jim
+++ b/webif/html/browse/decrypt/decrypt.jim
@@ -52,12 +52,12 @@ puts "
+
-
diff --git a/webif/html/browse/decrypt/decrypt.js b/webif/html/browse/decrypt/decrypt.js
index b0644e6..0120b4f 100755
--- a/webif/html/browse/decrypt/decrypt.js
+++ b/webif/html/browse/decrypt/decrypt.js
@@ -15,12 +15,13 @@ $(document).ready(function() {
$('#progressbar').reportprogress(0);
$('#back').button().click(function() {
- window.location = '../index.jim?dir=' + $('#params').attr('dir');
+ window.location = '/go/browse?dir=' + $('#params').attr('dir');
});
$('#decryptit').button().click(function() {
$('#decryptdiv').hide('slow');
$('#progressdiv').show('slow');
+ $('#back').hide();
handle = setInterval("update()", 1000);
$('#output').load('execute.jim?file=' + $('#params').attr('file'),
function() {
diff --git a/webif/html/browse/file.jim b/webif/html/browse/file.jim
index ac4d034..6cb92dd 100755
--- a/webif/html/browse/file.jim
+++ b/webif/html/browse/file.jim
@@ -31,7 +31,7 @@ if {$type eq "ts"} {
"
if {[file exists "[file rootname $file].thm"]} {
- puts " "
+ puts " "
}
if {[dict exists $idata thumb]} {
diff --git a/webif/html/browse/index.jim b/webif/html/browse/index.jim
index c52f9b1..dd1a16e 100755
--- a/webif/html/browse/index.jim
+++ b/webif/html/browse/index.jim
@@ -249,10 +249,12 @@ if {[system model] eq "HDR" && ![system param DMS_START_ON]} {
#}
puts "
- $dir
- $mroot
-
"
diff --git a/webif/html/browse/strip/strip.js b/webif/html/browse/strip/strip.js
index 4524d68..2513e79 100755
--- a/webif/html/browse/strip/strip.js
+++ b/webif/html/browse/strip/strip.js
@@ -27,12 +27,13 @@ $('#analysis').load('analyse.jim?file=' + $('#params').attr('file'),
$('#progressbar').reportprogress(0);
$('#back').button().click(function() {
- window.location = '../index.jim?dir=' + $('#params').attr('dir');
+ window.location = '/go/browse?dir=' + $('#params').attr('dir');
});
$('#stripit').button().click(function() {
$('#stripdiv').hide('slow');
$('#progressdiv').show('slow');
+ $('#back').hide();
handle = setInterval("update()", 1000);
$('#output').text('Please do not interrupt...')
.load('execute.jim?file=' + $('#params').attr('file'),
diff --git a/webif/html/browse/thumbnail/script.js b/webif/html/browse/thumbnail/script.js
index e15117f..e033a51 100755
--- a/webif/html/browse/thumbnail/script.js
+++ b/webif/html/browse/thumbnail/script.js
@@ -8,7 +8,7 @@ $('button').button();
function go(pos)
{
- window.location.href = 'index.jim?file=' +
+ window.location.href = '/browse/thumbnail/?file=' +
encodeURIComponent(file) + '&pos=' + pos;
}
@@ -26,7 +26,7 @@ $('#repos').disable().on('click', function(e) {
$('#back').on('click', function(e) {
e.preventDefault();
- window.location.href = '/browse/index.jim?dir=' +
+ window.location.href = '/go/browse?dir=' +
encodeURIComponent(dir);
});
@@ -34,22 +34,23 @@ $('button.usethm').disable().on('click', function(e) {
e.preventDefault();
var pos = $(this).attr('pos');
$('button,input').disable();
- $.get('set.jim?file=' + encodeURIComponent(file) + '&pos=' + pos,
+ $.get('/browse/thumbnail/set.jim?file=' +
+ encodeURIComponent(file) + '&pos=' + pos,
function() {
- window.location.href = '/browse/index.jim?dir=' +
+ window.location.href = '/go/browse?dir=' +
encodeURIComponent(dir);
});;
});
var start = $('#start').text();
var end = $('#end').text();
-$.get('mkrange.jim?file=' + encodeURIComponent(file) +
+$.get('/browse/thumbnail/mkrange.jim?file=' + encodeURIComponent(file) +
'&s=' + start + '&e=' + end, function() {
$('img.bmp').each(function(i) {
var pos = $(this).attr('pos');
$(this).attr('src',
- 'fetch.jim?file=' + encodeURIComponent(file) +
- '&pos=' + pos);
+ '/browse/thumbnail/fetch.jim?file=' +
+ encodeURIComponent(file) + '&pos=' + pos);
});
$('button').enable();
});
diff --git a/webif/html/browse/tvdb/episode.js b/webif/html/browse/tvdb/episode.js
index 3123682..7049f2e 100644
--- a/webif/html/browse/tvdb/episode.js
+++ b/webif/html/browse/tvdb/episode.js
@@ -18,14 +18,14 @@ $('button.select').button().on('click', function() {
s: $tr.attr('s'),
e: $tr.attr('e')
}, function() {
- window.location.href = '/browse/?dir=' +
+ window.location.href = '/go/browse/?dir=' +
encodeURIComponent(dir);
});
});
$('#tvdbepsearch').button({icons:{primary:"ui-icon-search"}})
.on('click', function() {
- window.location.href = 'episode.jim?file=' +
+ window.location.href = '/browse/tvdb/episode.jim?file=' +
encodeURIComponent(file) + '&search=' +
encodeURIComponent($('#searchterm').val());
});
diff --git a/webif/html/browse/tvdb/script.js b/webif/html/browse/tvdb/script.js
index 9bd0538..1da72cb 100644
--- a/webif/html/browse/tvdb/script.js
+++ b/webif/html/browse/tvdb/script.js
@@ -9,7 +9,7 @@ function select_episode()
$('#tvdbresults_saving').show();
$('#tvdbresults').diagrefresh();
- $.get('tvdb/store.jim', { dir: dir, sid: sid }, function(data) {
+ $.get('/browse/tvdb/store.jim', { dir: dir, sid: sid }, function(data) {
if (data <= 0)
{
window.location.reload(true);
@@ -24,7 +24,7 @@ function select_episode()
$('.tvdbresults').hide();
$('#tvdbresults_saving').show();
$('#tvdbresults').diagrefresh();
- $.get('tvdb/store.jim', {
+ $.get('/browse/tvdb/store.jim', {
dir: dir,
sid: sid,
series: $('#tvdb_forceseries').val()
@@ -70,7 +70,7 @@ $('#tvdbsetseries').button().on('click', function(e) {
}
}
});
- $('#tvdbresults_inner').load('tvdb/search.jim',
+ $('#tvdbresults_inner').load('/browse/tvdb/search.jim',
{ term: $('#tvdbsearch').val() }, function() {
$('#tvdbresults_inner')
.find('.tvdbselect')
@@ -93,7 +93,7 @@ $('#tvdbsetseries').button().on('click', function(e) {
'this folder?'))
return;
blockpage('Clearing Series Information...');
- $.get('tvdb/store.jim', {dir: dir, sid: 0},
+ $.get('/browse/tvdb/store.jim', {dir: dir, sid: 0},
function() {
window.location.reload(true);
});
diff --git a/webif/html/go b/webif/html/go
new file mode 100755
index 0000000..7be8bf2
--- /dev/null
+++ b/webif/html/go
@@ -0,0 +1,91 @@
+#!/mod/bin/jimsh
+
+source /mod/webif/lib/setup
+require system.class settings.class plugin
+
+set module [file tail $env(PATH_INFO)]
+set lastmodule ""
+if {[dict exists $env HTTP_COOKIE]} {
+ regexp {webif_lastmod=([a-z_]+)} $env(HTTP_COOKIE) x lastmodule
+}
+
+set settings [settings]
+
+if {[$settings epg_style] eq "grid"} {
+ set epglink "/cgi-bin/xepg.jim"
+} else {
+ set epglink "/epg/list.jim"
+}
+
+set pages {
+ "browse" "/browse/"
+ "schedule" "/sched/"
+ "mobile" "/m/"
+ "service" "/services/"
+ "pkg" "/pkg/"
+ "diag" "/diag/diag.jim"
+ "settings" "/settings/settings.jim"
+}
+set pages(epg) $epglink
+
+set modules {}
+foreach {page link} $pages {
+ set modules($page) [list $link 50]
+ set modules(mm_$page) [list $link 50]
+}
+
+proc register_module {module url {priority 75}} {
+ global modules
+
+ if {$module ni $modules} {
+ # New module
+ set modules($module) [list $url $priority]
+ return
+ }
+ lassign $modules($module) x pri
+ if {$priority > $pri} {
+ set modules($module) [list $url $priority]
+ }
+}
+
+proc override_module {module} {
+ set ::module $module
+}
+
+if {$module eq "debug"} {
+ httpheader
+ puts "Parameters"
+ puts ""
+ puts "MODULE: $module"
+ puts "LASTMOD: $lastmodule"
+ puts " "
+ puts "Modules"
+ puts ""
+ parray modules
+ puts " "
+}
+
+eval_plugins go 1
+
+if {$module eq "debug"} {
+ puts "After plugins"
+ puts ""
+ parray modules
+ parray env
+ puts " "
+ exit
+}
+
+if {$module ni $modules} {
+ httpheader
+ puts "Error, module '$module' not found."
+ exit
+}
+
+lassign $modules($module) url
+if [dict exists $env QUERY_STRING] {
+ append url "?$env(QUERY_STRING)"
+}
+
+httpredirect $url "Set-Cookie: webif_lastmod=$module"
+
diff --git a/webif/include/epgloc.jim b/webif/include/epgloc.jim
deleted file mode 100755
index 0ece0a4..0000000
--- a/webif/include/epgloc.jim
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/mod/bin/jimsh
-
-source /mod/webif/lib/setup
-require settings.class
-
-if {[[settings] epg_style] eq "grid"} {
- puts -nonewline "/cgi-bin/xepg.jim"
-} else {
- puts -nonewline "/epg/list.jim"
-}
-
diff --git a/webif/include/menuicons.jim b/webif/include/menuicons.jim
index 71f4140..3643b0e 100755
--- a/webif/include/menuicons.jim
+++ b/webif/include/menuicons.jim
@@ -36,38 +36,32 @@ proc menuitem {title icon link {width 217} {height 0} {extra ""}} {{num 0}} {
set settings [settings]
-if {[$settings epg_style] eq "grid"} {
- set epglink "/cgi-bin/xepg.jim"
-} else {
- set epglink "/epg/list.jim"
-}
-
puts {}
menuitem "Browse Media Files" "/images/323_1_10_Menu_Video.png" \
- /browse/index.jim 217 228
+ /go/mm_browse
menuitem "Scheduled Events" "/images/321_1_00_Menu_CHList.png" \
- /sched/index.jim 217 228
+ /go/mm_schedule
menuitem "EPG" "/images/328_1_26_Menu_TV_Guide.png" \
- $epglink 217 228
+ /go/mm_epg 217 228
if {[file exists "/mod/bin/ir"]} {
menuitem "Remote" "/img/remote.png" /plugin/ir/remote.jim 217 228
}
-if {[[settings] nomobile] eq "0"} {
- menuitem "Mobile Version" "/img/mobile.png" /m/ 217 228
+if {[$settings nomobile] eq "0"} {
+ menuitem "Mobile Version" "/img/mobile.png" /go/mm_mobile 217 228
}
menuitem "Service Management" "/img/spanner.png" \
- /services/index.jim 217 228
+ /go/mm_service 217 228
menuitem "Package Management" "/img/packages.png" \
- /pkg/index.jim 217 228
+ /go/mm_pkg 217 228
menuitem "Settings" "/images/326_1_00_Menu_Settings.png" \
- /settings/settings.jim 217 228
+ /go/mm_settings 217 228
menuitem "Diagnostics" "/img/diagnostics.png" \
- /diag/diag.jim 217 228
+ /go/mm_diag 217 228
eval_plugins menu
@@ -85,7 +79,6 @@ puts {
}
-
if {[$settings nohelplinks] == 0} {
menuitem "-reset" "" ""
diff --git a/webif/include/toolbar.jim b/webif/include/toolbar.jim
index 8e7226f..3313405 100755
--- a/webif/include/toolbar.jim
+++ b/webif/include/toolbar.jim
@@ -1,16 +1,11 @@
#!/mod/bin/jimsh
require settings.class
+
if {[[settings] notoolbar] eq "0"} {
require plugin system.class
-if {[[settings] epg_style] eq "grid"} {
- set epglink "/cgi-bin/xepg.jim"
-} else {
- set epglink "/epg/list.jim"
-}
-
proc tb {icon txt link {height 50} {width 0}} {
if {$width > 0} {
set width " width=$width"
@@ -37,13 +32,13 @@ puts {
if {[file exists "/mod/bin/ir"]} {
tb "/img/remote.png" "Remote" "/plugin/ir/remote.jim"
}
-tb "/images/323_1_10_Menu_Video.png" "Browse" "/browse/index.jim"
-tb "/images/321_1_00_Menu_CHList.png" "Schedule" "/sched/index.jim"
-tb "/images/328_1_26_Menu_TV_Guide.png" "EPG" $epglink
-tb "/img/spanner.png" "Services" "/services/index.jim"
-tb "/img/packages.png" "Packages" "/pkg/index.jim"
-tb "/images/326_1_00_Menu_Settings.png" "Settings" "/settings/settings.jim"
-tb "/img/diagnostics.png" "Diag" "/diag/diag.jim"
+tb "/images/323_1_10_Menu_Video.png" "Browse" "/go/mm_browse"
+tb "/images/321_1_00_Menu_CHList.png" "Schedule" "/go/mm_schedule"
+tb "/images/328_1_26_Menu_TV_Guide.png" "EPG" "/go/mm_epg"
+tb "/img/spanner.png" "Services" "/go/mm_service"
+tb "/img/packages.png" "Packages" "/go/mm_pkg"
+tb "/images/326_1_00_Menu_Settings.png" "Settings" "/go/mm_settings"
+tb "/img/diagnostics.png" "Diag" "/go/mm_diag"
eval_plugins toolbar
puts {
diff --git a/webif/lib/browse.class b/webif/lib/browse.class
index df0909a..3453eac 100644
--- a/webif/lib/browse.class
+++ b/webif/lib/browse.class
@@ -179,7 +179,7 @@ proc {browse breadcrumb} {dir} {
foreach part [split $dir /] {
if {$stub eq "/"} { set name $part } else { set name "/$part" }
append stub $name
- puts " $name"
+ puts " $name"
}
}
diff --git a/webif/lib/epg_search b/webif/lib/epg_search
index 7717374..cc810fd 100755
--- a/webif/lib/epg_search
+++ b/webif/lib/epg_search
@@ -57,12 +57,7 @@ cts 10 "Leisure" "Leisure"
puts " | "
-if {[[settings] epg_style] eq "grid"} {
- puts ""
-} else {
- puts ""
-}
-puts "Now/Next"
+puts "Now/Next"
puts " | | "
diff --git a/webif/lib/setup b/webif/lib/setup
index 0e5571f..79e768b 100644
--- a/webif/lib/setup
+++ b/webif/lib/setup
@@ -9,8 +9,11 @@ if {![exists -proc require]} {
}
}
- proc httpredirect {url} {
+ proc httpredirect {url {extra ""}} {
puts -nonewline "Location: $url\r\n"
+ if {$extra ne ""} {
+ puts -nonewline "$extra\r\n"
+ }
puts -nonewline "\r\n"
puts "Redirecting to $url"
exit
diff --git a/webif/lib/system.class b/webif/lib/system.class
index f3d4ee0..37f29b1 100644
--- a/webif/lib/system.class
+++ b/webif/lib/system.class
@@ -299,6 +299,17 @@ proc {system disk} {} {
return [string range [system diskdev] 0 end-1]
}
+proc {system disktemp} {} {
+ if {[catch {
+ set smart [exec /mod/bin/smartctl -f brief -A [system disk] \
+ | grep ^194]
+ regexp {K *([0-9]+)} $smart x temp
+ }]} {
+ set temp 0
+ }
+ return $($temp + 0)
+}
+
require pretty_size
proc {system diskspace} {{raw 0}} {
|