client_side_validations-simple_form 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
Client Side Validations - SimpleForm - v2.0.0
|
3
|
+
Client Side Validations - SimpleForm - v2.0.0
|
4
4
|
https://github.com/dockyard/client_side_validations-simple_form
|
5
5
|
|
6
6
|
Copyright (c) 2012 DockYard, LLC
|
@@ -22,17 +22,17 @@
|
|
22
22
|
"default": {
|
23
23
|
add: function(element, settings, message) {
|
24
24
|
var errorElement, wrapper;
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
errorElement = element.parent().find("" + settings.error_tag + "." + settings.error_class);
|
26
|
+
wrapper = element.closest(settings.wrapper_tag);
|
27
|
+
if (!(errorElement[0] != null)) {
|
28
28
|
errorElement = $("<" + settings.error_tag + "/>", {
|
29
29
|
"class": settings.error_class,
|
30
30
|
text: message
|
31
31
|
});
|
32
|
-
|
33
|
-
} else {
|
34
|
-
return element.parent().find("" + settings.error_tag + "." + settings.error_class).text(message);
|
32
|
+
wrapper.append(errorElement);
|
35
33
|
}
|
34
|
+
wrapper.addClass(settings.wrapper_error_class);
|
35
|
+
return errorElement.text(message);
|
36
36
|
},
|
37
37
|
remove: function(element, settings) {
|
38
38
|
var errorElement, wrapper;
|
@@ -45,18 +45,18 @@
|
|
45
45
|
bootstrap: {
|
46
46
|
add: function(element, settings, message) {
|
47
47
|
var errorElement, wrapper_class_element, wrapper_tag_element;
|
48
|
-
|
49
|
-
|
48
|
+
errorElement = element.parent().find("" + settings.error_tag + "." + settings.error_class);
|
49
|
+
if (!(errorElement[0] != null)) {
|
50
50
|
wrapper_tag_element = element.closest(settings.wrapper_tag);
|
51
|
-
wrapper_class_element.addClass(settings.wrapper_error_class);
|
52
51
|
errorElement = $("<" + settings.error_tag + "/>", {
|
53
52
|
"class": settings.error_class,
|
54
53
|
text: message
|
55
54
|
});
|
56
|
-
|
57
|
-
} else {
|
58
|
-
return element.parent().find("" + settings.error_tag + "." + settings.error_class).text(message);
|
55
|
+
wrapper_tag_element.append(errorElement);
|
59
56
|
}
|
57
|
+
wrapper_class_element = element.closest("." + settings.wrapper_class);
|
58
|
+
wrapper_class_element.addClass(settings.wrapper_error_class);
|
59
|
+
return errorElement.text(message);
|
60
60
|
},
|
61
61
|
remove: function(element, settings) {
|
62
62
|
var errorElement, wrapper_class_element, wrapper_tag_element;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: client_side_validations-simple_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: client_side_validations
|
@@ -200,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
segments:
|
202
202
|
- 0
|
203
|
-
hash: -
|
203
|
+
hash: -4259300496051352991
|
204
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
205
|
none: false
|
206
206
|
requirements:
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
segments:
|
211
211
|
- 0
|
212
|
-
hash: -
|
212
|
+
hash: -4259300496051352991
|
213
213
|
requirements: []
|
214
214
|
rubyforge_project:
|
215
215
|
rubygems_version: 1.8.23
|