diff --git a/CONTROL/control b/CONTROL/control
index 6aa580c..dcbb828 100644
--- a/CONTROL/control
+++ b/CONTROL/control
@@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
-Version: 0.5.6
+Version: 0.5.7
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=2.11-5),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.2),jim-oo,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.2),hmt(>=1.0.6),ssmtp
diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim
index 6491182..3a24539 100755
--- a/var/mongoose/cgi-bin/browse.jim
+++ b/var/mongoose/cgi-bin/browse.jim
@@ -221,6 +221,7 @@ foreach part [split $dir /] {
append stub $name
puts "$name
}
+puts ""
puts ""
# Parent directory
diff --git a/var/mongoose/cgi-bin/browse/browse.js b/var/mongoose/cgi-bin/browse/browse.js
index 276ac9a..5f04ac7 100755
--- a/var/mongoose/cgi-bin/browse/browse.js
+++ b/var/mongoose/cgi-bin/browse/browse.js
@@ -20,13 +20,18 @@ function epginfo_callback(data, status, xhr)
function insert_folder_size(folder, size)
{
folder = folder.replace(/ /g, '');
+ folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
//console.log("Folder: (%s) = (%s)", folder, size);
- $('#' + folder).text(' (' + size + 'iB)');
+ if (folder == "")
+ $('#dirsize').text(' (' + size + 'iB)');
+ else
+ $('#' + folder).text(' (' + size + 'iB)');
}
function folder_size_callback(data, status, xhr)
{
//console.log("Status: %s", status);
+ //console.dir(data);
$.each(data, insert_folder_size);
}
diff --git a/var/mongoose/cgi-bin/browse/sizes.jim b/var/mongoose/cgi-bin/browse/sizes.jim
index 0313ec7..6dca32c 100755
--- a/var/mongoose/cgi-bin/browse/sizes.jim
+++ b/var/mongoose/cgi-bin/browse/sizes.jim
@@ -8,7 +8,7 @@ puts ""
cgi_input
#cgi_dump
-set _cgi(dir) "/media/My Video"
+#set _cgi(dir) "/media/My Video"
set dir [dict get $_cgi dir]
@@ -18,7 +18,7 @@ puts "{"
foreach line [split [exec /mod/bin/busybox/du -h "$dir/"] "\n"] {
set fields [split $line "\t"]
set size [lindex $fields 0]
- set node [lindex [split [lindex $fields 1] '/'] end]
+ set node [lindex [split [lindex $fields 1] /] end]
puts "\"$node\" : \"$size\","
}
puts "\"dummy\" : \"\""