(function(){var a;a=this.jQuery;a.fn.extend({confirmWithReveal:function(b){var f,e,d,c;if(b==null){b={}}f={modal_class:“medium”,title:“Are you sure?”,title_class:“”,body:“This action cannot be undone.”,body_class:“”,password:false,prompt:“Type <strong>%s</strong> to continue:”,footer_class:“”,ok:“Confirm”,ok_class:“button alert”,cancel:“Cancel”,cancel_class:“button secondary”};c=a.extend({},f,b);e=function(o){var g,k,i,h,m,l,n,j;h=o.data(“confirm”);if(o.attr(“data-confirm”)==null){return true}if((typeof h===“string”)&&(h.length>0)){return(((j=a.rails)!=null?j.confirm:void 0)||window.confirm).call(window,h)}l=function(p){return h||c};m=a(“<div data-reveal class='reveal-modal ”+(l(“modal_class”))+“'>n <h2 data-confirm-title class='”+(l(“title_class”))+“'></h2>n <p data-confirm-body class='”+(l(“body_class”))+“'></p>n <div data-confirm-footer class='”+(l(“footer_class”))+“'>n <a data-confirm-cancel class='”+(l(“cancel_class”))+“'></a>n </div>n</div>”);g=o.is(“a”)?o.clone():a(“<a/>”);g.removeAttr(“data-confirm”).attr(“class”,l(“ok_class”)).html(l(“ok”)).on(“click”,function(p){if(a(this).prop(“disabled”)){return false}o.trigger(“confirm.reveal”,p);if(o.is(“form, :input”)){return o.closest(“form”).removeAttr(“data-confirm”).submit()}});m.find(“”).html(l(“title”));m.find(“”).html(l(“body”));m.find(“”).html(l(“cancel”)).on(“click”,function(p){m.foundation(“reveal”,“close”);return o.trigger(“cancel.reveal”,p)});m.find(“”).append(g);if((n=l(“password”))){i=(l(“prompt”)).replace(“%s”,n);k=“<label>n ”i“n <input data-confirm-password type=‘text’/>n”;m.find(“”).after(a(k));m.find(“”).on(“keyup”,function(q){var p;p=a(this).val()!==n;return g.toggleClass(“disabled”,p).prop(“disabled”,p)}).trigger(“keyup”)}m.appendTo(a(“body”)).foundation().foundation(“reveal”,“open”).on(“closed.fndtn.reveal”,function(p){return m.remove()});return false};if(a.rails){a.rails.allowAction=function(g){return e(a(g))};return a(this)}else{d=function(g){if(!(e(a(this)))){g.preventDefault();return g.stopImmediatePropagation()}};return this.each(function(){var g;g=a(this);g.on(“click”,“a, :input”,d);g.on(“submit”,“form”,d);return g})}}})}).call(this);