{I" class:ETI"ProcessedAsset;FI"logical_path;TI" alchemy/alchemy.uploader.js;FI" pathname;TI"{/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+š’TI" length;Ti»I" digest;TI"%686c3f488e1bfbf3906044570144cdb8;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"%84137bca4ecc316a118fffb59dc445ac;FI"required_paths;T[ I"j/Users/tvd/.rvm/gems/ruby-2.1.5/gems/jquery-ui-rails-5.0.3/app/assets/javascripts/jquery-ui/widget.js;FI"{/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee;FI"|/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js;FI"{/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.fileupload.js;FI"~/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js;FI"/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js;FI"{/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee;FI"dependency_paths;T[ {I" path;TI"{/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee;FI" mtime;TI"2014-12-17T23:15:54+01:00;TI" digest;TI"%e3c1d33535041e0f369fd6340dcec335;F{@#I"j/Users/tvd/.rvm/gems/ruby-2.1.5/gems/jquery-ui-rails-5.0.3/app/assets/javascripts/jquery-ui/widget.js;F@%I"2014-12-09T23:16:22+01:00;T@'I"%d3340fe7e676858d15719fcc4ff191f7;F{@#I"{/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee;F@%I"2014-12-17T23:15:54+01:00;T@'I"%56c3b742132a950d07dbd7da0c8d2f24;F{@#I"|/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.iframe-transport.js;F@%I"2014-12-17T23:15:54+01:00;T@'I"%1b2602783ec06500c77a078ad02735c8;F{@#I"{/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.fileupload.js;F@%I"2014-12-17T23:15:54+01:00;T@'I"%78c7b55d221947aa4633165e410f33e5;F{@#I"~/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.fileupload-process.js;F@%I"2014-12-17T23:15:54+01:00;T@'I"%8602281cc48735179353d511a86bc992;F{@#I"/Users/tvd/.rvm/gems/ruby-2.1.5/gems/alchemy_cms-3.1.0.beta2/vendor/assets/javascripts/fileupload/jquery.fileupload-validate.js;F@%I"2014-12-17T23:15:54+01:00;T@'I"%fae5b4485a93d4fce239048ed97fad80;FI" _version;TI"%e4fae582d35919173aa703e1ae9b242e;F