o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1350763891.844765: @value"ª {I" class:EFI"ProcessedAsset;FI"logical_path;FI"rich/browser/uploader.js;FI" pathname;FI"a/Users/bastiaan/Files/Work/rich_project/rich/app/assets/javascripts/rich/browser/uploader.js;FI"content_type;FI"application/javascript;FI" mtime;FI"2012-07-11T10:50:51+02:00;FI" length;Fie I" digest;F"%0dfff29f6dc90ee9fb5ee16749156411I" source;FI"e // Implementation of the QQ FileUploader class for use in Rich var rich = rich || {}; rich.Uploader = function(){ this._options = { uploadButtonId: 'upload', insertionPoint: 'uploadBlock', uploadType: $.QueryString["type"], scoped: $.QueryString["scoped"], scope_type: $.QueryString["scope_type"], scope_id: $.QueryString["scope_id"] }; // create the qq uploader var self = this; var uploader = new qq.FileUploaderBasic({ button: document.getElementById(self._options.uploadButtonId), multiple: true, maxConnections: 3, action: $("#new_rich_file").attr("action"), params: { authenticity_token: $("input[name='authenticity_token']").attr("value"), simplified_type: this._options.uploadType, scoped: this._options.scoped, scope_type: this._options.scope_type, scope_id: this._options.scope_id }, debug: true, onComplete: function(id, fileName, responseJSON) { self.uploadComplete(id, fileName, responseJSON); }, onSubmit: function(id, fileName) { self.uploadSubmit(id, fileName); }, onProgress: function(id, fileName, loaded, total) { self.uploadProgress(id, fileName, Math.round(loaded/total*100)); } }); }; rich.Uploader.prototype = { uploadComplete: function(id, fileName, response){ if (response.success){ $('#up'+id+' .progress-bar').first().width("100%"); $('#up'+id+' .spinner').first().addClass("spinning"); //get the created image object's id from the response and use it to request the thumbnail $.get("/rich/files/"+response.rich_id, function(data) { $('#up'+id).replaceWith(data).addClass("test"); $('#image'+response.rich_id).addClass("new"); }); } else { $('#up'+id+' .spinner').first().addClass("error"); $('#up'+id+' .spinner').first().removeClass("spinning"); $('#up'+id+' .progress-bar').first().remove(); } }, uploadSubmit: function(id, fileName) { // insert a new image placeholder after the upload button $('#'+this._options.insertionPoint).after('
  • '+fileName+'

  • '); }, uploadProgress: function(id, fileName, progress) { $('#up'+id+' .progress-bar').first().width(progress+"%"); if(progress > 90) { // start spinning $('#up'+id+' .spinner').first().addClass("spinning"); } }, }; ;FI"dependency_digest;F"%bcf6683f9bcc947d1f7612260febfea9I"required_paths;F[I"a/Users/bastiaan/Files/Work/rich_project/rich/app/assets/javascripts/rich/browser/uploader.js;FI"dependency_paths;F[{I" path;FI"a/Users/bastiaan/Files/Work/rich_project/rich/app/assets/javascripts/rich/browser/uploader.js;FI" mtime;FI"2012-07-11T10:50:51+02:00;FI" digest;F"%ce6af71c1e4e7513fc6e4f48fc5cdea0I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862