<NME> confirmation.js
<BEF> (function($) {
     var Confirm = function(element, options) {
         this.$element = $(element);
         this.options = $.extend({}, $.fn.confirm.defaults, options);
         this.$element.click($.proxy(this.show, this));
     };

     Confirm.prototype = {
         constructor: Confirm,

         show: function(e) {
             e.preventDefault();

             this.box = this.buildbox();
             this.box.modal();
             this.box.on('hidden.bs.modal', $.proxy(this.hidden_callback, this));
         },

         buildcheckboxes: function() {
             var result = "";

             if (!this.options.checkboxes || !Object.keys(this.options.checkboxes).length) {
                 return "";
             }
             result = '<form class="form-horizontal">';
             $.each(this.options.checkboxes, function(key, val) {
                 result += "<div class='form-group'><div class='col-xs-12'><div class='checkbox'><label><input type='checkbox' name='{0}' value='' />{1}</label></div></div></div>".format(key, val);
             });
             result += '</form>';
             return result;
         },

         buildbox: function() {
             var box = $('<div />', {
                 id: "confirmbox",
                 'class': "modal fade"
             });
             });

             box.append($('<div class="modal-body">'
                 + '<h4>' + this.options.question + '</h4>'
                 + '<p>' + this.buildcheckboxes() + '</p></div>'));

             var footer = $('<div class="modal-footer" />');
             var cancel_btn = $('<a href="#" class="btn">' + gettext("Cancel") + "</a>");
             }
             content += '<div class="modal-footer"><a href="#" class="btn btn-primary">Ok</a><a href="#" class="btn btn-default">{0}</a></div>'.format(gettext("Cancel"));

             box.append($(content));

             box.find(".btn-primary").click(function(evt) {
                 evt.preventDefault();
                 box.data('result', true);
                 box.modal('hide');
             });

             box.find(".btn-default").click(function(evt) {
                 evt.preventDefault();
                 box.modal('hide');
             });

             return box;
         },

         hidden_callback: function() {
             if (this.box.data('result') === undefined) {
                 return;
             }
             var params = "";

             $('input[type=checkbox]:checked').each(function() {
                 if (params !== "") {
                     params += "&";
                 }
                 params += $(this).attr("name") + "=true";
             });
             $.ajax({
                 cache: false,
                 type: this.options.method,
                 data: params,
                 url: this.$element.attr('href')
             }).done($.proxy(function(data) {
                 if (this.options.success_cb !== undefined) {
                     this.options.success_cb(data);
                     return;
                 }
                 window.location.reload();
             }, this));
             this.box.remove();
         }
     };

     $.fn.confirm = function(method) {
         return this.each(function() {
             var $this = $(this),
                 data = $this.data('confirm'),
                 options = typeof method === "object" && method;

             if (!data) {
                 $this.data('confirm', new Confirm(this, options));
             }
             if (typeof method === "string") {
                 data[method]();
             }
         });
     };

     $.fn.confirm.defaults = {
         question: "",
         method: "GET",
         warning: null,
         checkboxes: null
     };

})(jQuery);

     $.fn.confirm.defaults = {
         question: "",
         checkboxes: null
     };


<MSG> New option to automaticaly remove accounts with mailboxes.

Beware: activating this mode will make domain removal longer.

fix #364

<DFF> @@ -38,8 +38,20 @@
              });
 
              box.append($('<div class="modal-body">'
-                 + '<h4>' + this.options.question + '</h4>'
-                 + '<p>' + this.buildcheckboxes() + '</p></div>'));
+                 + '<h4>' + this.options.question + '</h4>'));
+             var $container = $("<div />", {"class" : "container-fluid"});
+             box.append($container);
+             if (this.options.warning) {
+                 $container.append($("<div />", {"class" : "row-fluid"})
+                     .append($("<div />", {
+                         "class": "alert alert-danger",
+                         html: "<h4>" + gettext("Warning") + "</h4>" + this.options.warning
+                     }))
+                 );
+             }
+
+             $container.append('<p>' + this.buildcheckboxes() + '</p>');
+             box.append("</div>");
 
              var footer = $('<div class="modal-footer" />');
              var cancel_btn = $('<a href="#" class="btn">' + gettext("Cancel") + "</a>");
@@ -117,6 +129,7 @@
 
      $.fn.confirm.defaults = {
          question: "",
+         warning: null,
          checkboxes: null
      };
 

New option to automaticaly remove accounts with mailboxes.