{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"%08148e8add8c5ae933a00480266c5289;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"%6c9f0a15fae1f281ac8ff057152d9f5d;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"%c5f2ab386ccc5cc6014d4db81fde9c2a;FI" _version;TI"%1e2632a10b8c877576b37720d5bf8883;F