client_side_validations-simple_form 1.5.0.beta.2 → 1.5.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- data/client_side_validations-simple_form.gemspec +2 -2
- data/lib/client_side_validations/generators/simple_form.rb +17 -0
- data/lib/client_side_validations/simple_form/version.rb +1 -1
- data/lib/client_side_validations-simple_form.rb +5 -0
- data/vendor/assets/javascripts/rails.validations.simple_form.js +34 -25
- metadata +31 -30
@@ -16,8 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.add_dependency 'client_side_validations', '~> 3.2.0.beta.1'
|
17
17
|
gem.add_dependency 'simple_form', '~> 1.5.0'
|
18
18
|
|
19
|
-
gem.add_development_dependency '
|
20
|
-
gem.add_development_dependency 'railties', '~> 3.2.0'
|
19
|
+
gem.add_development_dependency 'rails', '~> 3.2.0'
|
21
20
|
gem.add_development_dependency 'mocha'
|
22
21
|
|
23
22
|
# For QUnit testing
|
@@ -25,4 +24,5 @@ Gem::Specification.new do |gem|
|
|
25
24
|
gem.add_development_dependency 'shotgun'
|
26
25
|
gem.add_development_dependency 'thin'
|
27
26
|
gem.add_development_dependency 'json'
|
27
|
+
gem.add_development_dependency 'coffee-script'
|
28
28
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module ClientSideValidations
|
2
|
+
module Generators
|
3
|
+
class SimpleForm
|
4
|
+
def self.assets
|
5
|
+
[{
|
6
|
+
:path => File.expand_path('../../../../vendor/assets/javascripts', __FILE__),
|
7
|
+
:file => 'rails.validations.simple_form.js'
|
8
|
+
}]
|
9
|
+
end
|
10
|
+
|
11
|
+
Generators.register_assets(self)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
|
@@ -1,28 +1,37 @@
|
|
1
|
-
/*!
|
2
|
-
* Client Side Validations - SimpleForm - v2.0.0.beta.2
|
3
|
-
* https://github.com/dockyard/client_side_validations-simple_form
|
4
|
-
*
|
5
|
-
* Copyright (c) 2012 DockYard, LLC
|
6
|
-
* Licensed under the MIT license
|
7
|
-
* http://www.opensource.org/licenses/mit-license.php
|
8
|
-
*/
|
9
1
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
2
|
+
/*
|
3
|
+
Client Side Validations - SimpleForm - v1.5.0.beta.3
|
4
|
+
https://github.com/dockyard/client_side_validations-simple_form
|
5
|
+
|
6
|
+
Copyright (c) 2012 DockYard, LLC
|
7
|
+
Licensed under the MIT license
|
8
|
+
http://www.opensource.org/licenses/mit-license.php
|
9
|
+
*/
|
10
|
+
|
11
|
+
(function() {
|
12
|
+
|
13
|
+
ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
|
14
|
+
add: function(element, settings, message) {
|
15
|
+
var errorElement, wrapper;
|
16
|
+
if (element.data('valid') !== false) {
|
17
|
+
wrapper = element.closest(settings.wrapper_tag);
|
18
|
+
wrapper.addClass(settings.wrapper_error_class);
|
19
|
+
errorElement = $("<" + settings.error_tag + "/>", {
|
20
|
+
"class": settings.error_class,
|
21
|
+
text: message
|
22
|
+
});
|
23
|
+
return wrapper.append(errorElement);
|
24
|
+
} else {
|
25
|
+
return element.parent().find("" + settings.error_tag + "." + settings.error_class).text(message);
|
26
|
+
}
|
27
|
+
},
|
28
|
+
remove: function(element, settings) {
|
29
|
+
var errorElement, wrapper;
|
30
|
+
wrapper = element.closest("" + settings.wrapper_tag + "." + settings.wrapper_error_class);
|
31
|
+
wrapper.removeClass(settings.wrapper_error_class);
|
32
|
+
errorElement = wrapper.find("" + settings.error_tag + "." + settings.error_class);
|
33
|
+
return errorElement.remove();
|
19
34
|
}
|
20
|
-
}
|
21
|
-
remove: function(element, settings) {
|
22
|
-
var wrapper = element.closest(settings.wrapper_tag + '.' + settings.wrapper_error_class);
|
23
|
-
wrapper.removeClass(settings.wrapper_error_class);
|
24
|
-
var errorElement = wrapper.find(settings.error_tag + '.' + settings.error_class);
|
25
|
-
errorElement.remove();
|
26
|
-
}
|
27
|
-
}
|
35
|
+
};
|
28
36
|
|
37
|
+
}).call(this);
|
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: 1.5.0.beta.
|
4
|
+
version: 1.5.0.beta.3
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-25 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: client_side_validations
|
16
|
-
requirement: &
|
16
|
+
requirement: &70253679009480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.2.0.beta.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70253679009480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: simple_form
|
27
|
-
requirement: &
|
27
|
+
requirement: &70253679008380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.5.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70253679008380
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement: &
|
37
|
+
name: rails
|
38
|
+
requirement: &70253679007800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,21 +43,10 @@ dependencies:
|
|
43
43
|
version: 3.2.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: railties
|
49
|
-
requirement: &2223098240 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 3.2.0
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *2223098240
|
46
|
+
version_requirements: *70253679007800
|
58
47
|
- !ruby/object:Gem::Dependency
|
59
48
|
name: mocha
|
60
|
-
requirement: &
|
49
|
+
requirement: &70253678975700 !ruby/object:Gem::Requirement
|
61
50
|
none: false
|
62
51
|
requirements:
|
63
52
|
- - ! '>='
|
@@ -65,10 +54,10 @@ dependencies:
|
|
65
54
|
version: '0'
|
66
55
|
type: :development
|
67
56
|
prerelease: false
|
68
|
-
version_requirements: *
|
57
|
+
version_requirements: *70253678975700
|
69
58
|
- !ruby/object:Gem::Dependency
|
70
59
|
name: sinatra
|
71
|
-
requirement: &
|
60
|
+
requirement: &70253678974620 !ruby/object:Gem::Requirement
|
72
61
|
none: false
|
73
62
|
requirements:
|
74
63
|
- - ~>
|
@@ -76,10 +65,10 @@ dependencies:
|
|
76
65
|
version: '1.0'
|
77
66
|
type: :development
|
78
67
|
prerelease: false
|
79
|
-
version_requirements: *
|
68
|
+
version_requirements: *70253678974620
|
80
69
|
- !ruby/object:Gem::Dependency
|
81
70
|
name: shotgun
|
82
|
-
requirement: &
|
71
|
+
requirement: &70253678973420 !ruby/object:Gem::Requirement
|
83
72
|
none: false
|
84
73
|
requirements:
|
85
74
|
- - ! '>='
|
@@ -87,10 +76,10 @@ dependencies:
|
|
87
76
|
version: '0'
|
88
77
|
type: :development
|
89
78
|
prerelease: false
|
90
|
-
version_requirements: *
|
79
|
+
version_requirements: *70253678973420
|
91
80
|
- !ruby/object:Gem::Dependency
|
92
81
|
name: thin
|
93
|
-
requirement: &
|
82
|
+
requirement: &70253678972400 !ruby/object:Gem::Requirement
|
94
83
|
none: false
|
95
84
|
requirements:
|
96
85
|
- - ! '>='
|
@@ -98,10 +87,21 @@ dependencies:
|
|
98
87
|
version: '0'
|
99
88
|
type: :development
|
100
89
|
prerelease: false
|
101
|
-
version_requirements: *
|
90
|
+
version_requirements: *70253678972400
|
102
91
|
- !ruby/object:Gem::Dependency
|
103
92
|
name: json
|
104
|
-
requirement: &
|
93
|
+
requirement: &70253678971720 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70253678971720
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: coffee-script
|
104
|
+
requirement: &70253678971160 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70253678971160
|
113
113
|
description: SimpleForm Plugin for ClientSideValidaitons
|
114
114
|
email:
|
115
115
|
- bcardarella@gmail.com
|
@@ -119,6 +119,7 @@ extra_rdoc_files: []
|
|
119
119
|
files:
|
120
120
|
- client_side_validations-simple_form.gemspec
|
121
121
|
- lib/client_side_validations-simple_form.rb
|
122
|
+
- lib/client_side_validations/generators/simple_form.rb
|
122
123
|
- lib/client_side_validations/simple_form.rb
|
123
124
|
- lib/client_side_validations/simple_form/engine.rb
|
124
125
|
- lib/client_side_validations/simple_form/form_builder.rb
|