o: ActiveSupport::Cache::Entry :@compressedF:@created_atf1330900459.0295711ä~: @value"{"content_type"application/javascript" class"ProcessedAsset"dependency_digest"%24269c38584b361a0a42ea68cd2ad304" mtime"2012-03-05T02:33:35+04:00" _version"%45a9b34d2c65935f21d8f90f1e1b2836"dependency_paths[{" mtime"2012-03-05T02:33:35+04:00" digest"%a1e0a6174e878fd79610c188fc64d890" path"R/home/alex/simple_attachments/vendor/assets/javascripts/simple_attachments.js" digest"%a1e0a6174e878fd79610c188fc64d890"required_paths["R/home/alex/simple_attachments/vendor/assets/javascripts/simple_attachments.js" pathname"R/home/alex/simple_attachments/vendor/assets/javascripts/simple_attachments.js"logical_path"simple_attachments.js" lengthi}" source"}var simple_attachments = { getCSRF: function() { var name = $("meta[name=csrf-param]"); var value = $("meta[name=csrf-token]"); name = (name.length ? name.attr("content") : "authenticity_token"); value = (value.length ? value.attr("content") : ""); return {name: name, value: value} }, setFieldsData: function(event, data) { var field = $(event.currentTarget); var div = event.data.div; var options = div.options; $("").attr("type", "hidden").attr("name", div.input_name).attr("value", data.id).appendTo(field); data.destroy_link = null; if (options.can_destroy) { data.destroy_link = $("").attr("class", "simple_attachments_destroy_link").attr("href", data.filepath); data.destroy_link.bind("click", {field: field, destroy_remote: options.destroy_remote}, function(event) { if (event.data.destroy_remote) { var csrf = simple_attachments.getCSRF(); var post = {_method: "delete"}; post[csrf.name] = csrf.value; $.post(this.href, post); } event.data.field.remove(); return false; }); } data.attachment_link = $("").attr("class", "simple_attachments_attachment_link").attr("href", data.filepath); data.div = div; field.trigger("loaded", [data]); }, createInput: function(event) { var div = $(event.currentTarget); var input = $("").attr("type", "file").attr("class", "simple_attachments_input").attr("name", "file"); input.appendTo(div.find(".simple_attachments_add_file_div")); var form = $("
").attr("method", "post").attr("action", div.attr("data-attachments-path")).attr("enctype", "multipart/form-data").attr("accept-charset", "UTF-8"); var csrf = simple_attachments.getCSRF(); $("").attr("type", "hidden").attr("name", csrf.name).attr("value", csrf.value).appendTo(form); $("").attr("type", "hidden").attr("name", "container_id").attr("value", div.attr("data-container-id")).appendTo(form); $("").attr("type", "hidden").attr("name", "container_model").attr("value", div.attr("data-container-model")).appendTo(form); $("").attr("type", "hidden").attr("name", "method").attr("value", div.attr("data-method")).appendTo(form); input.bind("change", {div: div, form: form}, simple_attachments.createIframe); }, createIframe: function(event) { var input = $(event.currentTarget); var div = event.data.div; var form = event.data.form; var iframe = $("