At first, I'm very oldschool and still using the lastest stable version 2.2f
I made a template that meets my creteria and everything works absolutely great!
I added:
onClick="window.open('/~progress');"
in the "Upload File" button section code:
<input name="upbtn" ... >
Now when the user hits the upload button, it also opens a new window with upload progress.
My question is: Can I use some "trigger" to close this window when the upload is complete?I've tried the following ways with javascript inserted in the beginning of [progress-upload-file] section:
1)
<script type="text/javascript">
if (%perc% > 98) {
window.close();
}
</script>
2)
<script type="text/javascript">
var param = (%total-bytes%-%done-bytes%)/1024-2.5*%speed-kb%;
if (param<0) {
window.close();
}
Both methods depend of the refresh rate setup in [progress] section and don't work stable.
Any hints will be heartily appreciated!
Template file
dwk.tpl attached to the post...