jquery-fileupload-rails 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +38 -16
- data/{vendor → app}/assets/images/loading.gif +0 -0
- data/{vendor → app}/assets/images/progressbar.gif +0 -0
- data/app/assets/javascripts/jquery-fileupload/angularjs.js +12 -0
- data/app/assets/javascripts/jquery-fileupload/basic-plus.js +11 -0
- data/app/assets/javascripts/jquery-fileupload/basic.js +3 -0
- data/{vendor → app}/assets/javascripts/jquery-fileupload/cors/jquery.postmessage-transport.js +4 -4
- data/{vendor → app}/assets/javascripts/jquery-fileupload/cors/jquery.xdr-transport.js +1 -2
- data/app/assets/javascripts/jquery-fileupload/index.js +13 -0
- data/app/assets/javascripts/jquery-fileupload/jquery-ui.js +13 -0
- data/app/assets/javascripts/jquery-fileupload/jquery.fileupload-angular.js +429 -0
- data/app/assets/javascripts/jquery-fileupload/jquery.fileupload-audio.js +106 -0
- data/app/assets/javascripts/jquery-fileupload/jquery.fileupload-image.js +315 -0
- data/app/assets/javascripts/jquery-fileupload/jquery.fileupload-jquery-ui.js +152 -0
- data/app/assets/javascripts/jquery-fileupload/jquery.fileupload-process.js +172 -0
- data/{vendor → app}/assets/javascripts/jquery-fileupload/jquery.fileupload-ui.js +178 -273
- data/app/assets/javascripts/jquery-fileupload/jquery.fileupload-validate.js +119 -0
- data/app/assets/javascripts/jquery-fileupload/jquery.fileupload-video.js +106 -0
- data/{vendor → app}/assets/javascripts/jquery-fileupload/jquery.fileupload.js +481 -188
- data/{vendor → app}/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js +43 -14
- data/{vendor → app}/assets/javascripts/jquery-fileupload/locale.js +0 -0
- data/{vendor → app}/assets/javascripts/jquery-fileupload/vendor/canvas-to-blob.js +9 -5
- data/{vendor → app}/assets/javascripts/jquery-fileupload/vendor/jquery.ui.widget.js +72 -44
- data/app/assets/javascripts/jquery-fileupload/vendor/load-image.all.min.js +1 -0
- data/{vendor → app}/assets/javascripts/jquery-fileupload/vendor/tmpl.js +9 -8
- data/app/assets/stylesheets/jquery.fileupload-noscript.scss +22 -0
- data/app/assets/stylesheets/jquery.fileupload-ui-noscript.scss +17 -0
- data/app/assets/stylesheets/jquery.fileupload-ui.scss +57 -0
- data/app/assets/stylesheets/jquery.fileupload.scss +36 -0
- data/lib/jquery/fileupload/rails/version.rb +1 -1
- metadata +43 -39
- data/vendor/assets/javascripts/jquery-fileupload/basic.js +0 -4
- data/vendor/assets/javascripts/jquery-fileupload/index.js +0 -9
- data/vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-fp.js +0 -223
- data/vendor/assets/javascripts/jquery-fileupload/vendor/load-image.js +0 -121
- data/vendor/assets/stylesheets/jquery.fileupload-ui.scss +0 -84
@@ -0,0 +1,17 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/*
|
3
|
+
* jQuery File Upload UI Plugin NoScript CSS 8.8.5
|
4
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
5
|
+
*
|
6
|
+
* Copyright 2012, Sebastian Tschan
|
7
|
+
* https://blueimp.net
|
8
|
+
*
|
9
|
+
* Licensed under the MIT license:
|
10
|
+
* http://www.opensource.org/licenses/MIT
|
11
|
+
*/
|
12
|
+
|
13
|
+
.fileinput-button i,
|
14
|
+
.fileupload-buttonbar .delete,
|
15
|
+
.fileupload-buttonbar .toggle {
|
16
|
+
display: none;
|
17
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/*
|
3
|
+
* jQuery File Upload UI Plugin CSS 9.0.0
|
4
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
5
|
+
*
|
6
|
+
* Copyright 2010, Sebastian Tschan
|
7
|
+
* https://blueimp.net
|
8
|
+
*
|
9
|
+
* Licensed under the MIT license:
|
10
|
+
* http://www.opensource.org/licenses/MIT
|
11
|
+
*/
|
12
|
+
|
13
|
+
.fileupload-buttonbar .btn,
|
14
|
+
.fileupload-buttonbar .toggle {
|
15
|
+
margin-bottom: 5px;
|
16
|
+
}
|
17
|
+
.progress-animated .progress-bar,
|
18
|
+
.progress-animated .bar {
|
19
|
+
background: image-url("progressbar.gif") !important;
|
20
|
+
filter: none;
|
21
|
+
}
|
22
|
+
.fileupload-process {
|
23
|
+
float: right;
|
24
|
+
display: none;
|
25
|
+
}
|
26
|
+
.fileupload-processing .fileupload-process,
|
27
|
+
.files .processing .preview {
|
28
|
+
display: block;
|
29
|
+
width: 32px;
|
30
|
+
height: 32px;
|
31
|
+
background: image-url("loading.gif") center no-repeat;
|
32
|
+
background-size: contain;
|
33
|
+
}
|
34
|
+
.files audio,
|
35
|
+
.files video {
|
36
|
+
max-width: 300px;
|
37
|
+
}
|
38
|
+
|
39
|
+
@media (max-width: 767px) {
|
40
|
+
.fileupload-buttonbar .toggle,
|
41
|
+
.files .toggle,
|
42
|
+
.files .btn span {
|
43
|
+
display: none;
|
44
|
+
}
|
45
|
+
.files .name {
|
46
|
+
width: 80px;
|
47
|
+
word-wrap: break-word;
|
48
|
+
}
|
49
|
+
.files audio,
|
50
|
+
.files video {
|
51
|
+
max-width: 80px;
|
52
|
+
}
|
53
|
+
.files img,
|
54
|
+
.files canvas {
|
55
|
+
max-width: 100%;
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/*
|
3
|
+
* jQuery File Upload Plugin CSS 1.3.0
|
4
|
+
* https://github.com/blueimp/jQuery-File-Upload
|
5
|
+
*
|
6
|
+
* Copyright 2013, Sebastian Tschan
|
7
|
+
* https://blueimp.net
|
8
|
+
*
|
9
|
+
* Licensed under the MIT license:
|
10
|
+
* http://www.opensource.org/licenses/MIT
|
11
|
+
*/
|
12
|
+
|
13
|
+
.fileinput-button {
|
14
|
+
position: relative;
|
15
|
+
overflow: hidden;
|
16
|
+
}
|
17
|
+
.fileinput-button input {
|
18
|
+
position: absolute;
|
19
|
+
top: 0;
|
20
|
+
right: 0;
|
21
|
+
margin: 0;
|
22
|
+
opacity: 0;
|
23
|
+
-ms-filter: 'alpha(opacity=0)';
|
24
|
+
font-size: 200px;
|
25
|
+
direction: ltr;
|
26
|
+
cursor: pointer;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* Fixes for IE < 8 */
|
30
|
+
@media screen\9 {
|
31
|
+
.fileinput-button input {
|
32
|
+
filter: alpha(opacity=0);
|
33
|
+
font-size: 100%;
|
34
|
+
height: 100%;
|
35
|
+
}
|
36
|
+
}
|
metadata
CHANGED
@@ -1,65 +1,58 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-fileupload-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tors Dalid
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: railties
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.1'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3.1'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: actionpack
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '3.1'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '3.1'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rails
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '3.1'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '3.1'
|
62
|
-
description: jQuery File Upload by Sebastian Tschan integrated for Rails 3.1 Asset
|
55
|
+
description: jQuery File Upload by Sebastian Tschan integrated for Rails 3.1+ Asset
|
63
56
|
Pipeline
|
64
57
|
email:
|
65
58
|
- cletedalid@gmail.com
|
@@ -72,46 +65,57 @@ files:
|
|
72
65
|
- lib/jquery/fileupload/rails/upload.rb
|
73
66
|
- lib/jquery/fileupload/rails/version.rb
|
74
67
|
- lib/jquery-fileupload-rails.rb
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
89
|
-
-
|
90
|
-
-
|
68
|
+
- app/assets/images/loading.gif
|
69
|
+
- app/assets/images/progressbar.gif
|
70
|
+
- app/assets/javascripts/jquery-fileupload/angularjs.js
|
71
|
+
- app/assets/javascripts/jquery-fileupload/basic-plus.js
|
72
|
+
- app/assets/javascripts/jquery-fileupload/basic.js
|
73
|
+
- app/assets/javascripts/jquery-fileupload/cors/jquery.postmessage-transport.js
|
74
|
+
- app/assets/javascripts/jquery-fileupload/cors/jquery.xdr-transport.js
|
75
|
+
- app/assets/javascripts/jquery-fileupload/index.js
|
76
|
+
- app/assets/javascripts/jquery-fileupload/jquery-ui.js
|
77
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-angular.js
|
78
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-audio.js
|
79
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-image.js
|
80
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-jquery-ui.js
|
81
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-process.js
|
82
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-ui.js
|
83
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-validate.js
|
84
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload-video.js
|
85
|
+
- app/assets/javascripts/jquery-fileupload/jquery.fileupload.js
|
86
|
+
- app/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js
|
87
|
+
- app/assets/javascripts/jquery-fileupload/locale.js
|
88
|
+
- app/assets/javascripts/jquery-fileupload/vendor/canvas-to-blob.js
|
89
|
+
- app/assets/javascripts/jquery-fileupload/vendor/jquery.ui.widget.js
|
90
|
+
- app/assets/javascripts/jquery-fileupload/vendor/load-image.all.min.js
|
91
|
+
- app/assets/javascripts/jquery-fileupload/vendor/tmpl.js
|
92
|
+
- app/assets/stylesheets/jquery.fileupload-noscript.scss
|
93
|
+
- app/assets/stylesheets/jquery.fileupload-ui-noscript.scss
|
94
|
+
- app/assets/stylesheets/jquery.fileupload-ui.scss
|
95
|
+
- app/assets/stylesheets/jquery.fileupload.scss
|
91
96
|
- Rakefile
|
92
97
|
- README.md
|
93
98
|
homepage: https://github.com/tors/jquery-fileupload-rails
|
94
99
|
licenses: []
|
100
|
+
metadata: {}
|
95
101
|
post_install_message:
|
96
102
|
rdoc_options: []
|
97
103
|
require_paths:
|
98
104
|
- lib
|
99
105
|
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
-
none: false
|
101
106
|
requirements:
|
102
|
-
- -
|
107
|
+
- - '>='
|
103
108
|
- !ruby/object:Gem::Version
|
104
109
|
version: '0'
|
105
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
111
|
requirements:
|
108
|
-
- -
|
112
|
+
- - '>='
|
109
113
|
- !ruby/object:Gem::Version
|
110
114
|
version: '0'
|
111
115
|
requirements: []
|
112
116
|
rubyforge_project: jquery-fileupload-rails
|
113
|
-
rubygems_version:
|
117
|
+
rubygems_version: 2.0.14
|
114
118
|
signing_key:
|
115
|
-
specification_version:
|
116
|
-
summary: jQuery File Upload for Rails 3.1 Asset Pipeline
|
119
|
+
specification_version: 4
|
120
|
+
summary: jQuery File Upload for Rails 3.1+ Asset Pipeline
|
117
121
|
test_files: []
|
@@ -1,9 +0,0 @@
|
|
1
|
-
//=require jquery-fileupload/vendor/jquery.ui.widget
|
2
|
-
//=require jquery-fileupload/vendor/load-image
|
3
|
-
//=require jquery-fileupload/vendor/canvas-to-blob
|
4
|
-
//=require jquery-fileupload/vendor/tmpl
|
5
|
-
//=require jquery-fileupload/jquery.iframe-transport
|
6
|
-
//=require jquery-fileupload/jquery.fileupload
|
7
|
-
//=require jquery-fileupload/jquery.fileupload-fp
|
8
|
-
//=require jquery-fileupload/jquery.fileupload-ui
|
9
|
-
//=require jquery-fileupload/locale
|
@@ -1,223 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery File Upload File Processing Plugin 1.2.1
|
3
|
-
* https://github.com/blueimp/jQuery-File-Upload
|
4
|
-
*
|
5
|
-
* Copyright 2012, Sebastian Tschan
|
6
|
-
* https://blueimp.net
|
7
|
-
*
|
8
|
-
* Licensed under the MIT license:
|
9
|
-
* http://www.opensource.org/licenses/MIT
|
10
|
-
*/
|
11
|
-
|
12
|
-
/*jslint nomen: true, unparam: true, regexp: true */
|
13
|
-
/*global define, window, document */
|
14
|
-
|
15
|
-
(function (factory) {
|
16
|
-
'use strict';
|
17
|
-
if (typeof define === 'function' && define.amd) {
|
18
|
-
// Register as an anonymous AMD module:
|
19
|
-
define([
|
20
|
-
'jquery',
|
21
|
-
'load-image',
|
22
|
-
'canvas-to-blob',
|
23
|
-
'./jquery.fileupload'
|
24
|
-
], factory);
|
25
|
-
} else {
|
26
|
-
// Browser globals:
|
27
|
-
factory(
|
28
|
-
window.jQuery,
|
29
|
-
window.loadImage
|
30
|
-
);
|
31
|
-
}
|
32
|
-
}(function ($, loadImage) {
|
33
|
-
'use strict';
|
34
|
-
|
35
|
-
// The File Upload FP version extends the fileupload widget
|
36
|
-
// with file processing functionality:
|
37
|
-
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
38
|
-
|
39
|
-
options: {
|
40
|
-
// The list of file processing actions:
|
41
|
-
process: [
|
42
|
-
/*
|
43
|
-
{
|
44
|
-
action: 'load',
|
45
|
-
fileTypes: /^image\/(gif|jpeg|png)$/,
|
46
|
-
maxFileSize: 20000000 // 20MB
|
47
|
-
},
|
48
|
-
{
|
49
|
-
action: 'resize',
|
50
|
-
maxWidth: 1920,
|
51
|
-
maxHeight: 1200,
|
52
|
-
minWidth: 800,
|
53
|
-
minHeight: 600
|
54
|
-
},
|
55
|
-
{
|
56
|
-
action: 'save'
|
57
|
-
}
|
58
|
-
*/
|
59
|
-
],
|
60
|
-
|
61
|
-
// The add callback is invoked as soon as files are added to the
|
62
|
-
// fileupload widget (via file input selection, drag & drop or add
|
63
|
-
// API call). See the basic file upload widget for more information:
|
64
|
-
add: function (e, data) {
|
65
|
-
$(this).fileupload('process', data).done(function () {
|
66
|
-
data.submit();
|
67
|
-
});
|
68
|
-
}
|
69
|
-
},
|
70
|
-
|
71
|
-
processActions: {
|
72
|
-
// Loads the image given via data.files and data.index
|
73
|
-
// as img element if the browser supports canvas.
|
74
|
-
// Accepts the options fileTypes (regular expression)
|
75
|
-
// and maxFileSize (integer) to limit the files to load:
|
76
|
-
load: function (data, options) {
|
77
|
-
var that = this,
|
78
|
-
file = data.files[data.index],
|
79
|
-
dfd = $.Deferred();
|
80
|
-
if (window.HTMLCanvasElement &&
|
81
|
-
window.HTMLCanvasElement.prototype.toBlob &&
|
82
|
-
($.type(options.maxFileSize) !== 'number' ||
|
83
|
-
file.size < options.maxFileSize) &&
|
84
|
-
(!options.fileTypes ||
|
85
|
-
options.fileTypes.test(file.type))) {
|
86
|
-
loadImage(
|
87
|
-
file,
|
88
|
-
function (img) {
|
89
|
-
if (!img.src) {
|
90
|
-
return dfd.rejectWith(that, [data]);
|
91
|
-
}
|
92
|
-
data.img = img;
|
93
|
-
dfd.resolveWith(that, [data]);
|
94
|
-
}
|
95
|
-
);
|
96
|
-
} else {
|
97
|
-
dfd.rejectWith(that, [data]);
|
98
|
-
}
|
99
|
-
return dfd.promise();
|
100
|
-
},
|
101
|
-
// Resizes the image given as data.img and updates
|
102
|
-
// data.canvas with the resized image as canvas element.
|
103
|
-
// Accepts the options maxWidth, maxHeight, minWidth and
|
104
|
-
// minHeight to scale the given image:
|
105
|
-
resize: function (data, options) {
|
106
|
-
var img = data.img,
|
107
|
-
canvas;
|
108
|
-
options = $.extend({canvas: true}, options);
|
109
|
-
if (img) {
|
110
|
-
canvas = loadImage.scale(img, options);
|
111
|
-
if (canvas.width !== img.width ||
|
112
|
-
canvas.height !== img.height) {
|
113
|
-
data.canvas = canvas;
|
114
|
-
}
|
115
|
-
}
|
116
|
-
return data;
|
117
|
-
},
|
118
|
-
// Saves the processed image given as data.canvas
|
119
|
-
// inplace at data.index of data.files:
|
120
|
-
save: function (data, options) {
|
121
|
-
// Do nothing if no processing has happened:
|
122
|
-
if (!data.canvas) {
|
123
|
-
return data;
|
124
|
-
}
|
125
|
-
var that = this,
|
126
|
-
file = data.files[data.index],
|
127
|
-
name = file.name,
|
128
|
-
dfd = $.Deferred(),
|
129
|
-
callback = function (blob) {
|
130
|
-
if (!blob.name) {
|
131
|
-
if (file.type === blob.type) {
|
132
|
-
blob.name = file.name;
|
133
|
-
} else if (file.name) {
|
134
|
-
blob.name = file.name.replace(
|
135
|
-
/\..+$/,
|
136
|
-
'.' + blob.type.substr(6)
|
137
|
-
);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
// Store the created blob at the position
|
141
|
-
// of the original file in the files list:
|
142
|
-
data.files[data.index] = blob;
|
143
|
-
dfd.resolveWith(that, [data]);
|
144
|
-
};
|
145
|
-
// Use canvas.mozGetAsFile directly, to retain the filename, as
|
146
|
-
// Gecko doesn't support the filename option for FormData.append:
|
147
|
-
if (data.canvas.mozGetAsFile) {
|
148
|
-
callback(data.canvas.mozGetAsFile(
|
149
|
-
(/^image\/(jpeg|png)$/.test(file.type) && name) ||
|
150
|
-
((name && name.replace(/\..+$/, '')) ||
|
151
|
-
'blob') + '.png',
|
152
|
-
file.type
|
153
|
-
));
|
154
|
-
} else {
|
155
|
-
data.canvas.toBlob(callback, file.type);
|
156
|
-
}
|
157
|
-
return dfd.promise();
|
158
|
-
}
|
159
|
-
},
|
160
|
-
|
161
|
-
// Resizes the file at the given index and stores the created blob at
|
162
|
-
// the original position of the files list, returns a Promise object:
|
163
|
-
_processFile: function (files, index, options) {
|
164
|
-
var that = this,
|
165
|
-
dfd = $.Deferred().resolveWith(that, [{
|
166
|
-
files: files,
|
167
|
-
index: index
|
168
|
-
}]),
|
169
|
-
chain = dfd.promise();
|
170
|
-
that._processing += 1;
|
171
|
-
$.each(options.process, function (i, settings) {
|
172
|
-
chain = chain.pipe(function (data) {
|
173
|
-
return that.processActions[settings.action]
|
174
|
-
.call(this, data, settings);
|
175
|
-
});
|
176
|
-
});
|
177
|
-
chain.always(function () {
|
178
|
-
that._processing -= 1;
|
179
|
-
if (that._processing === 0) {
|
180
|
-
that.element
|
181
|
-
.removeClass('fileupload-processing');
|
182
|
-
}
|
183
|
-
});
|
184
|
-
if (that._processing === 1) {
|
185
|
-
that.element.addClass('fileupload-processing');
|
186
|
-
}
|
187
|
-
return chain;
|
188
|
-
},
|
189
|
-
|
190
|
-
// Processes the files given as files property of the data parameter,
|
191
|
-
// returns a Promise object that allows to bind a done handler, which
|
192
|
-
// will be invoked after processing all files (inplace) is done:
|
193
|
-
process: function (data) {
|
194
|
-
var that = this,
|
195
|
-
options = $.extend({}, this.options, data);
|
196
|
-
if (options.process && options.process.length &&
|
197
|
-
this._isXHRUpload(options)) {
|
198
|
-
$.each(data.files, function (index, file) {
|
199
|
-
that._processingQueue = that._processingQueue.pipe(
|
200
|
-
function () {
|
201
|
-
var dfd = $.Deferred();
|
202
|
-
that._processFile(data.files, index, options)
|
203
|
-
.always(function () {
|
204
|
-
dfd.resolveWith(that);
|
205
|
-
});
|
206
|
-
return dfd.promise();
|
207
|
-
}
|
208
|
-
);
|
209
|
-
});
|
210
|
-
}
|
211
|
-
return this._processingQueue;
|
212
|
-
},
|
213
|
-
|
214
|
-
_create: function () {
|
215
|
-
this._super();
|
216
|
-
this._processing = 0;
|
217
|
-
this._processingQueue = $.Deferred().resolveWith(this)
|
218
|
-
.promise();
|
219
|
-
}
|
220
|
-
|
221
|
-
});
|
222
|
-
|
223
|
-
}));
|