{I" class:ETI"ProcessedAsset;FI"logical_path;TI" alchemy/alchemy.uploader.js;FI" pathname;TI"/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+/-TI" length;Ti»I" digest;TI"%19f202f971e6c796f91ceef6d5de27f7;FI" source;TI"»(function() { if (typeof window.Alchemy === 'undefined') { window.Alchemy = {}; } Alchemy.Uploader = function(settings) { var completedUploads, file_types, totalFilesCount; totalFilesCount = 0; completedUploads = 0; file_types = settings.file_types === '*' ? '.+' : settings.file_types; $(document).bind('drop dragover', function(e) { return e.preventDefault(); }); $('.upload-button').hide(); $("#fileupload").fileupload({ dropZone: '#dropbox', dataType: 'json', acceptFileTypes: new RegExp("(.|/)(" + file_types + ")", "i"), maxNumberOfFiles: settings.file_upload_limit, maxFileSize: settings.file_size_limit * 1000000, formData: function(form) { var form_data; form_data = form.serializeArray(); $.merge(form_data, settings.post_params); return form_data; }, add: function(e, data) { var $this, xhr; $this = $(this); data.context = new Alchemy.FileProgress(data.files[0]); totalFilesCount = data.originalFiles.length; $('.total-files-count').text(totalFilesCount); $('.overall-upload').show(); data.process(function() { return $this.fileupload('process', data); }); if (data.files.error) { data.context.setError(); data.context.setStatus(data.files[0].error); data.context.$fileProgressCancel.click(function(e) { e.preventDefault(); data.context.setCancelled(); data.context.setStatus('cancelled'); return false; }); return false; } else { xhr = data.submit(); data.context.$fileProgressCancel.click(function(e) { e.preventDefault(); xhr.abort(); data.context.setCancelled(); data.context.setStatus('cancelled'); return false; }); return xhr; } }, progress: function(e, data) { var progress; progress = parseInt(data.loaded / data.total * 100, 10); return data.context.setProgress(progress); }, progressall: function(e, data) { var bar, progress; progress = parseInt(data.loaded / data.total * 100, 10); bar = $('.overall-upload .progress'); bar.css({ width: "" + progress + "%" }); return $('.progress-status').text("" + progress + "%"); }, done: function(e, data) { var response_data; completedUploads += 1; $('.uploaded-files-count').text(completedUploads); data.context.setComplete(); data.context.setStatus('complete'); response_data = data.xhr().response; if (completedUploads === totalFilesCount) { completedUploads = 0; totalFilesCount = 0; return window.setTimeout(function() { return settings.complete(); }, 2000); } }, fail: function(e, data) { var error, response, response_data; data.context.setError(); response_data = data.xhr().response; if (response_data) { response = JSON.parse(response_data); error = response.files[0].error; } return data.context.setStatus(error || data.textStatus); }, always: function(e, data) { var response, response_data, xhr; xhr = data.xhr(); response_data = xhr.response; if (response_data) { response = JSON.parse(response_data); if (response.growl_message) { return Alchemy.growl(response.growl_message, xhr.status === 422 ? 'alert' : 'notice'); } } } }); }; }).call(this); ;TI"dependency_digest;TI"%ce82af0fec844dc2aca78a5942a0c4cb;FI"required_paths;T[ I"j/Users/tvd/.rvm/gems/ruby-2.1.2/gems/jquery-ui-rails-4.1.2/app/assets/javascripts/jquery.ui.widget.js;FI"„/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee;FI"…/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js;FI"/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.fileupload.js;FI"‡/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js;FI"ˆ/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js;FI"/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee;FI"dependency_paths;T[ {I" path;TI"/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee;FI" mtime;TI"2014-10-02T11:38:55+02:00;TI" digest;TI"%b50471e602f5cdb69788da7b43d53709;F{@#I"j/Users/tvd/.rvm/gems/ruby-2.1.2/gems/jquery-ui-rails-4.1.2/app/assets/javascripts/jquery.ui.widget.js;F@%I"2014-06-17T09:21:04+02:00;T@'I"%2eb1c4ea07d45515b34259acc909e9df;F{@#I"„/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee;F@%I"2014-10-02T11:38:55+02:00;T@'I"%8ed78450083a789b7513677771f03c88;F{@#I"…/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js;F@%I"2014-10-02T11:38:55+02:00;T@'I"%f3d4907d0489ea9ea01bff0bfab26bea;F{@#I"/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.fileupload.js;F@%I"2014-10-02T11:38:55+02:00;T@'I"%ad077eae8d3c2227e91118eb9fdcfbff;F{@#I"‡/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js;F@%I"2014-10-02T11:38:55+02:00;T@'I"%abf983c8c6efa8414d6a0f0ba9aeb9d3;F{@#I"ˆ/Users/tvd/.rvm/gems/ruby-2.1.2/bundler/gems/alchemy_cms-7fe2839068da/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js;F@%I"2014-10-02T11:38:55+02:00;T@'I"%7cec6390bf4fb2a4a271c380611d258f;FI" _version;TI"%1005ed9f20e25fb0a0599a7017dd0e6b;F