checkpoint - working on clipboard
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@587 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
09e71400a2
commit
822de81971
@ -315,15 +315,17 @@ puts {
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
|
||||
<script type=text/javascript src=/cgi-bin/browse/browse.js></script>
|
||||
<link type=text/css rel=stylesheet href=/cgi-bin/browse/style.css />
|
||||
}
|
||||
|
||||
puts "<span style=\"display:none\" id=dir>$dir</span>"
|
||||
|
||||
# Breadcrumb path
|
||||
puts "
|
||||
<fieldset style=\"margin: 1em\">
|
||||
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
|
||||
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
|
||||
"
|
||||
|
||||
# Breadcrumb path
|
||||
set stub ""
|
||||
foreach part [split $dir /] {
|
||||
if {$stub eq "/"} { set name $part } else { set name "/$part" }
|
||||
@ -406,6 +408,17 @@ puts "</div>"
|
||||
|
||||
puts "</fieldset>"
|
||||
|
||||
puts {
|
||||
<fieldset class=left style="margin: 0 1em 1em 1em">
|
||||
<legend style="font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em; color: #1e5bbd;">
|
||||
File Clipboard
|
||||
</legend>
|
||||
<div id=clipboard>
|
||||
<img src=/img/loading.gif> <i>Loading...</i>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
puts "<div class=brow>"
|
||||
|
||||
puts {
|
||||
|
@ -457,6 +457,9 @@ var dmenuclick = function(action, el, pos)
|
||||
$.getJSON('/cgi-bin/browse/newdir.jim?dir=' + encodeURIComponent(dir),
|
||||
new_folder_callback);
|
||||
|
||||
// Load clipboard
|
||||
$('#clipboard').load('/cgi-bin/browse/clipboard.jim');
|
||||
|
||||
// Uncheck everything
|
||||
$('input.fs:checked').attr('checked', false);
|
||||
|
||||
|
31
var/mongoose/cgi-bin/browse/clipboard.jim
Executable file
31
var/mongoose/cgi-bin/browse/clipboard.jim
Executable file
@ -0,0 +1,31 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require clipboard.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set cb [[clipboard new {path "/tmp/webif-browse.cb"}] load]
|
||||
|
||||
set action [cgi_get act list]
|
||||
|
||||
switch $action {
|
||||
list {
|
||||
if {![$cb size]} {
|
||||
puts "<i>Clipboard is empty</i>"
|
||||
exit
|
||||
}
|
||||
}
|
||||
add {
|
||||
}
|
||||
del {
|
||||
}
|
||||
clear {
|
||||
}
|
||||
}
|
||||
|
7
var/mongoose/cgi-bin/browse/style.css
Normal file
7
var/mongoose/cgi-bin/browse/style.css
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
div.brow
|
||||
{
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
@ -13,6 +13,10 @@ set databases {
|
||||
/var/lib/humaxtv/rsv.db
|
||||
/var/lib/humaxtv/setup.db
|
||||
/var/lib/humaxtv/channel.db
|
||||
/var/lib/humaxtv/default_channel.db
|
||||
/var/lib/humaxtv/default_setup.db
|
||||
/var/lib/humaxtv/rsv_fail.db
|
||||
/var/lib/humaxtv/tempsetup.db
|
||||
/mnt/hd2/dms_cds.db
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,19 @@ html>body
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.left, .cleft
|
||||
{
|
||||
float: left;
|
||||
}
|
||||
.cleft
|
||||
{
|
||||
clear: left;
|
||||
}
|
||||
fieldset.left, fieldset.cleft
|
||||
{
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.container
|
||||
{
|
||||
position: relative;
|
||||
|
BIN
var/mongoose/html/img/left.png
Normal file
BIN
var/mongoose/html/img/left.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
BIN
var/mongoose/html/img/right.png
Normal file
BIN
var/mongoose/html/img/right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
@ -111,6 +111,12 @@ $(document).ready(function() {
|
||||
<div class=footer>
|
||||
<ul>
|
||||
<li>
|
||||
Release Notes:
|
||||
<a target=_blank
|
||||
href="http://wiki.hummy.tv/wiki/Customised_Firmware_Release_Notes">
|
||||
Firmware</a> |
|
||||
<a target=_blank href="http://wiki.hummy.tv/wiki/Webif_release_notes">Webif</a>
|
||||
</li><li>
|
||||
<a href=/diag.shtml>Diagnostics</a>
|
||||
</li><li>
|
||||
<a href=/cgi-bin/channel.jim>Channel Information</a>
|
||||
|
@ -90,7 +90,7 @@ $(document).ready(function() {
|
||||
}
|
||||
$('a.schedule').click(function(e) { schedpopup(e, $(this)) });
|
||||
|
||||
$('table.tablesorter').hover(
|
||||
$('table.tablesorter tbody tr').hover(
|
||||
function() { $(this).addClass('hover'); },
|
||||
function() { $(this).removeClass('hover'); });
|
||||
});
|
||||
|
58
var/mongoose/lib/clipboard.class
Normal file
58
var/mongoose/lib/clipboard.class
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
if {![exists -proc class ]} { package require oo }
|
||||
|
||||
class clipboard {
|
||||
path "/tmp/webif.cb"
|
||||
items {}
|
||||
}
|
||||
|
||||
class clipboarditem {
|
||||
action ""
|
||||
type ""
|
||||
path ""
|
||||
}
|
||||
|
||||
clipboarditem method _parse {line} {
|
||||
lassign [split $line "|"] action type path
|
||||
}
|
||||
|
||||
proc {clipboarditem load} {line} {
|
||||
set c [clipboarditem new]
|
||||
$c _parse $line
|
||||
return $c
|
||||
}
|
||||
|
||||
clipboard method save {} {
|
||||
set fd [open $path w]
|
||||
foreach item $items {
|
||||
puts $fd "[$item get action]|[$item get type]|[$item get path]"
|
||||
}
|
||||
$fd close
|
||||
}
|
||||
|
||||
clipboard method load {} {
|
||||
set items {}
|
||||
set changed 0
|
||||
if {[file exists $path]} {
|
||||
set fd [open $path r]
|
||||
foreach line [split [$fd read] "\n"] {
|
||||
set ci [clipboarditem load $line]
|
||||
if {[file exists [$ci get path]]} {
|
||||
lappend $items $ci
|
||||
} else {
|
||||
set changed 1
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$changed} { $self save }
|
||||
return $self
|
||||
}
|
||||
|
||||
clipboard method size {} {
|
||||
return [llength $items]
|
||||
}
|
||||
|
||||
clipboard method add {action type path} {
|
||||
lappend $items [clipboarditem load "$action|$type|$path"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user