more code cleanups

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2299 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2015-02-05 00:23:08 +00:00
parent 157c1c3979
commit 9e9ffd9c44
9 changed files with 34 additions and 18 deletions

View File

@ -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."

View File

@ -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 ""]
}

View File

@ -62,7 +62,7 @@ proc directory {file bfile tbfile} {
puts "$bfile</a><span class=filesize id=\"$tbfile\">
</span>"
lassign [{dir iconset} $file] icons attrs
lassign [dir iconset $file] icons attrs
puts "<span class=iconset>"
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 { <button id=join>Join</button> }
}

View File

@ -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 "<li><a href=\"browse.jim?dir=[cgi_quote_url $file]\"
data-transition=flip>
<img src=$img border=0 class=va width=80 id=\"img$tbfile\">
@ -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

View File

@ -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');
});

View File

@ -158,9 +158,18 @@ puts "
if {[system has wifi_dongle]} {
puts [_ns_iftable wifi 2ND]
} else {
puts "<i>No wireless dongle detected.</i>"
puts "<br>"
puts "<img src=/images/217_1_08_WIZ_WiFi.png>"
puts "
<span class=blood>No wireless dongle detected.</span>
<div id=_ns_wifi_notfound>
<img src=/images/217_1_08_WIZ_WiFi.png>
<small>
<button id=_ns_wifi_reveal>Show Settings</button>
</small>
</div>
<div id=_ns_wifi_settings class=hidden>
[_ns_iftable wifi 2ND]
</div>
"
}
puts "

View File

@ -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 {

View File

@ -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-"
}

View File

@ -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"}} {