forked from hummypkg/webif
fix crop progress?
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@505 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
258c3b76af
commit
20b2a7e2dc
@ -108,7 +108,9 @@ puts {
|
||||
<div id=progressdiv style="display: none">
|
||||
Cropping: <div id=progressbar></div>
|
||||
}
|
||||
puts "<button id=back dir=\"[cgi_quote_url $dir]\"
|
||||
puts "<button id=back
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
rfile=\"[cgi_quote_url $rfile]\"
|
||||
style=\"display: none\">Back to media list</button>"
|
||||
puts {
|
||||
<div id=output class=pre style="margin-top: 10px"></div>
|
||||
@ -117,16 +119,14 @@ puts {
|
||||
<script type=text/javascript>
|
||||
|
||||
var handle = 0;
|
||||
var pct = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
$('#progressbar').reportprogress(++pct);
|
||||
if (pct == 100)
|
||||
{
|
||||
clearInterval(handle);
|
||||
pct = 0;
|
||||
}
|
||||
$.get('/cgi-bin/browse/crop_progress.jim?file='
|
||||
+ $('#back').attr('rfile'), function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
@ -142,10 +142,10 @@ $('#cropit').button().click(function() {
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 100);
|
||||
$('#output').load(document.URL + '&do=it', function() {
|
||||
$('#progressbar').reportprogress(100);
|
||||
clearInterval(handle);
|
||||
pct = 0;
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
});
|
||||
});
|
||||
|
||||
|
24
var/mongoose/cgi-bin/browse/crop_progress.jim
Executable file
24
var/mongoose/cgi-bin/browse/crop_progress.jim
Executable file
@ -0,0 +1,24 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set tsfile [cgi_get file]
|
||||
set rfile [file normalize $tsfile]
|
||||
set nfile [file rootname $rfile]
|
||||
|
||||
if {![file exists "$rfile.decrypting"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [file size $nfile]
|
||||
|
||||
puts [expr $nsz * 100 / $sz]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user