Skip to content

Commit 98590cd

Browse files
author
Mikhail Bezoyan
committed
fixes
1 parent 7378099 commit 98590cd

13 files changed

+40
-25
lines changed

Gruntfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ module.exports = function (grunt) {
173173
grunt.loadNpmTasks('grunt-contrib-uglify');
174174
grunt.loadNpmTasks('grunt-contrib-watch');
175175
grunt.loadNpmTasks('grunt-contrib-connect');
176+
grunt.loadNpmTasks('grunt-contrib-compress');
176177
grunt.loadNpmTasks('grunt-mxmlc');
177178
grunt.loadNpmTasks('grunt-curl');
178179
// Load custom QUnit task, based on grunt-contrib-qunit, but support "files" option.

custom-tasks/grunt-ok.js custom-tasks/Gruntfile-ok.js

+12
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,16 @@ module.exports = function (grunt) {
3636
}
3737
});
3838

39+
grunt.config.set('compress.main', {
40+
options: {
41+
archive: '<%= pkg.name %>-<%= pkg.version.replace(/\\./g,"-") %>.zip'
42+
},
43+
files: [
44+
{cwd: 'dist/', expand: true, src: ['*'], dest: '<%= pkg.version.replace(/\\./g,"-") %>/'}
45+
]
46+
});
47+
48+
49+
grunt.registerTask('build-zip', ['build', 'compress']);
50+
3951
};

dist/FileAPI.flash.camera.swf

-1 Bytes
Binary file not shown.

dist/FileAPI.flash.image.swf

2 Bytes
Binary file not shown.

dist/FileAPI.flash.swf

-2 Bytes
Binary file not shown.

dist/FileAPI.html5.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! FileAPI 2.0.3 - BSD | git://github.com/mailru/FileAPI.git
1+
/*! FileAPI 2.0.3b - BSD | git://github.com/mailru/FileAPI.git
22
* FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF.
33
*/
44

@@ -201,7 +201,7 @@
201201
_elEvents[uid] = {};
202202
}
203203

