replace glob with readdir in some cases. Move paste button to clipboard
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@711 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
a3ecbe1d3f
commit
fa9905d8bd
@ -249,12 +249,6 @@ if {$parent ne ""} {
|
|||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Strip double slashes
|
|
||||||
regsub -all -- {\/+} "$dir/*" "/" dir
|
|
||||||
|
|
||||||
# Escape square brackets (for glob)
|
|
||||||
regsub -all {([\\[])} $dir {\\\1} dir
|
|
||||||
|
|
||||||
proc s_time {a b} {
|
proc s_time {a b} {
|
||||||
set ad [file isdirectory $a]
|
set ad [file isdirectory $a]
|
||||||
set bd [file isdirectory $b]
|
set bd [file isdirectory $b]
|
||||||
@ -277,13 +271,13 @@ proc s_time {a b} {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
set files [glob -nocomplain $dir]
|
set files [readdir -nocomplain $dir]
|
||||||
switch $order {
|
switch $order {
|
||||||
1 { set files [lsort -command s_time $files] }
|
1 { set files [lsort -command s_time $files] }
|
||||||
default { set files [lsort $files] }
|
default { set files [lsort $files] }
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach file $files { entry $file }
|
foreach file $files { entry "$dir/$file" }
|
||||||
|
|
||||||
puts "<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>"
|
puts "<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>"
|
||||||
|
|
||||||
@ -326,7 +320,6 @@ puts "<div class=brow>"
|
|||||||
puts {
|
puts {
|
||||||
<button id=copy>Copy</button>
|
<button id=copy>Copy</button>
|
||||||
<button id=cut>Cut</button>
|
<button id=cut>Cut</button>
|
||||||
<button id=paste>Paste</button>
|
|
||||||
<button id=delete>Delete</button>
|
<button id=delete>Delete</button>
|
||||||
<button id=newdir>New Folder</button>
|
<button id=newdir>New Folder</button>
|
||||||
<div id=deletewait class=blood style="display: none">
|
<div id=deletewait class=blood style="display: none">
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
};
|
};
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
|
var dir;
|
||||||
|
|
||||||
function disableall()
|
function disableall()
|
||||||
{
|
{
|
||||||
$('button,a,input').disable();
|
$('button,a,input').disable();
|
||||||
@ -51,6 +53,29 @@ $('a.clipdel').click(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#paste').button()
|
||||||
|
.click(function() {
|
||||||
|
disableall();
|
||||||
|
$('#pwdialogue').dialog({
|
||||||
|
title: "Pasting from clipboard",
|
||||||
|
modal: true, autoOpen: true,
|
||||||
|
height: 'auto', width: 'auto',
|
||||||
|
show: 'scale', hide: 'fade',
|
||||||
|
draggable: false, resizable: false,
|
||||||
|
closeOnEscape: false,
|
||||||
|
open: function() {
|
||||||
|
$('.ui-dialog-titlebar-close').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#pwfeedback').load(
|
||||||
|
'/cgi-bin/browse/clipboard.jim?act=paste&dir='
|
||||||
|
+ encodeURIComponent(dir), function() {
|
||||||
|
$('#pwdialogue').dialog('close');
|
||||||
|
window.location.reload(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// End Clipboard post-load actions
|
// End Clipboard post-load actions
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -269,7 +294,7 @@ function preparedmenu(el, menu)
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
var dir = $('#dir').text();
|
dir = $('#dir').text();
|
||||||
|
|
||||||
var menuclick = function(action, el, pos)
|
var menuclick = function(action, el, pos)
|
||||||
{
|
{
|
||||||
@ -647,28 +672,6 @@ var dmenuclick = function(action, el, pos)
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#paste').button().disable()
|
|
||||||
.click(function() {
|
|
||||||
disableall();
|
|
||||||
$('#pwdialogue').dialog({
|
|
||||||
title: "Pasting from clipboard",
|
|
||||||
modal: true, autoOpen: true,
|
|
||||||
height: 'auto', width: 'auto',
|
|
||||||
show: 'scale', hide: 'fade',
|
|
||||||
draggable: false, resizable: false,
|
|
||||||
closeOnEscape: false,
|
|
||||||
open: function() {
|
|
||||||
$('.ui-dialog-titlebar-close').hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#pwfeedback').load(
|
|
||||||
'/cgi-bin/browse/clipboard.jim?act=paste&dir='
|
|
||||||
+ encodeURIComponent(dir), function() {
|
|
||||||
$('#pwdialogue').dialog('close');
|
|
||||||
window.location.reload(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#newdir').button().click(function() {
|
$('#newdir').button().click(function() {
|
||||||
$('#newdirform').dialog({
|
$('#newdirform').dialog({
|
||||||
autoOpen: true,
|
autoOpen: true,
|
||||||
|
@ -47,6 +47,7 @@ switch $action {
|
|||||||
puts "</span>"
|
puts "</span>"
|
||||||
}
|
}
|
||||||
puts "</div>"
|
puts "</div>"
|
||||||
|
puts "<button id=paste>Paste to current folder</button>"
|
||||||
puts "<button id=clipclear>Empty clipboard</button>"
|
puts "<button id=clipclear>Empty clipboard</button>"
|
||||||
}
|
}
|
||||||
add {
|
add {
|
||||||
|
@ -13,8 +13,6 @@ cgi_input
|
|||||||
set dir [cgi_get dir "/media/My Video"]
|
set dir [cgi_get dir "/media/My Video"]
|
||||||
set doit [cgi_get doit 0]
|
set doit [cgi_get doit 0]
|
||||||
|
|
||||||
# Strip double slashes
|
|
||||||
|
|
||||||
header
|
header
|
||||||
|
|
||||||
puts "<fieldset style=\"display: inline\">
|
puts "<fieldset style=\"display: inline\">
|
||||||
@ -28,11 +26,10 @@ puts "<fieldset style=\"display: inline\">
|
|||||||
</tr>
|
</tr>
|
||||||
"
|
"
|
||||||
|
|
||||||
regsub -all -- {\/+} "$dir/*" "/" sdir
|
|
||||||
|
|
||||||
set seen {}
|
set seen {}
|
||||||
|
|
||||||
foreach file [lsort [glob -nocomplain "$sdir"]] {
|
foreach file [readdir $dir] {
|
||||||
|
set file "$dir/$file"
|
||||||
if {[file extension $file] ne ".hmt"} { continue }
|
if {[file extension $file] ne ".hmt"} { continue }
|
||||||
altrow
|
altrow
|
||||||
set ts [ts fetch $file 1]
|
set ts [ts fetch $file 1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user