ajax-demo:file-upload auto-close

This commit is contained in:
Martijn Voncken 2008-07-18 17:44:26 +00:00
parent a218f0e6a2
commit 7faed7ec1c
2 changed files with 22 additions and 1 deletions

View File

@ -428,3 +428,17 @@ class pixmaps:
web.header("Cache-Control" , "public, must-revalidate, max-age=86400") web.header("Cache-Control" , "public, must-revalidate, max-age=86400")
print content print content
route("/pixmaps/(.*)", pixmaps) route("/pixmaps/(.*)", pixmaps)
class close:
"close open window"
@deco.deluge_page
def GET(self, name):
return """
<script language="javascript">
window.close();
</script>
"""
route("/close", close)

View File

@ -104,9 +104,16 @@ function update_ui() {
<button onclick="update_ui()">update_ui() filter on "Seeding"</button> <button onclick="update_ui()">update_ui() filter on "Seeding"</button>
<div id="torrent_list"> <div id="torrent_list">
<h1>add+auto-close</h1>
<button onclick="
window.open('$base/torrent/add','add_torrent','height=200,width=800,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes'); return false;"
>Add torrent</button>
</div> </div>
$:render.footer() $:render.footer()