Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bump up to jquery.fileupload 5.5.3 & jquery.fileupload-ui 6.0.2. #1

Closed
wants to merge 1 commit into from

3 participants

@olivierlacan

Did a simple bump to the most up-to-date version of the plugins. Took the opportunity to add a README and CHANGELOG in the hope of making this more noticeable.

I was about to make my own gem, glad you did :-)

@semaperepelitsa

Thanks. Can you remove .DS_Store files? I'd recommend adding it to your ~/.gitignore so that you don't accidentally commit them.

@eagoweb

commit this!!!

@semaperepelitsa

I've updated all files again myself, added readme from your commit and pushed 0.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 21, 2011
  1. @olivierlacan
This page is out of date. Refresh to see the latest.
View
BIN  .DS_Store
Binary file not shown
View
10 CHANGELOG.md
@@ -0,0 +1,10 @@
+CHANGELOG
+=========
+
+0.0.2 (Dec 21, 2011)
+---------------------
+* Bump up to jquery.fileupload 5.5.3 & jquery.fileupload-ui 6.0.2.
+
+0.0.1 (Dec 8, 2011)
+---------------------
+* Initial release with jquery.fileupload 5.5.2 & jquery.fileupload-ui 5.1.1.
View
7 README.md
@@ -0,0 +1,7 @@
+# jQuery File Upload Rails
+
+jQuery File Upload is a very well designed cross-browser solution for modern file uploading with pure JavaScript. The plugin is developed by Sebastian Tschan (@blueimp) and well maintained.
+
+This is a simple gem package for this plugin.
+
+[See the original project page](https://github.com/blueimp/jQuery-File-Upload) for reference & documentation.
View
2  lib/jquery.fileupload-rails/version.rb
@@ -1,5 +1,5 @@
module JqueryFileUpload
module Rails
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end
end
View
BIN  vendor/.DS_Store
Binary file not shown
View
BIN  vendor/assets/.DS_Store
Binary file not shown
View
570 vendor/assets/javascripts/jquery.fileupload-ui.js 100644 → 100755
@@ -1,12 +1,12 @@
/*
- * jQuery File Upload User Interface Plugin 5.1.1
+ * jQuery File Upload User Interface Plugin 6.0.2
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
- * http://creativecommons.org/licenses/MIT/
+ * http://www.opensource.org/licenses/MIT
*/
/*jslint nomen: true, unparam: true, regexp: true */
@@ -38,6 +38,8 @@
// The regular expression to define for which files a preview
// image is shown, matched against the file type:
previewFileTypes: /^image\/(gif|jpeg|png)$/,
+ // The maximum file size for preview images:
+ previewMaxFileSize: 5000000, // 5MB
// The maximum width of the preview images:
previewMaxWidth: 80,
// The maximum height of the preview images:
@@ -46,12 +48,6 @@
// if supported by the browser. Set the following option to false
// to always display preview images as img elements:
previewAsCanvas: true,
- // The file upload template that is given as first argument to the
- // jQuery.tmpl method to render the file uploads:
- uploadTemplate: $('#template-upload'),
- // The file download template, that is given as first argument to the
- // jQuery.tmpl method to render the file downloads:
- downloadTemplate: $('#template-download'),
// The expected data type of the upload response, sets the dataType
// option of the $.ajax upload requests:
dataType: 'json',
@@ -60,15 +56,17 @@
// widget (via file input selection, drag & drop or add API call).
// See the basic file upload widget for more information:
add: function (e, data) {
- var that = $(this).data('fileupload');
- that._adjustMaxNumberOfFiles(-data.files.length);
+ var that = $(this).data('fileupload'),
+ files = data.files;
+ that._adjustMaxNumberOfFiles(-files.length);
data.isAdjusted = true;
- data.isValidated = that._validate(data.files);
- data.context = that._renderUpload(data.files)
- .appendTo($(this).find('.files')).fadeIn(function () {
- // Fix for IE7 and lower:
- $(this).show();
- }).data('data', data);
+ data.files.valid = data.isValidated = that._validate(files);
+ data.context = that._renderUpload(files)
+ .appendTo(that._files)
+ .data('data', data);
+ // Force reflow:
+ that._reflow = that._transition && data.context[0].offsetWidth;
+ data.context.addClass('in');
if ((that.options.autoUpload || data.autoUpload) &&
data.isValidated) {
data.submit();
@@ -90,15 +88,17 @@
// Iframe Transport does not support progress events.
// In lack of an indeterminate progress bar, we set
// the progress to 100%, showing the full animated bar:
- data.context.find('.ui-progressbar').progressbar(
- 'value',
- parseInt(100, 10)
+ data.context.find('.progressbar div').css(
+ 'width',
+ parseInt(100, 10) + '%'
);
}
},
// Callback for successful uploads:
done: function (e, data) {
- var that = $(this).data('fileupload');
+ var that = $(this).data('fileupload'),
+ template,
+ preview;
if (data.context) {
data.context.each(function (index) {
var file = ($.isArray(data.result) &&
@@ -106,190 +106,115 @@
if (file.error) {
that._adjustMaxNumberOfFiles(1);
}
- $(this).fadeOut(function () {
- that._renderDownload([file])
- .css('display', 'none')
- .replaceAll(this)
- .fadeIn(function () {
- // Fix for IE7 and lower:
- $(this).show();
- });
- });
+ that._transitionCallback(
+ $(this).removeClass('in'),
+ function (node) {
+ template = that._renderDownload([file]);
+ preview = node
+ .find('.preview img, .preview canvas');
+ if (preview.length) {
+ template.find('.preview img')
+ .prop('width', preview.prop('width'))
+ .prop('height', preview.prop('height'));
+ }
+ template
+ .replaceAll(node);
+ // Force reflow:
+ that._reflow = that._transition &&
+ template[0].offsetWidth;
+ template.addClass('in');
+ }
+ );
});
} else {
- that._renderDownload(data.result)
- .css('display', 'none')
- .appendTo($(this).find('.files'))
- .fadeIn(function () {
- // Fix for IE7 and lower:
- $(this).show();
- });
+ template = that._renderDownload(data.result)
+ .appendTo(that._files);
+ // Force reflow:
+ that._reflow = that._transition && template[0].offsetWidth;
+ template.addClass('in');
}
},
// Callback for failed (abort or error) uploads:
fail: function (e, data) {
- var that = $(this).data('fileupload');
+ var that = $(this).data('fileupload'),
+ template;
that._adjustMaxNumberOfFiles(data.files.length);
if (data.context) {
data.context.each(function (index) {
- $(this).fadeOut(function () {
- if (data.errorThrown !== 'abort') {
- var file = data.files[index];
- file.error = file.error || data.errorThrown ||
- true;
- that._renderDownload([file])
- .css('display', 'none')
- .replaceAll(this)
- .fadeIn(function () {
- // Fix for IE7 and lower:
- $(this).show();
- });
- } else {
- data.context.remove();
- }
- });
+ if (data.errorThrown !== 'abort') {
+ var file = data.files[index];
+ file.error = file.error || data.errorThrown ||
+ true;
+ that._transitionCallback(
+ $(this).removeClass('in'),
+ function (node) {
+ template = that._renderDownload([file])
+ .replaceAll(node);
+ // Force reflow:
+ that._reflow = that._transition &&
+ template[0].offsetWidth;
+ template.addClass('in');
+ }
+ );
+ } else {
+ that._transitionCallback(
+ $(this).removeClass('in'),
+ function (node) {
+ node.remove();
+ }
+ );
+ }
});
} else if (data.errorThrown !== 'abort') {
that._adjustMaxNumberOfFiles(-data.files.length);
data.context = that._renderUpload(data.files)
- .css('display', 'none')
- .appendTo($(this).find('.files'))
- .fadeIn(function () {
- // Fix for IE7 and lower:
- $(this).show();
- }).data('data', data);
+ .appendTo(that._files)
+ .data('data', data);
+ // Force reflow:
+ that._reflow = that._transition && data.context[0].offsetWidth;
+ data.context.addClass('in');
}
},
// Callback for upload progress events:
progress: function (e, data) {
if (data.context) {
- data.context.find('.ui-progressbar').progressbar(
- 'value',
- parseInt(data.loaded / data.total * 100, 10)
+ data.context.find('.progressbar div').css(
+ 'width',
+ parseInt(data.loaded / data.total * 100, 10) + '%'
);
}
},
// Callback for global upload progress events:
progressall: function (e, data) {
- $(this).find('.fileupload-progressbar').progressbar(
- 'value',
- parseInt(data.loaded / data.total * 100, 10)
+ $(this).find('.fileupload-progressbar div').css(
+ 'width',
+ parseInt(data.loaded / data.total * 100, 10) + '%'
);
},
// Callback for uploads start, equivalent to the global ajaxStart event:
start: function () {
- $(this).find('.fileupload-progressbar')
- .progressbar('value', 0).fadeIn();
+ $(this).find('.fileupload-progressbar div')
+ .css('width', '0%');
},
// Callback for uploads stop, equivalent to the global ajaxStop event:
stop: function () {
- $(this).find('.fileupload-progressbar').fadeOut();
+ $(this).find('.fileupload-progressbar div')
+ .css('width', '0%');
},
// Callback for file deletion:
destroy: function (e, data) {
var that = $(this).data('fileupload');
if (data.url) {
- $.ajax(data)
- .success(function () {
- that._adjustMaxNumberOfFiles(1);
- $(this).fadeOut(function () {
- $(this).remove();
- });
- });
- } else {
- that._adjustMaxNumberOfFiles(1);
- data.context.fadeOut(function () {
- $(this).remove();
- });
+ $.ajax(data);
}
- }
- },
-
- // Scales the given image (img HTML element)
- // using the given options.
- // Returns a canvas object if the canvas option is true
- // and the browser supports canvas, else the scaled image:
- _scaleImage: function (img, options) {
- options = options || {};
- var canvas = document.createElement('canvas'),
- scale = Math.min(
- (options.maxWidth || img.width) / img.width,
- (options.maxHeight || img.height) / img.height
- );
- if (scale >= 1) {
- scale = Math.max(
- (options.minWidth || img.width) / img.width,
- (options.minHeight || img.height) / img.height
+ that._adjustMaxNumberOfFiles(1);
+ that._transitionCallback(
+ data.context.removeClass('in'),
+ function (node) {
+ node.remove();
+ }
);
}
- img.width = parseInt(img.width * scale, 10);
- img.height = parseInt(img.height * scale, 10);
- if (!options.canvas || !canvas.getContext) {
- return img;
- }
- canvas.width = img.width;
- canvas.height = img.height;
- canvas.getContext('2d')
- .drawImage(img, 0, 0, img.width, img.height);
- return canvas;
- },
-
- _createObjectURL: function (file) {
- var undef = 'undefined',
- urlAPI = (typeof window.createObjectURL !== undef && window) ||
- (typeof URL !== undef && URL) ||
- (typeof webkitURL !== undef && webkitURL);
- return urlAPI ? urlAPI.createObjectURL(file) : false;
- },
-
- _revokeObjectURL: function (url) {
- var undef = 'undefined',
- urlAPI = (typeof window.revokeObjectURL !== undef && window) ||
- (typeof URL !== undef && URL) ||
- (typeof webkitURL !== undef && webkitURL);
- return urlAPI ? urlAPI.revokeObjectURL(url) : false;
- },
-
- // Loads a given File object via FileReader interface,
- // invokes the callback with a data url:
- _loadFile: function (file, callback) {
- if (typeof FileReader !== 'undefined' &&
- FileReader.prototype.readAsDataURL) {
- var fileReader = new FileReader();
- fileReader.onload = function (e) {
- callback(e.target.result);
- };
- fileReader.readAsDataURL(file);
- return true;
- }
- return false;
- },
-
- // Loads an image for a given File object.
- // Invokes the callback with an img or optional canvas
- // element (if supported by the browser) as parameter:
- _loadImage: function (file, callback, options) {
- var that = this,
- url,
- img;
- if (!options || !options.fileTypes ||
- options.fileTypes.test(file.type)) {
- url = this._createObjectURL(file);
- img = $('<img>').bind('load', function () {
- $(this).unbind('load');
- that._revokeObjectURL(url);
- callback(that._scaleImage(img[0], options));
- });
- if (url) {
- img.prop('src', url);
- return true;
- } else {
- return this._loadFile(file, function (url) {
- img.prop('src', url);
- });
- }
- }
- return false;
},
// Link handler, that allows to download files
@@ -321,17 +246,17 @@
}
},
- _formatFileSize: function (file) {
- if (typeof file.size !== 'number') {
+ _formatFileSize: function (bytes) {
+ if (typeof bytes !== 'number') {
return '';
}
- if (file.size >= 1000000000) {
- return (file.size / 1000000000).toFixed(2) + ' GB';
+ if (bytes >= 1000000000) {
+ return (bytes / 1000000000).toFixed(2) + ' GB';
}
- if (file.size >= 1000000) {
- return (file.size / 1000000).toFixed(2) + ' MB';
+ if (bytes >= 1000000) {
+ return (bytes / 1000000).toFixed(2) + ' MB';
}
- return (file.size / 1000).toFixed(2) + ' KB';
+ return (bytes / 1000).toFixed(2) + ' KB';
},
_hasError: function (file) {
@@ -374,100 +299,59 @@
return valid;
},
- _uploadTemplateHelper: function (file) {
- file.sizef = this._formatFileSize(file);
- return file;
- },
-
- _renderUploadTemplate: function (files) {
- var that = this;
- return $.tmpl(
- this.options.uploadTemplate,
- $.map(files, function (file) {
- return that._uploadTemplateHelper(file);
- })
- );
+ _renderTemplate: function (func, files) {
+ return $(this.options.templateContainer).html(func({
+ files: files,
+ formatFileSize: this._formatFileSize,
+ options: this.options
+ })).children();
},
_renderUpload: function (files) {
var that = this,
options = this.options,
- tmpl = this._renderUploadTemplate(files),
- isValidated = this._validate(files);
- if (!(tmpl instanceof $)) {
- return $();
- }
- tmpl.css('display', 'none');
- // .slice(1).remove().end().first() removes all but the first
- // element and selects only the first for the jQuery collection:
- tmpl.find('.progress div').slice(
- isValidated ? 1 : 0
- ).remove().end().first()
- .progressbar();
- tmpl.find('.start button').slice(
- this.options.autoUpload || !isValidated ? 0 : 1
- ).remove().end().first()
- .button({
- text: false,
- icons: {primary: 'ui-icon-circle-arrow-e'}
- });
- tmpl.find('.cancel button').slice(1).remove().end().first()
- .button({
- text: false,
- icons: {primary: 'ui-icon-cancel'}
- });
- tmpl.find('.preview').each(function (index, node) {
- that._loadImage(
- files[index],
- function (img) {
- $(img).hide().appendTo(node).fadeIn();
- },
- {
- maxWidth: options.previewMaxWidth,
- maxHeight: options.previewMaxHeight,
- fileTypes: options.previewFileTypes,
- canvas: options.previewAsCanvas
- }
- );
+ nodes = this._renderTemplate(options.uploadTemplate, files);
+ nodes.find('.preview span').each(function (index, node) {
+ var file = files[index];
+ if (options.previewFileTypes.test(file.type) &&
+ (!options.previewMaxFileSize ||
+ file.size < options.previewMaxFileSize)) {
+ window.loadImage(
+ files[index],
+ function (img) {
+ $(node).append(img);
+ // Force reflow:
+ that._reflow = that._transition &&
+ node.offsetWidth;
+ $(node).addClass('in');
+ },
+ {
+ maxWidth: options.previewMaxWidth,
+ maxHeight: options.previewMaxHeight,
+ canvas: options.previewAsCanvas
+ }
+ );
+ }
});
- return tmpl;
- },
-
- _downloadTemplateHelper: function (file) {
- file.sizef = this._formatFileSize(file);
- return file;
+ return nodes;
},
- _renderDownloadTemplate: function (files) {
- var that = this;
- return $.tmpl(
+ _renderDownload: function (files) {
+ var nodes = this._renderTemplate(
this.options.downloadTemplate,
- $.map(files, function (file) {
- return that._downloadTemplateHelper(file);
- })
+ files
);
- },
-
- _renderDownload: function (files) {
- var tmpl = this._renderDownloadTemplate(files);
- if (!(tmpl instanceof $)) {
- return $();
- }
- tmpl.css('display', 'none');
- tmpl.find('.delete button').button({
- text: false,
- icons: {primary: 'ui-icon-trash'}
- });
- tmpl.find('a').each(this._enableDragToDesktop);
- return tmpl;
+ nodes.find('a').each(this._enableDragToDesktop);
+ return nodes;
},
_startHandler: function (e) {
e.preventDefault();
- var tmpl = $(this).closest('.template-upload'),
+ var button = $(this),
+ tmpl = button.closest('.template-upload'),
data = tmpl.data('data');
if (data && data.submit && !data.jqXHR && data.submit()) {
- $(this).fadeOut();
+ button.prop('disabled', true);
}
},
@@ -494,63 +378,59 @@
});
},
- _initEventHandlers: function () {
- $.blueimp.fileupload.prototype._initEventHandlers.call(this);
- var eventData = {fileupload: this};
- this.element.find('.files')
- .delegate(
- '.start button',
- 'click.' + this.options.namespace,
- eventData,
- this._startHandler
- )
- .delegate(
- '.cancel button',
- 'click.' + this.options.namespace,
- eventData,
- this._cancelHandler
- )
- .delegate(
- '.delete button',
- 'click.' + this.options.namespace,
- eventData,
- this._deleteHandler
+ _transitionCallback: function (node, callback) {
+ var that = this;
+ if (this._transition && node.hasClass('fade')) {
+ node.bind(
+ this._transitionEnd,
+ function (e) {
+ // Make sure we don't respond to other transitions events
+ // in the container element, e.g. from button elements:
+ if (e.target === node[0]) {
+ node.unbind(that._transitionEnd);
+ callback.call(that, node);
+ }
+ }
);
+ } else {
+ callback.call(this, node);
+ }
},
- _destroyEventHandlers: function () {
- this.element.find('.files')
- .undelegate('.start button', 'click.' + this.options.namespace)
- .undelegate('.cancel button', 'click.' + this.options.namespace)
- .undelegate('.delete button', 'click.' + this.options.namespace);
- $.blueimp.fileupload.prototype._destroyEventHandlers.call(this);
+ _initTransitionSupport: function () {
+ var that = this,
+ style = (document.body || document.documentElement).style,
+ suffix = '.' + that.options.namespace;
+ that._transition = style.transition !== undefined ||
+ style.WebkitTransition !== undefined ||
+ style.MozTransition !== undefined ||
+ style.MsTransition !== undefined ||
+ style.OTransition !== undefined;
+ if (that._transition) {
+ that._transitionEnd = [
+ 'TransitionEnd',
+ 'webkitTransitionEnd',
+ 'transitionend',
+ 'oTransitionEnd'
+ ].join(suffix + ' ') + suffix;
+ }
},
- _initFileUploadButtonBar: function () {
+ _initButtonBarEventHandlers: function () {
var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
- filesList = this.element.find('.files'),
+ filesList = this._files,
ns = this.options.namespace;
- fileUploadButtonBar
- .addClass('ui-widget-header ui-corner-top');
- this.element.find('.fileinput-button').each(function () {
- var fileInput = $(this).find('input:file').detach();
- $(this).button({icons: {primary: 'ui-icon-plusthick'}})
- .append(fileInput);
- });
fileUploadButtonBar.find('.start')
- .button({icons: {primary: 'ui-icon-circle-arrow-e'}})
.bind('click.' + ns, function (e) {
e.preventDefault();
filesList.find('.start button').click();
});
fileUploadButtonBar.find('.cancel')
- .button({icons: {primary: 'ui-icon-cancel'}})
.bind('click.' + ns, function (e) {
e.preventDefault();
filesList.find('.cancel button').click();
});
fileUploadButtonBar.find('.delete')
- .button({icons: {primary: 'ui-icon-trash'}})
.bind('click.' + ns, function (e) {
e.preventDefault();
filesList.find('.delete input:checked')
@@ -565,90 +445,90 @@
});
},
- _destroyFileUploadButtonBar: function () {
- this.element.find('.fileupload-buttonbar')
- .removeClass('ui-widget-header ui-corner-top');
- this.element.find('.fileinput-button').each(function () {
- var fileInput = $(this).find('input:file').detach();
- $(this).button('destroy')
- .append(fileInput);
- });
+ _destroyButtonBarEventHandlers: function () {
this.element.find('.fileupload-buttonbar button')
- .unbind('click.' + this.options.namespace)
- .button('destroy');
+ .unbind('click.' + this.options.namespace);
this.element.find('.fileupload-buttonbar .toggle')
.unbind('change.' + this.options.namespace);
},
+ _initEventHandlers: function () {
+ $.blueimp.fileupload.prototype._initEventHandlers.call(this);
+ var eventData = {fileupload: this};
+ this._files
+ .delegate(
+ '.start button',
+ 'click.' + this.options.namespace,
+ eventData,
+ this._startHandler
+ )
+ .delegate(
+ '.cancel button',
+ 'click.' + this.options.namespace,
+ eventData,
+ this._cancelHandler
+ )
+ .delegate(
+ '.delete button',
+ 'click.' + this.options.namespace,
+ eventData,
+ this._deleteHandler
+ );
+ this._initButtonBarEventHandlers();
+ this._initTransitionSupport();
+ },
+
+ _destroyEventHandlers: function () {
+ this._destroyButtonBarEventHandlers();
+ this._files
+ .undelegate('.start button', 'click.' + this.options.namespace)
+ .undelegate('.cancel button', 'click.' + this.options.namespace)
+ .undelegate('.delete button', 'click.' + this.options.namespace);
+ $.blueimp.fileupload.prototype._destroyEventHandlers.call(this);
+ },
+
_enableFileInputButton: function () {
- this.element.find('.fileinput-button input:file:disabled')
- .each(function () {
- var fileInput = $(this),
- button = fileInput.parent();
- fileInput.detach().prop('disabled', false);
- button.button('enable').append(fileInput);
- });
+ this.element.find('.fileinput-button input')
+ .prop('disabled', false)
+ .parent().removeClass('disabled');
},
_disableFileInputButton: function () {
- this.element.find('.fileinput-button input:file:enabled')
- .each(function () {
- var fileInput = $(this),
- button = fileInput.parent();
- fileInput.detach().prop('disabled', true);
- button.button('disable').append(fileInput);
- });
+ this.element.find('.fileinput-button input')
+ .prop('disabled', true)
+ .parent().addClass('disabled');
},
_initTemplates: function () {
- // Handle cases where the templates are defined
- // after the widget library has been included:
- if (this.options.uploadTemplate instanceof $ &&
- !this.options.uploadTemplate.length) {
- this.options.uploadTemplate = $(
- this.options.uploadTemplate.selector
- );
- }
- if (this.options.downloadTemplate instanceof $ &&
- !this.options.downloadTemplate.length) {
- this.options.downloadTemplate = $(
- this.options.downloadTemplate.selector
- );
- }
+ this.options.templateContainer = document.createElement(
+ this._files.prop('nodeName')
+ );
+ this.options.uploadTemplate = window.tmpl('template-upload');
+ this.options.downloadTemplate = window.tmpl('template-download');
+ },
+
+ _initFiles: function () {
+ this._files = this.element.find('.files');
},
_create: function () {
+ this._initFiles();
$.blueimp.fileupload.prototype._create.call(this);
this._initTemplates();
- this.element
- .addClass('ui-widget');
- this._initFileUploadButtonBar();
- this.element.find('.fileupload-content')
- .addClass('ui-widget-content ui-corner-bottom');
- this.element.find('.fileupload-progressbar')
- .hide().progressbar();
},
destroy: function () {
- this.element.find('.fileupload-progressbar')
- .progressbar('destroy');
- this.element.find('.fileupload-content')
- .removeClass('ui-widget-content ui-corner-bottom');
- this._destroyFileUploadButtonBar();
- this.element.removeClass('ui-widget');
$.blueimp.fileupload.prototype.destroy.call(this);
},
enable: function () {
$.blueimp.fileupload.prototype.enable.call(this);
- this.element.find(':ui-button').not('.fileinput-button')
- .button('enable');
+ this.element.find('input, button').prop('disabled', false);
this._enableFileInputButton();
},
disable: function () {
- this.element.find(':ui-button').not('.fileinput-button')
- .button('disable');
+ this.element.find('input, button').prop('disabled', true);
this._disableFileInputButton();
$.blueimp.fileupload.prototype.disable.call(this);
}
View
9 vendor/assets/javascripts/jquery.fileupload.js 100644 → 100755
@@ -1,12 +1,12 @@
/*
- * jQuery File Upload Plugin 5.5.2
+ * jQuery File Upload Plugin 5.5.3
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
- * http://creativecommons.org/licenses/MIT/
+ * http://www.opensource.org/licenses/MIT
*/
/*jslint nomen: true, unparam: true, regexp: true */
@@ -716,7 +716,7 @@
},
_initEventHandlers: function () {
- var ns = this.options.namespace || this.widgetName;
+ var ns = this.options.namespace;
this.options.dropZone
.bind('dragover.' + ns, {fileupload: this}, this._onDragOver)
.bind('drop.' + ns, {fileupload: this}, this._onDrop)
@@ -726,7 +726,7 @@
},
_destroyEventHandlers: function () {
- var ns = this.options.namespace || this.widgetName;
+ var ns = this.options.namespace;
this.options.dropZone
.unbind('dragover.' + ns, this._onDragOver)
.unbind('drop.' + ns, this._onDrop)
@@ -763,6 +763,7 @@
_create: function () {
var options = this.options;
+ options.namespace = options.namespace || this.widgetName;
if (options.fileInput === undefined) {
options.fileInput = this.element.is('input:file') ?
this.element : this.element.find('input:file');
View
2  vendor/assets/javascripts/jquery.iframe-transport.js 100644 → 100755
@@ -6,7 +6,7 @@
* https://blueimp.net
*
* Licensed under the MIT license:
- * http://creativecommons.org/licenses/MIT/
+ * http://www.opensource.org/licenses/MIT
*/
/*jslint unparam: true, nomen: true */
View
2  vendor/assets/javascripts/jquery.postmessage-transport.js 100644 → 100755
@@ -6,7 +6,7 @@
* https://blueimp.net
*
* Licensed under the MIT license:
- * http://creativecommons.org/licenses/MIT/
+ * http://www.opensource.org/licenses/MIT
*/
/*jslint unparam: true, nomen: true */
View
2  vendor/assets/javascripts/jquery.xdr-transport.js 100644 → 100755
@@ -6,7 +6,7 @@
* https://blueimp.net
*
* Licensed under the MIT license:
- * http://creativecommons.org/licenses/MIT/
+ * http://www.opensource.org/licenses/MIT
*
* Based on Julian Aubourg's ajaxHooks xdr.js:
* https://github.com/jaubourg/ajaxHooks/
View
BIN  vendor/assets/stylesheets/.DS_Store
Binary file not shown
View
86 vendor/assets/stylesheets/jquery.fileupload-ui.css 100644 → 100755
@@ -1,16 +1,16 @@
@charset 'UTF-8';
/*
- * jQuery File Upload UI Plugin CSS 5.0.6
+ * jQuery File Upload UI Plugin CSS 6.0
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
- * http://creativecommons.org/licenses/MIT/
+ * http://www.opensource.org/licenses/MIT
*/
-.fileupload-buttonbar .ui-button input {
+.fileinput-button input {
position: absolute;
top: 0;
right: 0;
@@ -19,82 +19,38 @@
border-width: 0 0 100px 200px;
opacity: 0;
filter: alpha(opacity=0);
- -o-transform: translate(250px, -50px) scale(1);
-moz-transform: translate(-300px, 0) scale(4);
direction: ltr;
cursor: pointer;
}
.fileinput-button {
+ position: relative;
overflow: hidden;
+ float: left;
+ margin-right: 4px;
}
-/* Fix for IE 6: */
-*html .fileinput-button {
- padding: 2px 0;
-}
-
-/* Fix for IE 7: */
-*+html .fileinput-button {
- padding: 2px 0;
-}
-
-.fileupload-buttonbar {
- padding: 0.2em 0.4em;
-}
-
-.fileupload-buttonbar .ui-button {
- vertical-align: middle;
-}
-
-.fileupload-content {
- padding: 0.2em 0.4em;
- border-top-width: 0;
-}
-
-.fileupload-content .ui-progressbar {
+.progressbar,
+.progressbar div {
width: 200px;
height: 20px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3);
+ -moz-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3);
+ box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.3);
+ background: #fff;
}
-.fileupload-content .ui-progressbar-value {
- background: url(pbar-ani.gif);
+.progressbar div {
+ width: auto;
+ background: url(progressbar.gif);
}
-.fileupload-content .fileupload-progressbar {
+.fileupload-progressbar {
+ float: right;
width: 400px;
- margin: 10px 0;
-}
-
-.files {
- margin: 10px 0;
- border-collapse: collapse;
+ margin-top: 4px;
}
-
-.files td {
- padding: 5px;
- border-spacing: 5px;
-}
-
-.files img {
- border: none;
-}
-
-.files .name {
- padding: 0 10px;
-}
-
-.files .size {
- padding: 0 10px 0 0;
- text-align: right;
- white-space: nowrap;
-}
-
-.ui-state-disabled .ui-state-disabled {
- opacity: 1;
- filter: alpha(opacity=100);
-}
-
-.ui-state-disabled input {
- cursor: default;
-}
Something went wrong with that request. Please try again.