summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/web/templates/default/package_ui.js17
-rw-r--r--module/web/templates/default/queue.html8
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 %}