diff --git a/CONTROL/control b/CONTROL/control index 760c606..9f948b5 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.15-3 +Version: 1.0.15-4 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.11),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),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),mongoose diff --git a/webif/cgi-bin/opkg.jim b/webif/cgi-bin/opkg.jim index e3fafec..d889a0e 100755 --- a/webif/cgi-bin/opkg.jim +++ b/webif/cgi-bin/opkg.jim @@ -10,14 +10,14 @@ cgi_input set cmd [cgi_get cmd update] proc opkg {cmd} { - puts ">>> opkg $cmd\r\n" + puts ">>> opkg $cmd" set bcmd "|/mod/webif/lib/bin/opkg $cmd" set fd [open $bcmd r] while {[gets $fd line] >= 0} { - puts "$line\r\n" + puts "$line" } close $fd - puts "\r\n" + puts "" } httpheader "text/plain" @@ -26,11 +26,12 @@ if {$cmd eq "upgrade"} { opkg update } opkg $cmd if {$cmd eq "update" || $cmd eq "upgrade"} { - puts "Updating package meta information\r\n" + puts "Updating package meta information" pkg fetchmeta - puts "Done.\r\n" - puts "Updating diagnostic meta information\r\n" + puts "Done." + puts "" + puts "Updating diagnostic meta information" pkg fetchdiagmeta - puts "Done.\r\n" + puts "Done." } diff --git a/webif/html/dedup/process.jim b/webif/html/dedup/process.jim index 87a6b4b..cf91bb1 100755 --- a/webif/html/dedup/process.jim +++ b/webif/html/dedup/process.jim @@ -17,8 +17,7 @@ proc dedupprocess {file} {{seen {}}} { set base [file tail [file rootname $file]] set syn [dedupnormalise [$ts get synopsis] [$ts get title]] # Escape special characters to create the filename. - regsub -all -- {[\/ &]} $syn "_" fn - regsub -all -- {[?]} $fn "" fn + set fn [system filename $syn] set stat ok if {[$ts inuse]} { diff --git a/webif/html/diag/diag.jim b/webif/html/diag/diag.jim index 0687670..a58686e 100755 --- a/webif/html/diag/diag.jim +++ b/webif/html/diag/diag.jim @@ -25,8 +25,10 @@ puts { -- Select diag or type name in box below -- } -foreach diag [array names ::diagmeta] { - puts "$diag\n" +catch { + foreach diag [array names ::diagmeta] { + puts "$diag\n" + } } puts { diff --git a/webif/html/edit/edit.jim b/webif/html/edit/edit.jim index bbd4530..4c3ca9f 100755 --- a/webif/html/edit/edit.jim +++ b/webif/html/edit/edit.jim @@ -8,7 +8,12 @@ jqplugin enadis tabsupport filetree jscss script.js style.css header -set file [cgi_get file "/tmp/hosts"] +set file [cgi_get file -] +set backdesc [cgi_get backdesc "Back to diagnostics"] +set backlink [cgi_get backlink "/diag/diag.jim"] +if {$file ne "-"} { + puts "" +} puts { @@ -33,10 +38,12 @@ class="ui-widget ui-corner-all"> - Back to diagnostics +} +puts "$backdesc" +puts { - + Commonly edited files diff --git a/webif/html/edit/script.js b/webif/html/edit/script.js index 14a1a84..5e03f2e 100644 --- a/webif/html/edit/script.js +++ b/webif/html/edit/script.js @@ -1,4 +1,6 @@ +var forcefile = false; + $(function() { var file = null; @@ -100,8 +102,8 @@ $('#revert').click(function() { }); $('#back').click(function() { - window.location = '/diag/diag.jim'; - }); + window.location = $(this).attr('dst'); +}); function createf_submit() { @@ -148,4 +150,10 @@ $('a.qfile').on('click', function() { loadfile($(this).text()); }); +if (forcefile) +{ + loadfile(forcefile); + $('#open,#create,#qedit').remove(); +} + }); diff --git a/webif/html/pkg/script.js b/webif/html/pkg/script.js index 4f3da38..c9a6287 100644 --- a/webif/html/pkg/script.js +++ b/webif/html/pkg/script.js @@ -6,6 +6,11 @@ $(document).ready(function() { var tswitch = false; var stick = true; + // Retrieve the stored selected tab from the hash portion of the URL. + var curtab = ~~(window.location.hash.slice(1)); + if (curtab < 0 || curtab > 2) + curtab = 0; + $('#opkgupdate') .button() .click(function() { tswitch = 2; execopkg('update'); }) @@ -17,6 +22,7 @@ $(document).ready(function() { .fadeIn('slow'); $('#pkgtabs').tabs({ + active: curtab, create: function(event, ui) { $(ui.panel).html("" + "Loading data... Please wait..."); @@ -24,6 +30,7 @@ $(document).ready(function() { $('#pkgtabs').tabs('disable'); }, activate: function(event, ui) { + window.location.hash = ui.newTab.index(); if (busy) { alert('Please wait until the current ' +