{:uriI"Ãfile:///Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/forms.coffee?type=application/javascript&pipeline=self&id=e3bee80bca43e7e1814522607960e6c06480ea8170e91cb754f2bc33fb985514: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() { window.setupUploadInputs = function(scope) { if (scope == null) { scope = document; } return $(scope).find(".form-group.upload").map(function() { var form, group, input, label, progress, submit; group = $(this); form = group.parents("form"); input = group.find("[type=file]"); submit = group.find("[type=submit]"); label = group.find("label"); progress = group.find(".progress"); if (!xhr2_available()) { progress.hide(); } label.map(function() { return this.dataset.defaultValue = $(this).html(); }); input.change(function() { var label_value; if (this.value === "") { submit.prop({ disabled: true }); label_value = label.data("defaultValue"); } else { submit.prop({ disabled: false }); label_value = this.value.split("/").pop().split("\\").pop(); } return label.html(label_value); }); return input.change(); }); }; $(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 setupUploadInputs(); }); }).call(this); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"rails-env;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"%B×roTÄáF™³]B#¿/˜ÊÜ1 VìšíPd?¾F: lengthiÈ:dependencies_digest"%^ɳéú@3Gt¼œµH»ÐPÑV{”ã1ºÚi€ç@Ñ…Ý:idI"Ee3bee80bca43e7e1814522607960e6c06480ea8170e91cb754f2bc33fb985514;F: mtimel+-YW