Skip to content

Commit b84e5b3

Browse files
committed
merge pull request
2 parents b65e888 + 90feaa7 commit b84e5b3

Some content is hidden

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

55 files changed

+2531
-58
lines changed

JqueryValidationUiGrailsPlugin.groovy

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2010-2012 the original author or authors.
1+
/* Copyright 2010 the original author or authors.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
2121
*/
2222
class JqueryValidationUiGrailsPlugin {
2323
// the plugin version
24-
def version = "1.2.4"
24+
def version = "1.2.4-SNAPSHOT"
2525
// the version or versions of Grails the plugin is designed for
2626
def grailsVersion = "1.2.2 > *"
2727
// the other plugins this plugin depends on
@@ -31,13 +31,14 @@ class JqueryValidationUiGrailsPlugin {
3131
"grails-app/views/error.gsp"
3232
]
3333

34+
def license = "APACHE"
3435
def author = "Lim Chee Kin"
3536
def authorEmail = "[email protected]"
36-
// Additional developers
37-
def developers = [
38-
[name:"Brian Saville", email:"[email protected]"],
39-
]
40-
37+
// Additional developers
38+
def developers = [
39+
[name:"Brian Saville", email:"[email protected]"],
40+
]
41+
4142
def title = "JQuery Validation UI Plugin - Client Side Validation without writing JavaScript"
4243
def description = '''\
4344
Grails Validation mechanism is great, I like it!
@@ -52,19 +53,19 @@ JQuery Validation plugin as it's validation engine, it had it's own solution kno
5253
The JQuery Validation UI Plugin will bring Javascript Validator, Remote Constraints, jQuery Validation plugin and [qTip (jQuery tooltip plugin)|http://craigsworks.com/projects/qtip_new/] under the same root and
5354
deliver solution more than the jQuery Validation Engine. In short, when someone ask you what is JQuery Validation UI Plugin, just show them the following code block:
5455
{code}
55-
Javascript Validator + Remote Constraints + Custom Constraints + jQuery Validation plugin + qTip
56+
Javascript Validator + Remote Constraints + jQuery Validation plugin + qTip
5657
> jQuery Validation Engine
5758
{code}
5859
59-
* Source code: http://github.com/limcheekin/jquery-validation-ui
60+
* Source code: http://code.google.com/p/jquery-validation-ui-plugin/
6061
* Documentation: http://limcheekin.github.com/jquery-validation-ui
61-
* Support: https://github.com/limcheekin/jquery-validation-ui/issues
62+
* Support: https://github.com/limcheekin/jquery-validation-ui/issues
6263
** Older bugs available here: http://code.google.com/p/jquery-validation-ui-plugin/issues/list
6364
* Discussion Forum: http://groups.google.com/group/jquery-validation-ui-plugin
6465
'''
6566

6667
// URL to the plugin's documentation
6768
def documentation = "http://limcheekin.github.com/jquery-validation-ui"
68-
def issueManagement = [ system:"GitHub", url:"http://github.com/limcheekin/jquery-validation-ui/issues" ]
69-
def scm = [ url:"http://github.com/limcheekin/jquery-validation-ui" ]
69+
def issueManagement = [ system:"GitHub", url:"http://github.com/limcheekin/jquery-validation-ui/issues" ]
70+
def scm = [ url:"http://github.com/limcheekin/jquery-validation-ui" ]
7071
}

application.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Grails Metadata file
2-
#Fri Mar 18 23:20:01 GMT+08:00 2011
3-
app.grails.version=1.3.7
2+
#Sun Jan 15 13:02:11 GMT+08:00 2012
3+
app.grails.version=2.0.0
44
app.name=jquery-validation-ui
5-
plugins.hibernate=1.3.7
6-
plugins.tomcat=1.3.7
5+
plugins.hibernate=2.0.0
6+
plugins.tomcat=2.0.0

