client_side_validations-simple_form 2.0.0.rc.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.require_paths = ['lib']
|
14
14
|
gem.version = ClientSideValidations::SimpleForm::VERSION
|
15
15
|
|
16
|
-
gem.add_dependency 'client_side_validations', '~> 3.2.0
|
16
|
+
gem.add_dependency 'client_side_validations', '~> 3.2.0'
|
17
17
|
gem.add_dependency 'simple_form', '~> 2.0.3'
|
18
18
|
|
19
19
|
gem.add_development_dependency 'rails', '~> 3.2.0'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
/*
|
3
|
-
Client Side Validations - SimpleForm - v2.0.0.rc.
|
3
|
+
Client Side Validations - SimpleForm - v2.0.0.rc.2
|
4
4
|
https://github.com/dockyard/client_side_validations-simple_form
|
5
5
|
|
6
6
|
Copyright (c) 2012 DockYard, LLC
|
@@ -44,10 +44,27 @@
|
|
44
44
|
},
|
45
45
|
bootstrap: {
|
46
46
|
add: function(element, settings, message) {
|
47
|
-
|
47
|
+
var errorElement, wrapper_class_element, wrapper_tag_element;
|
48
|
+
if (element.data('valid') !== false) {
|
49
|
+
wrapper_class_element = element.closest("." + settings.wrapper_class);
|
50
|
+
wrapper_tag_element = element.closest(settings.wrapper_tag);
|
51
|
+
wrapper_class_element.addClass(settings.wrapper_error_class);
|
52
|
+
errorElement = $("<" + settings.error_tag + "/>", {
|
53
|
+
"class": settings.error_class,
|
54
|
+
text: message
|
55
|
+
});
|
56
|
+
return wrapper_tag_element.append(errorElement);
|
57
|
+
} else {
|
58
|
+
return element.parent().find("" + settings.error_tag + "." + settings.error_class).text(message);
|
59
|
+
}
|
48
60
|
},
|
49
61
|
remove: function(element, settings) {
|
50
|
-
|
62
|
+
var errorElement, wrapper_class_element, wrapper_tag_element;
|
63
|
+
wrapper_class_element = element.closest("." + settings.wrapper_class + "." + settings.wrapper_error_class);
|
64
|
+
wrapper_tag_element = element.closest(settings.wrapper_tag);
|
65
|
+
wrapper_class_element.removeClass(settings.wrapper_error_class);
|
66
|
+
errorElement = wrapper_tag_element.find("" + settings.error_tag + "." + settings.error_class);
|
67
|
+
return errorElement.remove();
|
51
68
|
}
|
52
69
|
}
|
53
70
|
}
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.0
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brian Cardarella
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: client_side_validations
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 3.2.0
|
21
|
+
version: 3.2.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 3.2.0
|
29
|
+
version: 3.2.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: simple_form
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,13 +200,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
segments:
|
202
202
|
- 0
|
203
|
-
hash:
|
203
|
+
hash: -1589316472431185734
|
204
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
205
|
none: false
|
206
206
|
requirements:
|
207
|
-
- - ! '
|
207
|
+
- - ! '>='
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
209
|
+
version: '0'
|
210
|
+
segments:
|
211
|
+
- 0
|
212
|
+
hash: -1589316472431185734
|
210
213
|
requirements: []
|
211
214
|
rubyforge_project:
|
212
215
|
rubygems_version: 1.8.23
|