Skip to content

Commit ba4073a

Browse files
committed
- Added Grunt
- Modified formData to contain serialized form object
1 parent b881329 commit ba4073a

File tree

11 files changed

+1801
-16
lines changed

11 files changed

+1801
-16
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
npm-debug.log

Gruntfile.js

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
module.exports = function (grunt) {
2+
3+
grunt.initConfig({
4+
5+
pkg: grunt.file.readJSON('package.json'),
6+
7+
banner: '/*!\n' +
8+
' * jQuery Form Validation\n' +
9+
' * Copyright (C) 2015 RunningCoder.org\n' +
10+
' * Licensed under the MIT license\n' +
11+
' *\n' +
12+
' * @author <%= pkg.author.name %>\n' +
13+
' * @version <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>)\n' +
14+
' * @link http://www.runningcoder.org/jqueryvalidation/\n' +
15+
'*/\n',
16+
17+
clean: {
18+
dist: ["dist"]
19+
},
20+
21+
copy: {
22+
dist: {
23+
files: [
24+
{
25+
src: ['src/jquery.validation.js'],
26+
dest: 'dist/jquery.validation.js'
27+
},
28+
{
29+
src: ['src/jquery.validation.js'],
30+
dest: 'dist/jquery.validation.min.js'
31+
}
32+
]
33+
}
34+
},
35+
36+
comments: {
37+
dist: {
38+
options: {
39+
singleline: true,
40+
multiline: true
41+
},
42+
src: [ 'dist/*.js']
43+
}
44+
},
45+
46+
replace: {
47+
banner: {
48+
options: {
49+
patterns: [
50+
{
51+
match: /\/\*![\S\s]+?\*\/[\r\n]*/,
52+
replacement: '<%= banner %>'
53+
}
54+
]
55+
},
56+
files: [
57+
{
58+
src: ['src/jquery.validation.js'],
59+
dest: 'src/jquery.validation.js'
60+
}
61+
]
62+
},
63+
removeDebug: {
64+
options: {
65+
patterns: [
66+
{
67+
match: /\s?\{debug\}[\s\S]*?\{\/debug\}/g,
68+
replacement: ''
69+
}
70+
]
71+
},
72+
files: [
73+
{
74+
src: ['dist/jquery.validation.min.js'],
75+
dest: 'dist/jquery.validation.min.js'
76+
}
77+
]
78+
},
79+
removeComments: {
80+
options: {
81+
patterns: [
82+
{
83+
match: /\/\*[^!][\S\s]+?\*\/[\r\n]?/gm,
84+
replacement: ''
85+
}
86+
]
87+
},
88+
files: [
89+
{
90+
src: ['dist/jquery.validation.js'],
91+
dest: 'dist/jquery.validation.js'
92+
}
93+
]
94+
}
95+
},
96+
97+
uglify: {
98+
dist: {
99+
options: {
100+
mangle: true,
101+
compress: true,
102+
banner: '<%= banner %>'
103+
},
104+
files: {
105+
'dist/jquery.validation.min.js': ['dist/jquery.validation.min.js']
106+
}
107+
}
108+
109+
}
110+
111+
});
112+
113+
grunt.loadNpmTasks('grunt-contrib-clean');
114+
grunt.loadNpmTasks('grunt-contrib-copy');
115+
grunt.loadNpmTasks('grunt-stripcomments');
116+
grunt.loadNpmTasks('grunt-replace');
117+
grunt.loadNpmTasks('grunt-contrib-uglify');
118+
119+
grunt.registerTask('default', [
120+
'clean:dist',
121+
'replace:banner',
122+
'copy:dist',
123+
'comments',
124+
'replace:removeComments',
125+
'replace:removeDebug',
126+
'uglify'
127+
]);
128+
129+
};

bower.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"validation",
1414
"input"
1515
],
16+
"ignore": [],
1617
"licenses": "MIT",
1718
"homepage": "http://www.runningcoder.org/jqueryvalidation/",
1819
"repository": {

0 commit comments

Comments
 (0)