grails-app/conf/BuildConfig.groovy

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@ grails.project.class.dir = "target/classes"
22
grails.project.test.class.dir = "target/test-classes"
33
grails.project.test.reports.dir = "target/test-reports"
44
//grails.project.war.file = "target/${appName}-${appVersion}.war"
5+
6+
// Disable SVN handling with release plugin
7+
grails.release.scm.enabled = false
8+
// Default repo to release is grailsCentral
9+
grails.project.repos.default = "grailsCentral"
10+
511
grails.project.dependency.resolution = {
612
// inherit Grails' default dependencies
713
inherits("global") {
814
// uncomment to disable ehcache
915
// excludes 'ehcache'
16+
excludes 'xml-apis'
1017
}
1118
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
1219
repositories {
@@ -27,6 +34,13 @@ grails.project.dependency.resolution = {
2734
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
2835

2936
// runtime 'mysql:mysql-connector-java:5.1.5'
37+
build("xom:xom:1.2.5") {
38+
export = false
39+
}
40+
compile("org.tmatesoft.svnkit:svnkit:1.3.5") {
41+
excludes "jna", "trilead-ssh2", "sqljet"
42+
export = false
43+
}
3044
}
3145
plugins {
3246
compile(":constraints:0.6.0")
@@ -39,5 +53,16 @@ grails.project.dependency.resolution = {
3953
compile(":webxml:1.4.1") {
4054
export = false
4155
}
56+
build(":new-doc:0.3.2") {
57+
export = false
58+
excludes "xom"
59+
}
60+
build(":release:1.0.1") {
61+
export = false
62+
excludes "svn"
63+
}
64+
build(':svn:1.0.2') {
65+
export = false
66+
}
4267
}
4368
}

src/docs/guide/appendices.gdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This section contains miscellaneous housekeeping items and additional reference material.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
h4. 11-Jan-2012 1.2.3
2+
* Fixed Issue [#19|http://code.google.com/p/jquery-validation-ui-plugin/issues/detail?id=19]: Allow overriding of submitHandler in generated validation block.
3+
* Fixed Issue [#20|http://code.google.com/p/jquery-validation-ui-plugin/issues/detail?id=20]: Add module definitions to use with the resources plugin.
4+
* First published with the project code at GitHub.
5+
* Converted documentation to Grails Docs (no longer at Google Code).
6+
7+
h4. 21-May-2011 1.2.2
8+
* Fixed Issue [#12|http://code.google.com/p/jquery-validation-ui-plugin/issues/detail?id=12]: Unique validation doesn't work for update.
9+
10+
h4. 18-Mar-2011 1.2.1
11+
* Fixed Issue [#9|http://code.google.com/p/jquery-validation-ui-plugin/issues/detail?id=9]: Validation matches [a-zA-Z]+ doesn't support single character
12+
* Fixed Issue [#10|http://code.google.com/p/jquery-validation-ui-plugin/issues/detail?id=10]: In java.lang.Bigdecimal also throw an error for unique and range.
13+
* Fixed Issue [#11|http://code.google.com/p/jquery-validation-ui-plugin/issues/detail?id=11]: Type mismatch custom error message not working.
14+
15+
h4. 18-Feb-2011 1.2
16+
* Implemented 3 new custom constraints from jquery validation additional methods: alphanumeric, letterswithbasicpunc and lettersonly. (@jqueryValidation.additionalMethods@ in @Config.groovy@ needs to set to @true@ to use these new custom constraints.)
17+
18+
h4. 03-Jan-2011 1.1.1
19+
* Fixed issue [#2|http://code.google.com/p/jquery-validation-ui-plugin/issues/detail?id=2]. Unable to submit the form when remote AJAX validation such as unique and validator constraints enabled.
20+
21+
h4. 30-Dec-2010 1.1
22+
* Support Grails 1.2.2+.
23+
* Support extensibility by the [custom constraints|http://github.com/geofflane/grails-constraints] plugin
24+
* Implemented 2 custom constraints: phone and phoneUS (International and US phone number validation).
25+
* Updated person sample application to demo the phone constraints.
26+
27+
h4. 22-Dec-2010 1.0.1
28+
* Make custom taglib work with [freemarker-tags|http://www.grails.org/plugin/freemarker-tags] plugin
29+
30+
h4. 15-Dec-2010 1.0
31+
* Support All Standard Grails Constraints
32+
* Display Validation Messages on Right or Top
33+
* Display both server-side and client-side validation messages using tooltip (qTip) and same styles.
34+
* Internationalization Support
35+
* Remote AJAX Validation Support for unique, validator constraints
36+
* Type Validation Support
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* [ProcessCanvas.com|http://www.processcanvas.com/] - Create online workflow in minutes.
2+
* Personal Information System of India e-Government.

src/docs/guide/appendices/todo.gdoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* Validation message (qTip) support with JQuery UI themes
2+
* Support [JQuery UI tooltip|http://wiki.jqueryui.com/w/page/12138112/Tooltip] after it is released.
3+
4+
We welcome your feedback and would like to hear about your comments to the project. You are invited to join the project discussion
5+
on [GitHub|http://github.com/limcheekin/jquery-validation-ui/issues] or on
6+
[Google Code|http://groups.google.com/group/jquery-validation-ui-plugin]. See you there!

src/docs/guide/overview.gdoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Grails [Validation|http://grails.org/doc/latest/guide/7.%20Validation.html] mechanism is great, I like it! However, it is just a server side validation
2+
solution. To build a comprehensive validation solution and highly interactive web application it has one missing important piece... Yes! It is client
3+
side validation solution that support all standard Grails constraints. Similar grails plugins such as [Javascript Validator|http://www.grails.org/plugin/javascript-validator]
4+
and [Remote Constraints|http://grails.org/plugin/remote-constraints] attempt to address this problem, but the outcome is less than satisfactory in my opinion.
5+
I like the solution and [demo|http://www.position-relative.net/creation/formValidator/] published in the blog post titled
6+
[A jQuery inline form validation, because validation is a mess|http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/],
7+
but unluckily it is not using the excellent [JQuery Validation plugin|http://bassistance.de/jquery-plugins/jquery-plugin-validation/] as it's validation engine.
8+
It had it's own solution known as [jQuery Validation Engine|https://github.com/posabsolute/jQuery-Validation-Engine].
9+
10+
The JQuery Validation UI Plugin brings Javascript Validator, Remote Constraints, [Custom Constraints|http://grails.org/plugin/constraints], jQuery Validation
11+
plugin, and [qTip (jQuery tooltip plugin)|http://craigsworks.com/projects/qtip_new/] under the same root and delivers a solution that is more than the jQuery Validation Engine.
12+
In short, when someone asks you what the JQuery Validation UI Plugin is, just show them the following code block:
13+
14+
{code}
15+
Javascript Validator + Remote Constraints + Custom Constraints + jQuery Validation plugin + qTip
16+
> jQuery Validation Engine
17+
{code}
18+
19+
I like the Grails's slogan: *"The search is really over!"*
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Install the plugin into your project with the following command:
2+
3+
{code}
4+
grails install-plugin jquery-validation-ui
5+
{code}
6+
7+
Alternatively, declare a plugin dependency in the @grails-app/conf/BuildConfig.groovy@ file:
8+
9+
{code}
10+
plugins {
11+
compile(\":jquery-validation-ui:latest.release\")
12+
}
13+
{code}
14+
15+
{note}Replace @latest.release@ above with the latest version number, or put it in your BuildConfig verbatim and compile
16+
your application and the latest version will be installed automatically.{note}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
If you are interested in the sample codes and screen shots I mentioned above, you can run the sample application in your own machine by installing
2+
it to your project using the following command:
3+
4+
{code}
5+
grails install-sampleapp
6+
{code}
7+
8+
{note}If the sample application of previous version of the plugin was installed, re-installing the sample application will not update the messages.properties file,
9+
please update it manually by referring to the updated one
10+
[here|http://github.com/limcheekin/jquery-validation-ui/blob/master/src/sample-app/grails-app/i18n/messages.properties].{note}

src/docs/guide/toc.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
overview:
2+
title: Overview
3+
installation: Installation
4+
sampleApplication: Person Sample Application
5+
usage:
6+
title: Usage
7+
configuration: Configuration
8+
resourcesModules: Resources Plugin Modules
9+
tags: Tags
10+
features: Features
11+
appendices:
12+
title: Appendices
13+
releaseNotes: Release Notes
14+
sitesUsing: Sites Using This Plugin
15+
todo: To Do

src/docs/guide/usage.gdoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This section describes the usage of the jQuery Validation UI plugin.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
After the plugin installed into your project, the following configurations will be appended to your project's @Config.groovy@ file:
2+
3+
{code}
4+
// Added by the JQuery Validation plugin:
5+
jqueryValidation.packed = true
6+
jqueryValidation.cdn = false // false or "microsoft"
7+
jqueryValidation.additionalMethods = false
8+
9+
10+
// Added by the JQuery Validation UI plugin:
11+
jqueryValidationUi {
12+
errorClass = 'error'
13+
validClass = 'valid'
14+
onsubmit = true
15+
renderErrorsOnTop = false
16+
17+
qTip {
18+
packed = true
19+
classes = 'ui-tooltip-red ui-tooltip-shadow ui-tooltip-rounded'
20+
}
21+
22+
/*
23+
Grails constraints to JQuery Validation rules mapping for client side validation.
24+
Constraint not found in the ConstraintsMap will trigger remote AJAX validation.
25+
*/
26+
StringConstraintsMap = [
27+
blank:'required', // inverse: blank=false, required=true
28+
creditCard:'creditcard',
29+
email:'email',
30+
inList:'inList',
31+
minSize:'minlength',
32+
maxSize:'maxlength',
33+
size:'rangelength',
34+
matches:'matches',
35+
notEqual:'notEqual',
36+
url:'url',
37+
nullable:'required',
38+
unique:'unique',
39+
validator:'validator'
40+
]
41+
42+
// Long, Integer, Short, Float, Double, BigInteger, BigDecimal
43+
NumberConstraintsMap = [
44+
min:'min',
45+
max:'max',
46+
range:'range',
47+
notEqual:'notEqual',
48+
nullable:'required',
49+
inList:'inList',
50+
unique:'unique',
51+
validator:'validator'
52+
]
53+
54+
CollectionConstraintsMap = [
55+
minSize:'minlength',
56+
maxSize:'maxlength',
57+
size:'rangelength',
58+
nullable:'required',
59+
validator:'validator'
60+
]
61+
62+
DateConstraintsMap = [
63+
min:'minDate',
64+
max:'maxDate',
65+
range:'rangeDate',
66+
notEqual:'notEqual',
67+
nullable:'required',
68+
inList:'inList',
69+
unique:'unique',
70+
validator:'validator'
71+
]
72+
73+
ObjectConstraintsMap = [
74+
nullable:'required',
75+
validator:'validator'
76+
]
77+
78+
CustomConstraintsMap = [
79+
phone:'true',
80+
phoneUS:'true'
81+
]
82+
}
83+
{code}
84+
85+
The first section is configuration of the dependent plugin - JQuery Validation. You can find out more about the description of
86+
it's configuration at it's [project page|http://www.grails.org/plugin/jquery-validation].
87+
88+
The second section is configuration items of the JQuery Validation UI plugin:
89+
* *errorClass* - This class used by JQuery Validation library to create error labels, to look for existing error labels and to add it to invalid elements.
90+
* *validClass* - This class is added to an element by JQuery Validation library after it was validated and considered valid.
91+
* *onsubmit = true|false* - Default is @true@. JQuery Validation library validates the form on submit. Set to @false@ to use only other events for validation. The following code trigger validation and submit the form if all inputs are valid:
92+
{code}
93+
if ($('form:first').validate().form()) {
94+
$('form:first').submit();
95+
}
96+
{code}
97+
* *renderErrorsOnTop = true|false* - Default is @false@. Validation messages will display on the right of input element. Set to @true@ to display all validation messages on the top of the form.
98+
* *qTip.packed = true|false* - Default is @true@. Set to @false@ to view a readable .js file for development purpose.
99+
* *qTip.classes* - Specify the styles of qTip. Refer to qTip style [documentation|http://craigsworks.com/projects/qtip2/docs/style/].
100+
101+
Client side validation enabled by JQuery Validation using Constraints Map, these Constraints Maps specify how Grails constraints map to JQuery Validation
102+
rules such as @StringConstraintsMap@, @NumberConstraintsMap@, @CollectionConstraintsMap@, @DateConstraintsMap@ and @ObjectConstraintsMap@ (@ObjectConstraintsMap@ is
103+
catch-all map if the property is not belongs to any other Constraints Maps). Refer to
104+
[JQuery Validation documentation|http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods] for built-in validation rules supported by the library and
105+
[additional rules|http://github.com/limcheekin/jquery-validation-ui/blob/master/web-app/js/jquery-validation-ui/grails-validation-methods.js]
106+
written for this plugin.
107+
108+
{note}@CustomConstraintsMap@ configuration supported since 1.1 released. If previous version of the plugin was installed, upgrade to 1.1 version will not update
109+
your Config.groovy file, please update it manually. Please see Extensibility in the [features|guide:features] section for more information.{note}

0 commit comments

Comments
 (0)