Skip to content

Commit 6bcbcf3

Browse files
committed
+ merge gh-pages
2 parents e91fc1e + 78a0aa9 commit 6bcbcf3

File tree

165 files changed

+23101
-1697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+23101
-1697
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

FileAPI.class.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

FileAPI.flash.image.swf

-1.98 KB
Binary file not shown.

FileAPI.flash.swf

-31.6 KB
Binary file not shown.

FileAPI.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

FileAPI.min.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

Gruntfile.js

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
'use strict';
2+
3+
module.exports = function (grunt){
4+
// Project configuration.
5+
grunt.initConfig({
6+
pkg: grunt.file.readJSON('package.json'),
7+
8+
jshint: {
9+
all: [
10+
'Gruntfile.js'
11+
, 'lib/**/*.js'
12+
, 'plugins/jquery.fileapi.js'
13+
],
14+
15+
options: {
16+
curly: true // + "Expected '{' and instead saw 'XXXX'."
17+
, immed: true
18+
, latedef: true
19+
, newcap: true // "Tolerate uncapitalized constructors"
20+
, noarg: true
21+
, sub: true
22+
, undef: true
23+
, unused: true
24+
, boss: true
25+
, eqnull: true
26+
27+
, node: true
28+
, es5: true
29+
, expr: true // - "Expected an assignment or function call and instead saw an expression."
30+
, supernew: true // - "Missing '()' invoking a constructor."
31+
, laxcomma: true
32+
, laxbreak: true
33+
, smarttabs: true
34+
}
35+
},
36+
37+
version: {
38+
src: 'lib/FileAPI.core.js'
39+
},
40+
41+
qunit: {
42+
options: {
43+
files: {
44+
'1px.gif': ['tests/files/1px.gif']
45+
, 'hello.txt': ['tests/files/hello.txt']
46+
, 'image.jpg': ['tests/files/image.jpg']
47+
, 'dino.png': ['tests/files/dino.png']
48+
, 'multiple': ['tests/files/1px.gif', 'tests/files/hello.txt', 'tests/files/image.jpg', 'tests/files/dino.png', 'tests/files/lebowski.json']
49+
}
50+
},
51+
all: ['tests/*.html']
52+
},
53+
54+
concat: {
55+
options: {
56+
banner: '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %>\n' +
57+
' * <%= pkg.description %>\n' +
58+
' */\n\n',
59+
60+
footer: 'if( typeof define === "function" && define.amd ){ define("FileAPI", [], function (){ return FileAPI; }); }'
61+
},
62+
63+
all: {
64+
src: [
65+
'lib/FileAPI.core.js'
66+
, 'lib/FileAPI.Image.js'
67+
, 'lib/FileAPI.Form.js'
68+
, 'lib/FileAPI.XHR.js'
69+
, 'lib/FileAPI.Camera.js'
70+
, 'lib/FileAPI.Flash.js'
71+
, 'lib/load-image-ios.js'
72+
, 'lib/canvas-to-blob.js'
73+
],
74+
dest: 'dist/<%= pkg.name %>.js'
75+
},
76+
77+
html5: {
78+
src: [
79+
'lib/FileAPI.core.js'
80+
, 'lib/FileAPI.Image.js'
81+
, 'lib/FileAPI.Form.js'
82+
, 'lib/FileAPI.XHR.js'
83+
, 'lib/FileAPI.Camera.js'
84+
, 'lib/load-image-ios.js'
85+
, 'lib/canvas-to-blob.js'
86+
],
87+
dest: 'dist/<%= pkg.name %>.html5.js'
88+
}
89+
},
90+
91+
uglify: {
92+
options: { banner: '/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.license %> | <%= pkg.repository.url %> */\n' },
93+
dist: {
94+
files: {
95+
'dist/<%= pkg.name %>.min.js': ['<%= concat.all.dest %>']
96+
, 'dist/<%= pkg.name %>.html5.min.js': ['<%= concat.html5.dest %>']
97+
}
98+
}
99+
},
100+
101+
watch: {
102+
scripts: {
103+
files: 'lib/**/*.js',
104+
tasks: ['concat'],
105+
options: { interrupt: true }
106+
}
107+
}
108+
});
109+
110+
111+
// These plugins provide necessary tasks.
112+
grunt.loadNpmTasks('grunt-version');
113+
grunt.loadNpmTasks('grunt-contrib-jshint');
114+
grunt.loadNpmTasks('grunt-contrib-concat');
115+
grunt.loadNpmTasks('grunt-contrib-uglify');
116+
grunt.loadNpmTasks('grunt-contrib-watch');
117+
118+
// Load custom QUnit task, based on grunt-contrib-qunit, but support "files" option.
119+
grunt.loadTasks('./tests/grunt-task/');
120+
121+
// "npm build" runs these tasks
122+
grunt.registerTask('build', ['version', 'concat', 'uglify', 'qunit']);
123+
grunt.registerTask('default', ['jshint', 'build']);
124+
};

0 commit comments

Comments
 (0)