204-
var isFileReader = FileReader !=null && el instanceof FileReader;
204+
var isFileReader = (FileReader && el) && (el instanceof FileReader);
205205
_each(type.split(/\s+/), function (type){
206206
if( jQuery && !isFileReader){
207207
jQuery.event.add(el, type, fn);
@@ -228,7 +228,7 @@
228228
if( el ){
229229
var uid = api.uid(el), events = _elEvents[uid] || {};
230230

231-
var isFileReader = FileReader != null && el instanceof FileReader;
231+
var isFileReader = (FileReader && el) && (el instanceof FileReader);
232232
_each(type.split(/\s+/), function (type){
233233
if( jQuery && !isFileReader){
234234
jQuery.event.remove(el, type, fn);
@@ -278,7 +278,7 @@
278278
* FileAPI (core object)
279279
*/
280280
api = {
281-
version: '2.0.3',
281+
version: '2.0.3b',
282282

283283
cors: false,
284284
html5: true,
@@ -2968,7 +2968,7 @@
29682968
xhr.send(slice);
29692969
}
29702970

2971-
xhr.send(slice);
2971+
// xhr.send(slice);
29722972
file = slice = null;
29732973
} else {
29742974
// single piece upload

dist/FileAPI.html5.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/FileAPI.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! FileAPI 2.0.3 - BSD | git://github.com/mailru/FileAPI.git
1+
/*! FileAPI 2.0.3b - BSD | git://github.com/mailru/FileAPI.git
22
* FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF.
33
*/
44

@@ -201,7 +201,7 @@
201201
_elEvents[uid] = {};
202202
}
203203

204-
var isFileReader = FileReader !=null && el instanceof FileReader;
204+
var isFileReader = (FileReader && el) && (el instanceof FileReader);
205205
_each(type.split(/\s+/), function (type){
206206
if( jQuery && !isFileReader){
207207
jQuery.event.add(el, type, fn);
@@ -228,7 +228,7 @@
228228
if( el ){
229229
var uid = api.uid(el), events = _elEvents[uid] || {};
230230

231-
var isFileReader = FileReader != null && el instanceof FileReader;
231+
var isFileReader = (FileReader && el) && (el instanceof FileReader);
232232
_each(type.split(/\s+/), function (type){
233233
if( jQuery && !isFileReader){
234234
jQuery.event.remove(el, type, fn);
@@ -278,7 +278,7 @@
278278
* FileAPI (core object)
279279
*/
280280
api = {
281-
version: '2.0.3',
281+
version: '2.0.3b',
282282

283283
cors: false,
284284
html5: true,
@@ -2968,7 +2968,7 @@
29682968
xhr.send(slice);
29692969
}
29702970

2971-
xhr.send(slice);
2971+
// xhr.send(slice);
29722972
file = slice = null;
29732973
} else {
29742974
// single piece upload
@@ -3859,7 +3859,7 @@
38593859
return this.parent.apply(this, arguments);
38603860
}
38613861
else {
3862-
api.log('FlashAPI.XHR._send: '+ flashId +' -> '+ fileId, JSON.stringify(files));
3862+
api.log('FlashAPI.XHR._send: '+ flashId +' -> '+ fileId);
38633863
}
38643864

38653865
_this.xhr = {
@@ -3878,7 +3878,7 @@
38783878
, callback: _wrap(function upload(evt){
38793879
var type = evt.type, result = evt.result;
38803880

3881-
api.log('FlashAPI.upload.'+type+':' + JSON.stringify(evt));
3881+
api.log('FlashAPI.upload.'+type);
38823882

38833883
if( type == 'progress' ){
38843884
evt.loaded = Math.min(evt.loaded, evt.total); // @todo fixme

dist/FileAPI.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/FileAPI.Flash.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@
565565
return this.parent.apply(this, arguments);
566566
}
567567
else {
568-
api.log('FlashAPI.XHR._send: '+ flashId +' -> '+ fileId, JSON.stringify(files));
568+
api.log('FlashAPI.XHR._send: '+ flashId +' -> '+ fileId);
569569
}
570570

571571
_this.xhr = {
@@ -584,7 +584,7 @@
584584
, callback: _wrap(function upload(evt){
585585
var type = evt.type, result = evt.result;
586586

587-
api.log('FlashAPI.upload.'+type+':' + JSON.stringify(evt));
587+
api.log('FlashAPI.upload.'+type);
588588

589589
if( type == 'progress' ){
590590
evt.loaded = Math.min(evt.loaded, evt.total); // @todo fixme

lib/FileAPI.XHR.js

-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@
312312
xhr.send(slice);
313313
}
314314

315-
xhr.send(slice);
316315
file = slice = null;
317316
} else {
318317
// single piece upload

lib/FileAPI.core.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
_elEvents[uid] = {};
108108
}
109109

110-
var isFileReader = FileReader !=null && el instanceof FileReader;
110+
var isFileReader = (FileReader && el) && (el instanceof FileReader);
111111
_each(type.split(/\s+/), function (type){
112112
if( jQuery && !isFileReader){
113113
jQuery.event.add(el, type, fn);
@@ -134,7 +134,7 @@
134134
if( el ){
135135
var uid = api.uid(el), events = _elEvents[uid] || {};
136136

137-
var isFileReader = FileReader != null && el instanceof FileReader;
137+
var isFileReader = (FileReader && el) && (el instanceof FileReader);
138138
_each(type.split(/\s+/), function (type){
139139
if( jQuery && !isFileReader){
140140
jQuery.event.remove(el, type, fn);
@@ -184,7 +184,7 @@
184184
* FileAPI (core object)
185185
*/
186186
api = {
187-
version: '2.0.3',
187+
version: '2.0.3b',
188188

189189
cors: false,
190190
html5: true,

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"semver": "~1.0.14",
1515
"temporary": "~0.0.4",
1616
"phantomjs": "~1.9.2-4",
17-
"grunt-mxmlc": "~0.2.0"
17+
"grunt-curl": "~1.4.0",
18+
"grunt-mxmlc": "~0.2.0",
19+
"grunt-contrib-compress": "~0.6.0"
1820
},
1921
"description": "FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF.",
2022
"main": "dist/FileAPI.js",
@@ -35,7 +37,8 @@
3537
"author": "Konstantin Lebedev <[email protected]>",
3638
"contributors": [
3739
"Vladimir Demidov <[email protected]>",
38-
"Ilya Lebedev <[email protected]>"
40+
"Ilya Lebedev <[email protected]>",
41+
"Mikhail Bezoyan <[email protected]>"
3942
],
4043
"license": "BSD"
4144
}

0 commit comments

Comments
 (0)