From 9e9ffd9c449bfbe9688751115eb386c11fc7c8df Mon Sep 17 00:00:00 2001 From: hummypkg Date: Thu, 5 Feb 2015 00:23:08 +0000 Subject: [PATCH] more code cleanups git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2299 2a923420-c742-0410-a762-8d5b09965624 --- webif/html/browse/aexpiry.jim | 4 ++-- webif/html/browse/iconset.jim | 2 +- webif/html/browse/index.jim | 8 ++++---- webif/html/m/browse.jim | 6 +++--- webif/html/settings/modules/network/script.js | 6 ++++++ webif/html/settings/modules/network/settings.hook | 15 ++++++++++++--- webif/lib/browse.class | 6 +++--- webif/lib/epg.class | 2 +- webif/lib/system.class | 3 ++- 9 files changed, 34 insertions(+), 18 deletions(-) diff --git a/webif/html/browse/aexpiry.jim b/webif/html/browse/aexpiry.jim index 3c1de77..a27c4bb 100755 --- a/webif/html/browse/aexpiry.jim +++ b/webif/html/browse/aexpiry.jim @@ -14,7 +14,7 @@ set act [cgi_get act "update"] if {$act eq "fetch"} { httpheader "application/json" - set data [{dir expiry} $dir] + set data [dir expiry $dir] puts "{" puts " \"days\": \"$data(days)\"," puts " \"keep\": \"$data(keep)\"," @@ -44,6 +44,6 @@ if {![file isdirectory $dir]} { exit } -{dir expiry} $dir $data +dir expiry $dir $data puts "Ok." diff --git a/webif/html/browse/iconset.jim b/webif/html/browse/iconset.jim index cbf79ed..852088c 100755 --- a/webif/html/browse/iconset.jim +++ b/webif/html/browse/iconset.jim @@ -9,6 +9,6 @@ httpheader set file [cgi_get file] if {[file isdirectory $file]} { - lassign [{dir iconset} $file] icons #attrs + lassign [dir iconset $file] icons #attrs puts [join $icons ""] } diff --git a/webif/html/browse/index.jim b/webif/html/browse/index.jim index 1086cee..5bcd935 100755 --- a/webif/html/browse/index.jim +++ b/webif/html/browse/index.jim @@ -62,7 +62,7 @@ proc directory {file bfile tbfile} { puts "$bfile " - lassign [{dir iconset} $file] icons attrs + lassign [dir iconset $file] icons attrs puts "" puts [join $icons ""] @@ -100,7 +100,7 @@ proc entry {file} {{i 0}} { if {[string index $bfile 0] == "\025"} { set bfile [string range $bfile 1 end] } - if [file isdirectory "$file"] { + if {[file isdirectory "$file"]} { incr dircount directory $file $bfile $tbfile return @@ -125,7 +125,7 @@ proc entry {file} {{i 0}} { set omenu opt if {[file exists "${base}.thm"]} { set thmok 1 } } elseif {$ext eq ".hmt"} { - if {[file exists "${base}.ts"]} { continue } + if {[file exists "${base}.ts"]} { return } # Sole hmt file indicates failure to track. set type bad set ts 0 @@ -387,7 +387,7 @@ puts { } # Join -if $nicesplice { +if {$nicesplice} { puts { } } diff --git a/webif/html/m/browse.jim b/webif/html/m/browse.jim index 4b06a12..f30065f 100755 --- a/webif/html/m/browse.jim +++ b/webif/html/m/browse.jim @@ -25,7 +25,7 @@ proc icon {img {hover ""} {extra ""} {class "va"}} { proc directory {file bfile tbfile {img /images/711_1_09_Media_Folder.png}} { if {$bfile eq $::dustbin} { set img "/img/Dustbin_Folder.png" } - lassign [{dir iconset} $file] icons attrs + lassign [dir iconset $file] icons attrs puts "
  • @@ -47,7 +47,7 @@ proc entry {file {i 0}} { if {[string index $bfile 0] == "\025"} { set bfile [string range $bfile 1 end] } - if [file isdirectory "$file"] { + if {[file isdirectory "$file"]} { directory $file $bfile $tbfile return } @@ -65,7 +65,7 @@ proc entry {file {i 0}} { set img Video_TS set omenu opt } elseif {$ext eq ".hmt"} { - if {[file exists "${base}.ts"]} { continue } + if {[file exists "${base}.ts"]} { return } # Sole hmt file indicates failure to track. set type bad set ts 0 diff --git a/webif/html/settings/modules/network/script.js b/webif/html/settings/modules/network/script.js index 0a606d7..3409c19 100644 --- a/webif/html/settings/modules/network/script.js +++ b/webif/html/settings/modules/network/script.js @@ -97,3 +97,9 @@ $('#ns_wifi_authmode').on('change', function() { }).trigger('change'); +$('#_ns_wifi_reveal').on('click', function(e) { + e.preventDefault(); + $('#_ns_wifi_notfound').slideUp('slow'); + $('#_ns_wifi_settings').slideDown('slow'); +}); + diff --git a/webif/html/settings/modules/network/settings.hook b/webif/html/settings/modules/network/settings.hook index bd71bab..fcb4a29 100755 --- a/webif/html/settings/modules/network/settings.hook +++ b/webif/html/settings/modules/network/settings.hook @@ -158,9 +158,18 @@ puts " if {[system has wifi_dongle]} { puts [_ns_iftable wifi 2ND] } else { - puts "No wireless dongle detected." - puts "
    " - puts "" + puts " + No wireless dongle detected. +
    + + + + +
    + + " } puts " diff --git a/webif/lib/browse.class b/webif/lib/browse.class index 708b902..9c664d4 100644 --- a/webif/lib/browse.class +++ b/webif/lib/browse.class @@ -1,8 +1,8 @@ require system.class plugin -#if {![exists -proc class]} { package require oo } -#class browse {} +if {![exists -proc class]} { package require oo } +class dir {} set _flatten [system pkginst flatten] @@ -20,7 +20,7 @@ proc {dir expiry} {dir {data {}}} { set fd [open "$dir/.autoexpire" w] puts $fd "$data(days):$data(type):$data(keep):$data(keepnew):" $fd close - return + return {} } set ret { days "" type 0 keep "" keepnew 0 } catch { diff --git a/webif/lib/epg.class b/webif/lib/epg.class index 600aaf3..6c2d93e 100644 --- a/webif/lib/epg.class +++ b/webif/lib/epg.class @@ -455,7 +455,7 @@ proc {epg dbfetch} {mode args} { set query "$select $from $q $sort" - if ($debug) { + if {$debug} { puts "QUERY -$query-" puts "PARAMS -$params-" } diff --git a/webif/lib/system.class b/webif/lib/system.class index d6ac9d3..05b326e 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -166,6 +166,7 @@ proc {system diskpart} {} { HDR { return "/mnt/hd2" } HD { return "/media/drive1" } } + return "" } proc {system diskdev} {} { @@ -373,7 +374,7 @@ proc {system filename} {str {extra ""}} { # Humax TV replaces these characters. # "%*./:<>?\| set chars "\"%*\./:<>?\\\\|$extra" - return [regsub -all "\[$chars]" $str "_"] + return [regsub -all -- "\[$chars]" $str "_"] } proc {system connectivity} {{site "hpkg.tv"} {port 80} {ret "0"}} {