o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1361449319.376663 ?:@value"§{I"
class:EFI"ProcessedAsset; FI"logical_path; FI"#iugu-ux/editors/file_editor.js; FI"
pathname; FI"€/Users/patricknegri/.rvm/gems/ruby-1.9.2-p290/gems/iugu-ux-0.9.2/vendor/assets/javascripts/iugu-ux/editors/file_editor.js.coffee; FI"content_type; FI"application/javascript; FI"
mtime; FI"2013-01-17T19:18:49-02:00; FI"length; FiíI"digest; F"%dc3a8e80c66a9d38eae0bd5ca72dc3c0I"source; FI"í(function() {
var __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() {
return File.__super__.constructor.apply(this, arguments);
}
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) {
context.$('.progress .bar').css('width', 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("");
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
},
progressall: function(evt, data) {
var progress;
progress = parseInt(data.loaded / data.total * 100, 10);
return that.setProgressBar(that, progress);
},
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);
that.$('.uploaded-file').data('id', data.result.id);
return debug(data);
}
});
};
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"%522f222535132023ce4289ccd4ad8ffdI"required_paths; F[I"€/Users/patricknegri/.rvm/gems/ruby-1.9.2-p290/gems/iugu-ux-0.9.2/vendor/assets/javascripts/iugu-ux/editors/file_editor.js.coffee; FI"dependency_paths; F[{I" path; FI"€/Users/patricknegri/.rvm/gems/ruby-1.9.2-p290/gems/iugu-ux-0.9.2/vendor/assets/javascripts/iugu-ux/editors/file_editor.js.coffee; FI"
mtime; FI"2013-01-17T19:18:49-02:00; FI"digest; F"%ffc8e0ff983512afc2f411f709f510c1I"
_version; F"%6776f581a4329e299531e1d52aa59832