From 700306b3a8665c08484cf75906b0d36f4e367224 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Thu, 16 Jun 2011 23:49:48 +0000 Subject: [PATCH] implement delete action + menu item greying out and correct lock/unlock labels. Also add SMTP server settings git-svn-id: file:///root/webif/svn/humax/pkg/src/webif@180 2a923420-c742-0410-a762-8d5b09965624 --- var/mongoose/cgi-bin/browse.jim | 101 +++++++++++++-------- var/mongoose/cgi-bin/settings.jim | 21 ++++- var/mongoose/html/js/jquery.contextMenu.js | 19 +++- var/mongoose/lib/settings.class | 29 ++++++ var/mongoose/lib/ts.class | 6 ++ 5 files changed, 133 insertions(+), 43 deletions(-) diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim index db4e220..c6da53b 100755 --- a/var/mongoose/cgi-bin/browse.jim +++ b/var/mongoose/cgi-bin/browse.jim @@ -6,20 +6,20 @@ source /mod/var/mongoose/lib/ts.class puts "Content-Type: text/html" puts "" -set ignore {nts thm hmt hmi} -set standard {avi mpg wmv mkv} +set ignore {.nts .thm .hmt .hmi} +set standard {.avi .mpg .wmv .mkv} cgi_input #cgi_dump #set _cgi(tsfile) "/media/My Video/Family Guy/2.19._Excellence_in_Broadcasting.ts" -#set _cgi(action) "lock" +#set _cgi(action) "delete" #set env(REQUEST_URI) '' -proc tsfile {file bfile} {{i 0}} { +proc tsfile {file bfile {ajax 0}} {{i 0}} { set ts [ts fetch $file] + if {$ajax == 0} { puts "
" } puts " - " + if {$ajax == 0} { puts "
" } } proc genfile {file bfile} { @@ -66,7 +67,7 @@ proc directory {file bfile} { puts "$bfile" } -proc entry {file} { +proc entry {file {ajax 0}} { set bfile [lindex [split $file /] end] if {[string index $bfile 0] == "\025"} { set bfile [string range $bfile 1 end] @@ -75,9 +76,9 @@ proc entry {file} { directory $file $bfile continue } - regexp -- {\.([^.]+)$} "$file" allmatch ext - if {$ext eq "ts"} { - tsfile $file $bfile + set ext [file extension $file] + if {$ext eq ".ts"} { + tsfile $file $bfile $ajax continue } if {$ext in $::ignore} { continue } @@ -94,7 +95,7 @@ if {[dict exists $_cgi tsfile]} { if {[dict exists $_cgi action]} { switch [dict get $_cgi action] { entry { - entry $file + entry $file 1 } delete { if {[$ts delete]} { @@ -190,6 +191,48 @@ puts {
} diff --git a/var/mongoose/cgi-bin/settings.jim b/var/mongoose/cgi-bin/settings.jim index bfab299..4a148f6 100755 --- a/var/mongoose/cgi-bin/settings.jim +++ b/var/mongoose/cgi-bin/settings.jim @@ -12,10 +12,14 @@ cgi_input set settings [settings new] set hostname [$settings hostname] +set smtp_server [$settings smtp_server] set channel_group [$settings channel_group] # Handle updates +#set _cgi(smtp_server) "fred.bob" +#set env(REQUEST_URI) '' + proc _handle_update {class var old text} { global _cgi global settings @@ -43,6 +47,7 @@ proc handle_str_update {var old {text "Value"}} { } handle_str_update hostname $hostname Hostname +_handle_update ascii smtp_server $smtp_server "SMTP Server" handle_int_update channel_group $channel_group "Channel Group" source /mod/var/mongoose/html/lib/header.jim @@ -51,7 +56,8 @@ puts {} puts {