{:uriI"file:///Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/modals.coffee?type=application/javascript&pipeline=self&id=63d8a0b39f411ce42ecfe50d1693492d78a8d8b59fded50b964cb5dc6a6de9da:ET:load_pathI">/Users/benoit/www/agilidee/dorsale/app/assets/javascripts;T: filenameI"T/Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/modals.coffee;T: nameI"dorsale/modals;T:logical_pathI"dorsale/modals.self.js;T:content_typeI"application/javascript;T: sourceI"(function() { window.modal = { open: function(content) { var modal_html; this.close(); $("body").addClass("modal-open"); modal_html = $(""); modal_html.find(".modal-overlay, .modal-close").click(function() { return modal.close(); }); $("body").append(modal_html); return $(document).trigger("page:load"); }, close: function() { $(".modal").remove(); return $("body").removeClass("modal-open"); }, openLink: function() { modal.open("Chargement..."); $.ajax({ url: this.href, dataType: "html", success: function(data, textStatus, xhr) { if (xhr.getResponseHeader("Location") === location.href || xhr.getResponseHeader("Location") === location.pathname) { location.reload(); return; } return modal.open(data); }, error: function() { return modal.open("Erreur"); } }); return false; }, openForm: function() { $.ajax({ url: this.action, dataType: "html", type: this.method.toUpperCase(), data: $(this).serialize(), success: function(data) { return modal.open(data); }, error: function() { return modal.open("Erreur"); } }); return false; }, setup: function(scope) { scope = $(scope || document); scope.find("a[data-modal=1], .modal-body a:not([data-modal=0])").off("click", modal.openLink).on("click", modal.openLink); return scope.find("form[data-modal=1], .modal-body form:not([data-modal=0])").off("submit", modal.openForm).on("submit", modal.openForm); } }; $(document).on("ready page:load", function() { return modal.setup(); }); }).call(this); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"bfile-digest:///Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/modals.coffee;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%S%+l6V&Uqʌ:q &I: lengthi:dependencies_digest"% " AH =t6D۸&b:idI"E63d8a0b39f411ce42ecfe50d1693492d78a8d8b59fded50b964cb5dc6a6de9da;F: mtimel+!V