diff --git a/var/mongoose/cgi-bin/cat.jim b/var/mongoose/cgi-bin/cat.jim index bdc5d53..978051a 100755 --- a/var/mongoose/cgi-bin/cat.jim +++ b/var/mongoose/cgi-bin/cat.jim @@ -2,7 +2,7 @@ package require cgi source /mod/webif/lib/setup -require system.class chunked pretty_size +require system.class pretty_size cgi_input #cgi_dump @@ -10,16 +10,14 @@ cgi_input set file [cgi_get file "-"] if {$file eq "-"} { exit } -start_chunked +httpheader "text/plain" if {![file exists $file]} { - chunk ">>> File $file does not exist.\r\n" + puts ">>> File $file does not exist.\r\n" } else { - chunk ">>> Contents of $file [pretty_size [file size $file]]\r\n" + puts ">>> Contents of $file [pretty_size [file size $file]]\r\n" set fp [open $file r] - chunk [read $fp] + puts [read $fp] close $fp } -end_chunked - diff --git a/var/mongoose/cgi-bin/db.jim b/var/mongoose/cgi-bin/db.jim index 9cfe7ae..86a6ed4 100755 --- a/var/mongoose/cgi-bin/db.jim +++ b/var/mongoose/cgi-bin/db.jim @@ -63,7 +63,7 @@ proc db_info {db_file} { if {$fdb == 0} { puts "Please choose database to view:" diff --git a/var/mongoose/cgi-bin/epg/dump.jim b/var/mongoose/cgi-bin/epg/dump.jim index 8ce85a4..21bfb4e 100755 --- a/var/mongoose/cgi-bin/epg/dump.jim +++ b/var/mongoose/cgi-bin/epg/dump.jim @@ -13,7 +13,7 @@ set raw [cgi_get raw] puts "
"
 if { $raw == 0 } {
 	puts [epg exec dump -raw 1 -service $service -event $event]
-	puts "
+	puts "
 		Click here for extended dump"
 } else {
 	puts [epg exec dumpraw -raw 1 -service $service -event $event]
diff --git a/var/mongoose/cgi-bin/opkg.jim b/var/mongoose/cgi-bin/opkg.jim
index 583f8ef..e3fafec 100755
--- a/var/mongoose/cgi-bin/opkg.jim
+++ b/var/mongoose/cgi-bin/opkg.jim
@@ -2,7 +2,7 @@
 
 package require cgi
 source /mod/webif/lib/setup
-require pkg.class chunked
+require pkg.class
 
 cgi_input
 #cgi_dump
@@ -10,30 +10,27 @@ cgi_input
 set cmd [cgi_get cmd update]
 
 proc opkg {cmd} {
-	chunk ">>> opkg $cmd\r\n"
+	puts ">>> opkg $cmd\r\n"
 	set bcmd "|/mod/webif/lib/bin/opkg $cmd"
 	set fd [open $bcmd r]
 	while {[gets $fd line] >= 0} {
-		chunk "$line\r\n"
-		#chunk_pad
+		puts "$line\r\n"
 	}
 	close $fd
-	chunk "\r\n"
+	puts "\r\n"
 }
 
-start_chunked
+httpheader "text/plain"
 
 if {$cmd eq "upgrade"} { opkg update }
 opkg $cmd
 
 if {$cmd eq "update" || $cmd eq "upgrade"} {
-	chunk "Updating package meta information\r\n"
+	puts "Updating package meta information\r\n"
 	pkg fetchmeta
-	chunk "Done.\r\n"
-	chunk "Updating diagnostic meta information\r\n"
+	puts "Done.\r\n"
+	puts "Updating diagnostic meta information\r\n"
 	pkg fetchdiagmeta
-	chunk "Done.\r\n"
+	puts "Done.\r\n"
 }
 
-end_chunked
-
diff --git a/var/mongoose/cgi-bin/settings.jim b/var/mongoose/cgi-bin/settings.jim
index 0ac6ae1..e87a9b1 100755
--- a/var/mongoose/cgi-bin/settings.jim
+++ b/var/mongoose/cgi-bin/settings.jim
@@ -52,7 +52,7 @@ set audiomp3 [$settings audiomp3]
 
 # Handle updates
 
-if {![dict exists $env REQUEST_URI]} { set env(REQUEST_URI) "" }
+if {![dict exists $env SCRIPT_NAME]} { set env(SCRIPT_NAME) "" }
 
 proc _handle_update {class var old text} {
 	global _cgi
@@ -161,7 +161,7 @@ puts "
 
 puts "
 	
-	
+ Hostname - + Auto-processing log level @@ -251,7 +251,7 @@ puts " puts " - + Default Now/Next style @@ -299,7 +299,7 @@ puts " puts " - + Channel Group for EPG @@ -369,7 +369,7 @@ puts " # #puts " # -# +# # SMTP Server for outbound email # Add New User" puts " - + New User: - - - diff --git a/var/mongoose/cgi-bin/backup/backup.jim b/var/mongoose/html/backup/backup.jim similarity index 100% rename from var/mongoose/cgi-bin/backup/backup.jim rename to var/mongoose/html/backup/backup.jim diff --git a/var/mongoose/cgi-bin/backup/backup.js b/var/mongoose/html/backup/backup.js similarity index 86% rename from var/mongoose/cgi-bin/backup/backup.js rename to var/mongoose/html/backup/backup.js index 23f87a7..f5ad146 100755 --- a/var/mongoose/cgi-bin/backup/backup.js +++ b/var/mongoose/html/backup/backup.js @@ -1,7 +1,7 @@ function refresh_files() { - $('#backup_files').load('/cgi-bin/backup/files.jim', function() { + $('#backup_files').load('files.jim', function() { $('input.restore').change(function() { $('#restore_button').removeAttr('disabled') .button('option', 'disabled', false); @@ -20,7 +20,7 @@ $(document).ready(function() { $('#backup_button').click(function() { $('#backup_working').slideDown(); - $('#results').load('/cgi-bin/backup/backup.jim?' + + $('#results').load('backup.jim?' + $('#backup_name').serialize(), function() { $('#results').slideDown(function() { $('#backup_working').slideUp(); @@ -32,7 +32,7 @@ $(document).ready(function() { var backup = $('input.restore:checked').val(); if (confirm('Confirm deletion of ' + backup)) { - $('#results').load('/cgi-bin/backup/delete.jim?' + + $('#results').load('delete.jim?' + $('input.restore').serialize(), function() { $('#results').slideDown(function() { refresh_files(); @@ -42,7 +42,7 @@ $(document).ready(function() { }); $('#view_button').click(function() { var backup = $('input.restore:checked').val(); - $('#results').load('/cgi-bin/backup/view.jim?' + + $('#results').load('view.jim?' + $('input.restore').serialize(), function() { $('#results').slideDown(function() { refresh_files(); @@ -54,7 +54,7 @@ $(document).ready(function() { if (confirm('!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE CONFIRM !!!!!!!!!!!!!!!!!!!!!!!!!\n\nAre you sure you wish to erase all scheduled recordings and favourite channels and then restore them from\n' + backup + '?')) { $('#restore_working').slideDown(); - $('#results').load('/cgi-bin/backup/restore.jim?' + + $('#results').load('restore.jim?' + $('input.restore').serialize(), function() { $('#results').slideDown(function() { $('#restore_working').slideUp(); diff --git a/var/mongoose/cgi-bin/backup/delete.jim b/var/mongoose/html/backup/delete.jim similarity index 100% rename from var/mongoose/cgi-bin/backup/delete.jim rename to var/mongoose/html/backup/delete.jim diff --git a/var/mongoose/cgi-bin/backup/files.jim b/var/mongoose/html/backup/files.jim similarity index 100% rename from var/mongoose/cgi-bin/backup/files.jim rename to var/mongoose/html/backup/files.jim diff --git a/var/mongoose/include/backup.jim b/var/mongoose/html/backup/index.jim similarity index 97% rename from var/mongoose/include/backup.jim rename to var/mongoose/html/backup/index.jim index 79db2d4..e6ec8f2 100755 --- a/var/mongoose/include/backup.jim +++ b/var/mongoose/html/backup/index.jim @@ -3,8 +3,9 @@ source /mod/webif/lib/setup require altrow rsv.class -noheader -jscss /cgi-bin/backup/backup.js +jscss backup.js +header + puts {

Backup/Restore

@@ -65,3 +66,5 @@ puts { } +footer + diff --git a/var/mongoose/cgi-bin/backup/restore.jim b/var/mongoose/html/backup/restore.jim similarity index 100% rename from var/mongoose/cgi-bin/backup/restore.jim rename to var/mongoose/html/backup/restore.jim diff --git a/var/mongoose/cgi-bin/backup/view.jim b/var/mongoose/html/backup/view.jim similarity index 100% rename from var/mongoose/cgi-bin/backup/view.jim rename to var/mongoose/html/backup/view.jim diff --git a/var/mongoose/html/browse/index.jim b/var/mongoose/html/browse/index.jim index 9ac298f..f203b08 100755 --- a/var/mongoose/html/browse/index.jim +++ b/var/mongoose/html/browse/index.jim @@ -14,8 +14,8 @@ set flatten [system pkginst flatten] set ignore {.nts .thm .hmi} set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt} -if {![dict exists $env REQUEST_URI]} { - set env(REQUEST_URI) "" +if {![dict exists $env SCRIPT_NAME]} { + set env(SCRIPT_NAME) "" cgi_input set _cgi(dir) "/media/My Video/" } @@ -52,7 +52,7 @@ proc directory {file bfile tbfile} { if {!$::nofcount} { puts "" } puts "" puts "" puts "$bfile " @@ -264,7 +264,7 @@ set stub "" foreach part [split $dir /] { if {$stub eq "/"} { set name $part } else { set name "/$part" } append stub $name - puts "$name + puts "$name } puts "" puts "" @@ -274,7 +274,7 @@ set parent [join [lrange [split $dir /] 0 end-1] /] if {$parent ne ""} { puts " @@ -333,7 +333,7 @@ foreach sl $sortlist { set tag "Currently sorting" if {$order != $index} { puts " - " + " set tag "Sort" } puts " $tag by $descr" diff --git a/var/mongoose/html/css/iphone-style-checkboxes.css b/var/mongoose/html/css/iphone-style-checkboxes.css deleted file mode 120000 index 06a66a9..0000000 --- a/var/mongoose/html/css/iphone-style-checkboxes.css +++ /dev/null @@ -1 +0,0 @@ -../lib/jquery.iphone-style-checkboxes/iphone-style-checkboxes.css \ No newline at end of file diff --git a/var/mongoose/html/diag/rundiag.jim b/var/mongoose/html/diag/rundiag.jim index d073f66..d6228b9 100755 --- a/var/mongoose/html/diag/rundiag.jim +++ b/var/mongoose/html/diag/rundiag.jim @@ -2,32 +2,28 @@ package require cgi source /mod/webif/lib/setup -require system.class chunked +require system.class cgi_input #cgi_dump set diag [cgi_get diag general] -start_chunked +httpheader "text/plain" if {[system modversion 1] < 113} { - chunk ">>> Diagnostics only available with customised firmware 1.13 or above." - end_chunked + puts ">>> Diagnostics only available with customised firmware 1.13 or above." exit } -chunk ">>> Beginning diagnostic $diag\r\n" +puts ">>> Beginning diagnostic $diag\r\n" set bcmd "|/bin/diag $diag" set fd [open $bcmd r] while {[gets $fd line] >= 0} { - chunk "$line\r\n" - #chunk_pad + puts "$line" } close $fd -chunk "\r\n" -chunk ">>> Ending diagnostic $diag\r\n" - -end_chunked +puts "\r\n" +puts ">>> Ending diagnostic $diag\r\n" diff --git a/var/mongoose/html/edit/get.jim b/var/mongoose/html/edit/get.jim index 8d2214a..78bb9ca 100755 --- a/var/mongoose/html/edit/get.jim +++ b/var/mongoose/html/edit/get.jim @@ -2,7 +2,7 @@ package require cgi source /mod/webif/lib/setup -require chunked pretty_size +require pretty_size cgi_input #cgi_dump @@ -10,23 +10,21 @@ cgi_input set file [cgi_get file "/tmp/hosts"] if {$file eq "-"} { exit } -start_chunked "text/plain" +httpheader "text/plain" 0 if {![file exists $file]} { - chunk ">>> File $file does not exist.\r\n" + puts ">>> File $file does not exist.\r\n" } else { set type [exec /mod/bin/file --brief --mime-type --dereference $file] if {![string match {text/*} $type]} { - chunk ">>> File $file is not a plain file ($type)" + puts ">>> File $file is not a plain file ($type)" } elseif {[file size $file] > 102400} { - chunk ">>> File $file is too large." - chunk ">>> [pretty_size [file size $file]]" + puts ">>> File $file is too large." + puts ">>> [pretty_size [file size $file]]" } else { set fp [open $file r] - chunk [read $fp] + puts [read $fp] close $fp } } -end_chunked - diff --git a/var/mongoose/html/epg.shtml b/var/mongoose/html/epg.shtml deleted file mode 100644 index 3ffe153..0000000 --- a/var/mongoose/html/epg.shtml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/var/mongoose/include/epg.jim b/var/mongoose/html/epg/list.jim similarity index 99% rename from var/mongoose/include/epg.jim rename to var/mongoose/html/epg/list.jim index 679c1da..c441313 100755 --- a/var/mongoose/include/epg.jim +++ b/var/mongoose/html/epg/list.jim @@ -2,9 +2,9 @@ package require cgi source /mod/webif/lib/setup +header require epg.class spinner.class altrow epg_search system.class -noheader require totop @@ -112,3 +112,5 @@ puts " epg cleanup +footer + diff --git a/var/mongoose/html/index.html b/var/mongoose/html/index.html new file mode 100644 index 0000000..3bd32e6 --- /dev/null +++ b/var/mongoose/html/index.html @@ -0,0 +1,14 @@ + + + +Page Redirection + + + + +You are being redirected to index.jim>/a> + + + diff --git a/var/mongoose/html/index.shtml b/var/mongoose/html/index.jim old mode 100644 new mode 100755 similarity index 75% rename from var/mongoose/html/index.shtml rename to var/mongoose/html/index.jim index d6b03fc..dc36972 --- a/var/mongoose/html/index.shtml +++ b/var/mongoose/html/index.jim @@ -1,5 +1,10 @@ - +#!/mod/bin/jimsh +source /mod/webif/lib/setup + +header + +puts {
@@ -17,8 +22,11 @@ $(document).ready(function() { }); }); +} - +source /mod/webif/include/menuicons.jim + +puts {
+} - +footer diff --git a/var/mongoose/html/js/easing.js b/var/mongoose/html/js/easing.js deleted file mode 120000 index f42934e..0000000 --- a/var/mongoose/html/js/easing.js +++ /dev/null @@ -1 +0,0 @@ -../lib/jquery.plugin/easing/easing.js \ No newline at end of file diff --git a/var/mongoose/html/js/iajax.js b/var/mongoose/html/js/iajax.js deleted file mode 120000 index 21d9006..0000000 --- a/var/mongoose/html/js/iajax.js +++ /dev/null @@ -1 +0,0 @@ -../lib/jquery.plugin/iajax/iajax.js \ No newline at end of file diff --git a/var/mongoose/html/js/iphone-style-checkboxes.js b/var/mongoose/html/js/iphone-style-checkboxes.js deleted file mode 120000 index bef1b4a..0000000 --- a/var/mongoose/html/js/iphone-style-checkboxes.js +++ /dev/null @@ -1 +0,0 @@ -../lib/jquery.iphone-style-checkboxes/iphone-style-checkboxes.js \ No newline at end of file diff --git a/var/mongoose/html/js/jquery.ui.totop.js b/var/mongoose/html/js/jquery.ui.totop.js deleted file mode 120000 index e3150f2..0000000 --- a/var/mongoose/html/js/jquery.ui.totop.js +++ /dev/null @@ -1 +0,0 @@ -../lib/jquery.plugin/ui.totop/jquery.ui.totop.js \ No newline at end of file diff --git a/var/mongoose/html/lib/footer.shtml b/var/mongoose/html/lib/footer.shtml deleted file mode 100644 index 069265d..0000000 --- a/var/mongoose/html/lib/footer.shtml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/var/mongoose/html/lib/header.shtml b/var/mongoose/html/lib/header.shtml deleted file mode 100644 index b1ba462..0000000 --- a/var/mongoose/html/lib/header.shtml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/var/mongoose/html/sched/sched.jim b/var/mongoose/html/sched/sched.jim index 2a83e44..131ccc7 100755 --- a/var/mongoose/html/sched/sched.jim +++ b/var/mongoose/html/sched/sched.jim @@ -227,7 +227,7 @@ eventfooter puts {
- } diff --git a/var/mongoose/html/services.shtml b/var/mongoose/html/services/index.jim old mode 100644 new mode 100755 similarity index 63% rename from var/mongoose/html/services.shtml rename to var/mongoose/html/services/index.jim index dda9283..73c5940 --- a/var/mongoose/html/services.shtml +++ b/var/mongoose/html/services/index.jim @@ -1,7 +1,10 @@ - - - - +#!/mod/bin/jimsh + +source /mod/webif/lib/setup +jqplugin iphone-style-checkboxes enadis +header + +puts {