{I" class:ETI"ProcessedAsset;FI"logical_path;TI"&rubber_ring/attachment_manager.js;FI" pathname;TI"h/Users/zigomir/development/rubber_ring/app/assets/javascripts/rubber_ring/attachment_manager.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+až‚QI" length;Ti I" digest;TI"%0252062b6ba254a9ae776fcc6cfe25b5;FI" source;TI" (function() { var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; $(function() { new AttachmentUploader($(".image_upload_box")); new AttachmentDragger("img[draggable=true]", ".rubber_ring_image", "src"); new AttachmentDragger("a[draggable=true]", ".rubber_ring_attachment", "href"); return $(".remove_not_used_attachments").on("click", function() { var attachment, image, item, pm, uploaded_attachments, uploaded_images, used_attachments, used_images, _i, _j, _len, _len1, _results; pm = new PersistenceManager(); uploaded_images = (function() { var _i, _len, _ref, _results; _ref = $(".uploaded-images img"); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; _results.push($(item).attr("src")); } return _results; })(); uploaded_attachments = (function() { var _i, _len, _ref, _results; _ref = $(".uploaded-attachments a"); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; _results.push($(item).attr("href")); } return _results; })(); used_images = (function() { var _i, _len, _ref, _results; _ref = $(".rubber_ring_image"); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; _results.push($(item).attr("src")); } return _results; })(); used_attachments = (function() { var _i, _len, _ref, _results; _ref = $(".rubber_ring_attachment"); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; _results.push($(item).attr("href")); } return _results; })(); for (_i = 0, _len = uploaded_images.length; _i < _len; _i++) { image = uploaded_images[_i]; if (__indexOf.call(used_images, image) < 0) { pm.remove_image(image); $(".uploaded-images img[src=\"" + image + "\"]").remove(); } } _results = []; for (_j = 0, _len1 = uploaded_attachments.length; _j < _len1; _j++) { attachment = uploaded_attachments[_j]; if (__indexOf.call(used_attachments, attachment) < 0) { pm.remove_image(attachment); _results.push($(".uploaded-attachments a[href=\"" + attachment + "\"]").remove()); } else { _results.push(void 0); } } return _results; }); }); }).call(this); ;TI"dependency_digest;TI"%b50d450a9c7f45192a44fac6fadeab5c;FI"required_paths;T[I"h/Users/zigomir/development/rubber_ring/app/assets/javascripts/rubber_ring/attachment_manager.coffee;FI"dependency_paths;T[{I" path;TI"h/Users/zigomir/development/rubber_ring/app/assets/javascripts/rubber_ring/attachment_manager.coffee;FI" mtime;TI"2013-05-02T19:12:01+02:00;TI" digest;TI"%f2970c393b7c580f7cc0783662b29750;FI" _version;TI"%a3b89b66a8471f3e75abb239e3b35c7d;F