{I" class:ETI"ProcessedAsset;FI"logical_path;TI"proclaim/editor.js;FI" pathname;TI"U/home/krf/src/websites/proclaim/app/assets/javascripts/proclaim/editor.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+¨TI" length;Tix I" digest;TI"%1616a45404aa25414678f09a94c3cdb4;FI" source;TI"x (function() { var Editor, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; Editor = (function() { function Editor(form, titleFormField, titleEditableItem, bodyFormField, bodyEditableItem) { var imageDeletePath, imageUploadPath; this.form = form; this.titleFormField = titleFormField; this.titleEditableItem = titleEditableItem; this.bodyFormField = bodyFormField; this.bodyEditableItem = bodyEditableItem; this.updateFormFields = __bind(this.updateFormFields, this); if ((this.form.length === 1) && (this.titleFormField.length === 1) && (this.titleEditableItem.length === 1) && (this.bodyFormField.length === 1) && (this.bodyEditableItem.length === 1)) { imageUploadPath = this.bodyEditableItem.data("image-upload-path"); imageDeletePath = this.bodyEditableItem.data("image-delete-path"); if ((imageUploadPath.length > 0) && (imageDeletePath.length > 0)) { this.bodyEditor = new MediumEditor(this.bodyEditableItem, { buttonLabels: 'fontawesome' }); this.titleEditor = new MediumEditor(this.titleEditableItem); this.bodyEditableItem.mediumInsert({ editor: this.bodyEditor, addons: { images: { imagesUploadScript: imageUploadPath, imagesDeleteScript: imageDeletePath, deleteFile: (function(_this) { return function(file, that) { return $.post(that.options.imagesDeleteScript, { file: file }, function(data, status, jqxhr) { if (data.id) { _this.form.append(''); return _this.form.append(''); } }, "json"); }; })(this) } } }); this.cleanBindings(); this.addBindings(); } else { console.error("Missing image upload and/or image delete paths for body editor!"); } } else { console.error("Invalid length for editable items or form fields!"); } } Editor.prototype.addBindings = function() { return this.form.on("submit", this.updateFormFields); }; Editor.prototype.cleanBindings = function() { return this.form.off("submit"); }; Editor.prototype.updateFormFields = function(event) { this.titleFormField.val(this.titleEditor.serialize()["element-0"].value); return this.bodyFormField.val(this.bodyEditor.serialize()["element-0"].value); }; return Editor; })(); this.Editor = Editor; }).call(this); ;TI"dependency_digest;TI"%82700c711c30f1bafc30f2eb7b6ef5dd;FI"required_paths;T[I"U/home/krf/src/websites/proclaim/app/assets/javascripts/proclaim/editor.js.coffee;FI"dependency_paths;T[{I" path;TI"U/home/krf/src/websites/proclaim/app/assets/javascripts/proclaim/editor.js.coffee;FI" mtime;TI"2015-01-03T10:12:02-05:00;TI" digest;TI"%0b7d2530c1a3720b0343173d4ce99097;FI" _version;TI"%883b724e06f474a3db2deee10c127ab9;F