{:uriI"file:///Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/forms.coffee?type=application/javascript&pipeline=self&id=38aac3df77cd22ea503b72dc782af745f750c17af47e71e78ddf4d34d0a0cdb3:ET:load_pathI">/Users/benoit/www/agilidee/dorsale/app/assets/javascripts;T: filenameI"S/Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/forms.coffee;T: nameI"dorsale/forms;T:logical_pathI"dorsale/forms.self.js;T:content_typeI"application/javascript;T: sourceI"(function() { $(document).on("ready page:load", function() { $("button.reset").click(function() { var form; form = $(this).parents("form"); form.find("select option:first-child").map(function() { return this.selected = true; }); form.find("input").map(function() { if (this.type.match(/submit|hidden|button/)) { return; } return this.value = $(this).data("default-value") || ""; }); form.find("textarea").map(function() { return this.value = $(this).data("default-value") || ""; }); return form.find("select").map(function() { if (this.selectize) { return this.selectize.clear(); } }); }); $("form").submit(function() { var input; if (this.method.toUpperCase() === "GET") { return; } if ($(this).find("[name=back_url]").length > 0) { return; } input = document.createElement("input"); input.type = "hidden"; input.name = "back_url"; input.value = location.href; return $(this).append(input); }); return $(".form-group.upload").map(function() { $(this).find("label").map(function() { return this.dataset.defaultValue = $(this).html(); }); return $(this).find("input").change(function() { if (this.value !== "") { return $(this).parents(".upload").find("label").html(this.value); } else { return $(this).parents(".upload").find("label").map(function() { return $(this).html(this.dataset.defaultValue); }); } }); }); }); }).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"afile-digest:///Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/forms.coffee;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%3"1X0er?: lengthi:dependencies_digest"%Sg6BkH\8? vw:idI"E38aac3df77cd22ea503b72dc782af745f750c17af47e71e78ddf4d34d0a0cdb3;F: mtimel+V