diff --git a/static/js/confirmation.js b/static/js/confirmation.js new file mode 100644 index 000000000..3cb183881 --- /dev/null +++ b/static/js/confirmation.js @@ -0,0 +1,115 @@ +(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', $.proxy(this.hidden_callback, this)); + }, + + buildcheckboxes: function() { + var result = ""; + + if (!this.options.checkboxes) { + return ""; + } + result = '
'; + return result; + }, + + buildbox: function() { + var box = $('', { + id: "confirmbox", + 'class': "modal" + }); + + box.append($('' + this.buildcheckboxes() + '