{:uriI"Ðfile:///Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/engines/alexandrie.coffee?type=application/javascript&pipeline=self&id=1794107edabd40b6b42edc642b6e5c70d7f6e49e600101e3ec5b02e2019471f0:ET:load_pathI">/Users/benoit/www/agilidee/dorsale/app/assets/javascripts;T: filenameI"`/Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/engines/alexandrie.coffee;T: nameI"dorsale/engines/alexandrie;T:logical_pathI"'dorsale/engines/alexandrie.self.js;T:content_typeI"application/javascript;T: sourceI"Å (function() { window.xhr2_available = function() { return !!window.ProgressEvent && !!window.FormData; }; window.alexandrie = { enable_xhr_upload: true, load: function() { return $("#dorsale-attachments").map(function() { var container, url; container = $(this); url = this.dataset.url; return $.ajax({ url: url, success: function(data) { container.html(data); setupUploadInputs(container); alexandrie.setupCreateForm(); alexandrie.setupEditButtons(); return alexandrie.setupDeleteButtons(); } }); }); }, reload: function() { return alexandrie.load(); }, setupCreateForm: function() { if (!xhr2_available()) { return; } if (!alexandrie.enable_xhr_upload) { return; } return $("#new_attachment").submit(function() { var data, form, xhr; form = $(this); xhr = new XMLHttpRequest(); data = new FormData(this); xhr.upload.addEventListener("progress", function(e) { var bar, percentComplete; if (!e.lengthComputable) { return; } percentComplete = Math.round(e.loaded * 100 / e.total); if (percentComplete === 0) { percentComplete = 1; } if (percentComplete === 100) { percentComplete = 99; } bar = form.find(".progress-bar"); bar.html(percentComplete + "%"); bar.css({ "width": percentComplete + "%" }); return bar.attr({ "aria-valuenow": percentComplete }); }); xhr.addEventListener("load", function(e) { return alexandrie.reload(); }); xhr.open("POST", this.action, true); xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhr.send(data); return false; }); }, setupEditForm: function() { return $("#edit_attachment").on("ajax:success", alexandrie.reload); }, setupEditButtons: function() { return $("#dorsale-attachments [href$=edit]").click(function() { var container, url; container = $(this).parents("li"); url = this.href; $.ajax({ url: url, success: function(data) { container.html(data); return alexandrie.setupEditForm(); } }); return false; }); }, setupDeleteButtons: function() { return $("#dorsale-attachments [data-method=delete]").map(function() { return $(this).on("ajax:success", alexandrie.reload); }); } }; }).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"nfile-digest:///Users/benoit/www/agilidee/dorsale/app/assets/javascripts/dorsale/engines/alexandrie.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%»¼~ª™<Ö Ã4€˜Ë7Í—µb˜F8Ã@dž[p ¬: lengthiÅ :dependencies_digest"%Ç/y[¢¸ÃìCK”=‘Ù¥¬9Áщ*;QÅCHS^:idI"E1794107edabd40b6b42edc642b6e5c70d7f6e49e600101e3ec5b02e2019471f0;F: mtimel+^ÕW