diff options
author | slyx <mail@slyx.org> | 2011-08-22 21:41:57 +0200 |
---|---|---|
committer | slyx <mail@slyx.org> | 2011-08-22 21:41:57 +0200 |
commit | 507d2802e6e195a82b05c240ceda6562c2803d4b (patch) | |
tree | 174cfb30b8dee49ea97df56ceb83566df74fd1a1 /module | |
parent | extended debug report (diff) | |
download | pyload-507d2802e6e195a82b05c240ceda6562c2803d4b.tar.xz |
added confirmation dialog before deleting a package
Diffstat (limited to 'module')
-rw-r--r-- | module/web/templates/default/package_ui.js | 17 | ||||
-rw-r--r-- | module/web/templates/default/queue.html | 8 |
2 files changed, 22 insertions, 3 deletions
diff --git a/module/web/templates/default/package_ui.js b/module/web/templates/default/package_ui.js index 1d0e25dd6..d2828a2f0 100644 --- a/module/web/templates/default/package_ui.js +++ b/module/web/templates/default/package_ui.js @@ -2,6 +2,7 @@ var load, pack_box; document.addEvent("domready", function() { load = new Fx.Tween($("load-indicator"), {link: "cancel"}); + confirmDeleteDialog = new Fx.Tween($("confirmDelete_box")); load.set("opacity", 0); pack_box = new Fx.Tween($('pack_box')); @@ -42,7 +43,7 @@ function show_pack() { function hide_pack() { bg_hide(); pack_box.start('opacity', 0).chain(function() { - $('pack_box').setStyle('display', 'none'); + $$('.window_box').setStyle('display', 'none'); }); } @@ -177,7 +178,7 @@ var Package = new Class({ this.folder = this.ele.getElements('.folder')[0]; this.password = this.ele.getElements('.password')[0]; - imgs[1].addEvent('click', this.deletePackage.bind(this)); + imgs[1].addEvent('click', this.confirmDeletePackage.bind(this)); imgs[2].addEvent('click', this.restartPackage.bind(this)); @@ -290,6 +291,14 @@ var Package = new Class({ } }, + confirmDeletePackage: function(event) { + bg_show(); + $('confirmDelete_box').setStyle('display', 'block'); + confirmDeleteDialog.start('opacity', 1) + + $('confirmDelete_button').addEvent('click', this.deletePackage.bind(this)); + }, + deletePackage: function(event) { indicateLoad(); new Request({ @@ -301,6 +310,7 @@ var Package = new Class({ }.bind(this), onFailure: indicateFail }).send(); + hide_pack(); event.stop(); }, @@ -383,4 +393,5 @@ var Package = new Class({ } } -});
\ No newline at end of file +}); + diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index e1535a12e..3077b5316 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -70,6 +70,14 @@ document.addEvent("domready", function(){ {% endfor %}
</ul>
+
+<div id="confirmDelete_box" class="window_box myform" style="z-index: 2; opacity: 0;">
+ <h1>{{_("Delete Package")}}</h1>
+ <p>{{_("Are you sure, that you want to delete this package?")}}</p>
+ <button id="confirmDelete_button">{{_("Delete Package")}}</button>
+ <button id="pack_reset" style="margin-left: 0" type="reset">{{_("Reset")}}</button>
+</div>
+
{% include "default/edit_package.html" %}
{% endblock %}
|