forked from hummypkg/webif
more code cleanups
git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2299 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
157c1c3979
commit
9e9ffd9c44
@ -14,7 +14,7 @@ set act [cgi_get act "update"]
|
|||||||
|
|
||||||
if {$act eq "fetch"} {
|
if {$act eq "fetch"} {
|
||||||
httpheader "application/json"
|
httpheader "application/json"
|
||||||
set data [{dir expiry} $dir]
|
set data [dir expiry $dir]
|
||||||
puts "{"
|
puts "{"
|
||||||
puts " \"days\": \"$data(days)\","
|
puts " \"days\": \"$data(days)\","
|
||||||
puts " \"keep\": \"$data(keep)\","
|
puts " \"keep\": \"$data(keep)\","
|
||||||
@ -44,6 +44,6 @@ if {![file isdirectory $dir]} {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
{dir expiry} $dir $data
|
dir expiry $dir $data
|
||||||
puts "Ok."
|
puts "Ok."
|
||||||
|
|
||||||
|
@ -9,6 +9,6 @@ httpheader
|
|||||||
set file [cgi_get file]
|
set file [cgi_get file]
|
||||||
|
|
||||||
if {[file isdirectory $file]} {
|
if {[file isdirectory $file]} {
|
||||||
lassign [{dir iconset} $file] icons #attrs
|
lassign [dir iconset $file] icons #attrs
|
||||||
puts [join $icons ""]
|
puts [join $icons ""]
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ proc directory {file bfile tbfile} {
|
|||||||
puts "$bfile</a><span class=filesize id=\"$tbfile\">
|
puts "$bfile</a><span class=filesize id=\"$tbfile\">
|
||||||
</span>"
|
</span>"
|
||||||
|
|
||||||
lassign [{dir iconset} $file] icons attrs
|
lassign [dir iconset $file] icons attrs
|
||||||
|
|
||||||
puts "<span class=iconset>"
|
puts "<span class=iconset>"
|
||||||
puts [join $icons ""]
|
puts [join $icons ""]
|
||||||
@ -100,7 +100,7 @@ proc entry {file} {{i 0}} {
|
|||||||
if {[string index $bfile 0] == "\025"} {
|
if {[string index $bfile 0] == "\025"} {
|
||||||
set bfile [string range $bfile 1 end]
|
set bfile [string range $bfile 1 end]
|
||||||
}
|
}
|
||||||
if [file isdirectory "$file"] {
|
if {[file isdirectory "$file"]} {
|
||||||
incr dircount
|
incr dircount
|
||||||
directory $file $bfile $tbfile
|
directory $file $bfile $tbfile
|
||||||
return
|
return
|
||||||
@ -125,7 +125,7 @@ proc entry {file} {{i 0}} {
|
|||||||
set omenu opt
|
set omenu opt
|
||||||
if {[file exists "${base}.thm"]} { set thmok 1 }
|
if {[file exists "${base}.thm"]} { set thmok 1 }
|
||||||
} elseif {$ext eq ".hmt"} {
|
} elseif {$ext eq ".hmt"} {
|
||||||
if {[file exists "${base}.ts"]} { continue }
|
if {[file exists "${base}.ts"]} { return }
|
||||||
# Sole hmt file indicates failure to track.
|
# Sole hmt file indicates failure to track.
|
||||||
set type bad
|
set type bad
|
||||||
set ts 0
|
set ts 0
|
||||||
@ -387,7 +387,7 @@ puts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Join
|
# Join
|
||||||
if $nicesplice {
|
if {$nicesplice} {
|
||||||
puts { <button id=join>Join</button> }
|
puts { <button id=join>Join</button> }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ proc icon {img {hover ""} {extra ""} {class "va"}} {
|
|||||||
|
|
||||||
proc directory {file bfile tbfile {img /images/711_1_09_Media_Folder.png}} {
|
proc directory {file bfile tbfile {img /images/711_1_09_Media_Folder.png}} {
|
||||||
if {$bfile eq $::dustbin} { set img "/img/Dustbin_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]\"
|
puts "<li><a href=\"browse.jim?dir=[cgi_quote_url $file]\"
|
||||||
data-transition=flip>
|
data-transition=flip>
|
||||||
<img src=$img border=0 class=va width=80 id=\"img$tbfile\">
|
<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"} {
|
if {[string index $bfile 0] == "\025"} {
|
||||||
set bfile [string range $bfile 1 end]
|
set bfile [string range $bfile 1 end]
|
||||||
}
|
}
|
||||||
if [file isdirectory "$file"] {
|
if {[file isdirectory "$file"]} {
|
||||||
directory $file $bfile $tbfile
|
directory $file $bfile $tbfile
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ proc entry {file {i 0}} {
|
|||||||
set img Video_TS
|
set img Video_TS
|
||||||
set omenu opt
|
set omenu opt
|
||||||
} elseif {$ext eq ".hmt"} {
|
} elseif {$ext eq ".hmt"} {
|
||||||
if {[file exists "${base}.ts"]} { continue }
|
if {[file exists "${base}.ts"]} { return }
|
||||||
# Sole hmt file indicates failure to track.
|
# Sole hmt file indicates failure to track.
|
||||||
set type bad
|
set type bad
|
||||||
set ts 0
|
set ts 0
|
||||||
|
@ -97,3 +97,9 @@ $('#ns_wifi_authmode').on('change', function() {
|
|||||||
|
|
||||||
}).trigger('change');
|
}).trigger('change');
|
||||||
|
|
||||||
|
$('#_ns_wifi_reveal').on('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$('#_ns_wifi_notfound').slideUp('slow');
|
||||||
|
$('#_ns_wifi_settings').slideDown('slow');
|
||||||
|
});
|
||||||
|
|
||||||
|
@ -158,9 +158,18 @@ puts "
|
|||||||
if {[system has wifi_dongle]} {
|
if {[system has wifi_dongle]} {
|
||||||
puts [_ns_iftable wifi 2ND]
|
puts [_ns_iftable wifi 2ND]
|
||||||
} else {
|
} else {
|
||||||
puts "<i>No wireless dongle detected.</i>"
|
puts "
|
||||||
puts "<br>"
|
<span class=blood>No wireless dongle detected.</span>
|
||||||
puts "<img src=/images/217_1_08_WIZ_WiFi.png>"
|
<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 "
|
puts "
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
require system.class plugin
|
require system.class plugin
|
||||||
|
|
||||||
#if {![exists -proc class]} { package require oo }
|
if {![exists -proc class]} { package require oo }
|
||||||
#class browse {}
|
class dir {}
|
||||||
|
|
||||||
set _flatten [system pkginst flatten]
|
set _flatten [system pkginst flatten]
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ proc {dir expiry} {dir {data {}}} {
|
|||||||
set fd [open "$dir/.autoexpire" w]
|
set fd [open "$dir/.autoexpire" w]
|
||||||
puts $fd "$data(days):$data(type):$data(keep):$data(keepnew):"
|
puts $fd "$data(days):$data(type):$data(keep):$data(keepnew):"
|
||||||
$fd close
|
$fd close
|
||||||
return
|
return {}
|
||||||
}
|
}
|
||||||
set ret { days "" type 0 keep "" keepnew 0 }
|
set ret { days "" type 0 keep "" keepnew 0 }
|
||||||
catch {
|
catch {
|
||||||
|
@ -455,7 +455,7 @@ proc {epg dbfetch} {mode args} {
|
|||||||
|
|
||||||
set query "$select $from $q $sort"
|
set query "$select $from $q $sort"
|
||||||
|
|
||||||
if ($debug) {
|
if {$debug} {
|
||||||
puts "QUERY -$query-"
|
puts "QUERY -$query-"
|
||||||
puts "PARAMS -$params-"
|
puts "PARAMS -$params-"
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,7 @@ proc {system diskpart} {} {
|
|||||||
HDR { return "/mnt/hd2" }
|
HDR { return "/mnt/hd2" }
|
||||||
HD { return "/media/drive1" }
|
HD { return "/media/drive1" }
|
||||||
}
|
}
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
proc {system diskdev} {} {
|
proc {system diskdev} {} {
|
||||||
@ -373,7 +374,7 @@ proc {system filename} {str {extra ""}} {
|
|||||||
# Humax TV replaces these characters.
|
# Humax TV replaces these characters.
|
||||||
# "%*./:<>?\|
|
# "%*./:<>?\|
|
||||||
set chars "\"%*\./:<>?\\\\|$extra"
|
set chars "\"%*\./:<>?\\\\|$extra"
|
||||||
return [regsub -all "\[$chars]" $str "_"]
|
return [regsub -all -- "\[$chars]" $str "_"]
|
||||||
}
|
}
|
||||||
|
|
||||||
proc {system connectivity} {{site "hpkg.tv"} {port 80} {ret "0"}} {
|
proc {system connectivity} {{site "hpkg.tv"} {port 80} {ret "0"}} {
|
||||||
|
Loading…
Reference in New Issue
Block a user