o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1383740408.868449: @value"¶{I" class:EFI"ProcessedAsset;FI"logical_path;FI"#iugu-ux/editors/file_editor.js;TI" pathname;FI"e/Users/alezonez/Projetos/iugu-ux/vendor/assets/javascripts/iugu-ux/editors/file_editor.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-10-08T15:36:47-03:00;FI" length;Fi_I" digest;F"%85f945ad28c4e8005bb936f3103434d8I" source;FI"_(function() { var _ref, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; Backbone.Form.editors.File = (function(_super) { __extends(File, _super); function File() { _ref = File.__super__.constructor.apply(this, arguments); return _ref; } File.prototype.tagName = 'div'; File.prototype.events = { change: function(evt) { return this.trigger("change", this); }, focus: function() { return this.trigger("focus", this); }, blur: function() { return this.trigger("blur", this); }, 'click [data-action=remove-document]': 'removeDocument' }; File.prototype.removeDocument = function(evt) { var docid; evt.preventDefault(); docid = this.$('.uploaded-file').data("id"); return (new DocumentDestroyRequester(this, docid)).execute(); }; File.prototype.removeDocumentDOM = function() { this.$('.uploaded-file').hide(); this.$('.uploaded-file .uploaded-file-name').text(""); this.$('.uploaded-file').data('id', ""); return this.$('.file-upload').show(); }; File.prototype.setProgressBar = function(context, value) { return context.$('.progress .bar').text(value); }; File.prototype.initialize = function(options) { var input, prbar, that, upfil; Backbone.Form.editors.Base.prototype.initialize.call(this, options); input = this.$el.append(""); prbar = this.$el.append("
"); upfil = this.$el.append("
Remover
"); this.$('.progress').hide(); this.$('.uploaded-file').hide(); this.on("destroyDocument:done", this.removeDocumentDOM, this); that = this; return this.$('.file-upload').fileupload({ url: "/proxy/documents", type: "POST", dataType: "json", formData: { title: that.schema.title, api_token: window.api_token }, maxFileSize: 2000000, progressall: function(evt, data) { var progress; progress = "Enviando..."; return that.setProgressBar(that, progress); }, error: function() { that.removeDocumentDOM(); that.$('.progress').hide(); return alert("Não foi possível enviar o arquivo."); }, send: function(evt, data) { that.$('.file-upload').hide(); return that.$('.progress').show(); }, done: function(evt, data) { that.setProgressBar(that, "100"); that.$('.progress').hide(); that.$('.uploaded-file').show(); that.$('.uploaded-file .uploaded-file-name').text(data.result.file_file_name); return that.$('.uploaded-file').data('id', data.result.id); } }); }; File.prototype.render = function() { this.setValue(this.value); return this; }; File.prototype.getValue = function() { return this.$('.uploaded-file').data('id'); }; File.prototype.setValue = function(value) { var sp; if (!value) { return; } sp = value.split(":"); this.$('.uploaded-file').data('id', sp[0]); if (sp.length > 1) { this.$('.uploaded-file .uploaded-file-name').text(sp[1]); this.$('.progress').hide(); this.$('.file-upload').hide(); return this.$('.uploaded-file').show(); } }; File.prototype.focus = function() { if (this.hasFocus) { } }; File.prototype.blur = function() { if (!this.hasFocus) { return; } return this.$el.blur(); }; return File; })(Backbone.Form.editors.Base); }).call(this); ;TI"dependency_digest;F"%9938b1a62ec4a21a396bd6fd58f11dfaI"required_paths;F[I"e/Users/alezonez/Projetos/iugu-ux/vendor/assets/javascripts/iugu-ux/editors/file_editor.js.coffee;TI"dependency_paths;F[{I" path;FI"e/Users/alezonez/Projetos/iugu-ux/vendor/assets/javascripts/iugu-ux/editors/file_editor.js.coffee;TI" mtime;FI"2013-10-08T15:36:47-03:00;FI" digest;F"%1e81a9a2b88e0d9caca78ef72ee668efI" _version;F"%6776f581a4329e299531e1d52aa59832