Skip to content

Commit e690c71

Browse files
committedSep 23, 2013
refactor core API module + add maven minifier on install phase
1 parent 06c9810 commit e690c71

File tree

5 files changed

+1141
-31
lines changed

5 files changed

+1141
-31
lines changed
 

‎src/jsv.js ‎core/build/js/jsv.js

+29-29
Original file line numberDiff line numberDiff line change
@@ -256,36 +256,36 @@ JSValidator.Form.prototype = {
256256

257257
fields.forEach(function (field) {
258258
field.bindValidationToEvent("submit");
259-
}),
260-
261-
JSValidator.Utils._bindEvent(instance.formElement, "submit", function (event) {
262-
263-
// Do preValidation
264-
instance._doAction(event, null, "preSubmitValidationProcess");
265-
266-
var validate = true;
267-
instance.getFields().forEach(function (field) {
268-
field._doValidateField(event, field, function (ruleViolation) {
269-
var ruleViolationsByField = [];
270-
271-
if (ruleViolation.length > 0) {
272-
validate = false;
273-
ruleViolationsByField.push({
274-
field: field.name,
275-
ruleViolations: ruleViolation
276-
})
277-
}
278-
279-
// Do postValidation
280-
instance._doAction(event, ruleViolationsByField, "postSubmitValidationProcess");
281-
282-
// if errors don't send the form
283-
if (ruleViolationsByField.length > 0) {
284-
event.preventDefault();
285-
}
286-
});
259+
});
260+
261+
JSValidator.Utils._bindEvent(instance.formElement, "submit", function (event) {
262+
263+
// Do preValidation
264+
instance._doAction(event, null, "preSubmitValidationProcess");
265+
266+
var validate = true;
267+
instance.getFields().forEach(function (field) {
268+
field._doValidateField(event, field, function (ruleViolation) {
269+
var ruleViolationsByField = [];
270+
271+
if (ruleViolation.length > 0) {
272+
validate = false;
273+
ruleViolationsByField.push({
274+
field: field.name,
275+
ruleViolations: ruleViolation
276+
})
277+
}
278+
279+
// Do postValidation
280+
instance._doAction(event, ruleViolationsByField, "postSubmitValidationProcess");
281+
282+
// if errors don't send the form
283+
if (ruleViolationsByField.length > 0) {
284+
event.preventDefault();
285+
}
287286
});
288-
}, false);
287+
});
288+
}, false);
289289

290290
return instance.actions;
291291
},

‎core/build/js/jsv.min.js

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

‎core/pom.xml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>fr.ippon.jsv</groupId>
5+
<artifactId>JSV</artifactId>
6+
<packaging>pom</packaging>
7+
<version>1.0-SNAPSHOT</version>
8+
<name>JSV - JavaScript Validator API</name>
9+
10+
<build>
11+
<plugins>
12+
<!-- ... -->
13+
<plugin>
14+
<groupId>com.samaxes.maven</groupId>
15+
<artifactId>minify-maven-plugin</artifactId>
16+
<version>1.7.2</version>
17+
<executions>
18+
<execution>
19+
<id>default-minify</id>
20+
<phase>install</phase>
21+
<configuration>
22+
<charset>UTF-8</charset>
23+
<webappSourceDir>./src</webappSourceDir>
24+
<webappTargetDir>./build</webappTargetDir>
25+
<jsSourceIncludes>
26+
<jsSourceInclude>**</jsSourceInclude>
27+
</jsSourceIncludes>
28+
<jsSourceExcludes>
29+
<jsSourceExclude>**/*.min.js</jsSourceExclude>
30+
</jsSourceExcludes>
31+
<jsEngine>YUI</jsEngine>
32+
<jsFinalFile>jsv.js</jsFinalFile>
33+
</configuration>
34+
<goals>
35+
<goal>minify</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
</plugin>
40+
<!-- ... -->
41+
</plugins>
42+
</build>
43+
</project>

0 commit comments

Comments
 (0)
Please sign in to comment.