client_side_validations 3.0.5 → 3.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/client_side_validations.gemspec +1 -3
- data/lib/client_side_validations/action_view/form_builder.rb +1 -1
- data/lib/client_side_validations/action_view/form_helper.rb +1 -1
- data/lib/client_side_validations/version.rb +1 -1
- data/lib/generators/client_side_validations/install_generator.rb +1 -1
- data/test/base_helper.rb +2 -0
- data/test/javascript/server.rb +1 -1
- data/test/javascript/views/layout.erb +1 -1
- data/{javascript → vendor/assets/javascripts}/rails.validations.js +3 -3
- metadata +30 -41
@@ -12,13 +12,11 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{Client Side Validations}
|
13
13
|
s.description = %q{Client Side Validations}
|
14
14
|
|
15
|
-
s.files = `git ls-files -- {lib/*,
|
15
|
+
s.files = `git ls-files -- {lib/*,vendor/*,*.gemspec}`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency 'activesupport'
|
21
|
-
|
22
20
|
s.add_development_dependency 'rails', '~> 3.0.0'
|
23
21
|
s.add_development_dependency 'sqlite3'
|
24
22
|
s.add_development_dependency 'bson_ext'
|
@@ -2,7 +2,7 @@ module ClientSideValidations::ActionView::Helpers
|
|
2
2
|
module FormBuilder
|
3
3
|
|
4
4
|
def self.included(base)
|
5
|
-
(base.field_helpers - %w(apply_form_for_options! label check_box radio_button fields_for hidden_field)).each do |selector|
|
5
|
+
(base.field_helpers.map(&:to_s) - %w(apply_form_for_options! label check_box radio_button fields_for hidden_field)).each do |selector|
|
6
6
|
base.class_eval <<-RUBY_EVAL
|
7
7
|
def #{selector}_with_client_side_validations(method, options = {})
|
8
8
|
apply_client_side_validators(method, options)
|
@@ -10,7 +10,7 @@ module ClientSideValidations
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def copy_locale
|
13
|
-
copy_file '../../../
|
13
|
+
copy_file '../../../vendor/assets/javascripts/rails.validations.js', 'public/javascripts/rails.validations.js'
|
14
14
|
end
|
15
15
|
|
16
16
|
def show_readme
|
data/test/base_helper.rb
CHANGED
data/test/javascript/server.rb
CHANGED
@@ -2,7 +2,7 @@ require 'sinatra'
|
|
2
2
|
require 'json'
|
3
3
|
require 'ruby-debug'
|
4
4
|
|
5
|
-
use Rack::Static, :urls => ['/
|
5
|
+
use Rack::Static, :urls => ['/vendor/assets/javascripts'], :root => File.expand_path('../..', settings.root)
|
6
6
|
|
7
7
|
helpers do
|
8
8
|
def jquery_link version
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Rails 3 Client Side Validations - v3.0.
|
2
|
+
* Rails 3 Client Side Validations - v3.0.10
|
3
3
|
* https://github.com/bcardarlela/client_side_validations
|
4
4
|
*
|
5
5
|
* Copyright (c) 2011 Brian Cardarella
|
@@ -24,7 +24,7 @@
|
|
24
24
|
.bind('form:validate:pass', function(eventData) { clientSideValidations.callbacks.form.pass( form, eventData); })
|
25
25
|
|
26
26
|
// Set up the events for each validatable form element
|
27
|
-
.find('[data-validate]:input')
|
27
|
+
.find('[data-validate]:input:not(:radio)')
|
28
28
|
.live('focusout', function() { $(this).isValid(settings.validators); })
|
29
29
|
.live('change', function() { $(this).data('changed', true); })
|
30
30
|
// Callbacks
|
@@ -312,7 +312,7 @@ var clientSideValidations = {
|
|
312
312
|
formBuilders: {
|
313
313
|
'ActionView::Helpers::FormBuilder': {
|
314
314
|
add: function(element, settings, message) {
|
315
|
-
if (element.data('valid') !== false) {
|
315
|
+
if (element.data('valid') !== false && jQuery('label.message[for="' + element.attr('id') + '"]')[0] == undefined) {
|
316
316
|
var inputErrorField = jQuery(settings.input_tag),
|
317
317
|
labelErrorField = jQuery(settings.label_tag),
|
318
318
|
label = jQuery('label[for="' + element.attr('id') + '"]:not(.message)');
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: client_side_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 3.0.
|
5
|
+
version: 3.0.10
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brian Cardarella
|
@@ -10,163 +10,152 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-20 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
name: activesupport
|
18
|
-
prerelease: false
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
|
-
requirements:
|
22
|
-
- - ">="
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: "0"
|
25
|
-
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
16
|
- !ruby/object:Gem::Dependency
|
28
17
|
name: rails
|
29
18
|
prerelease: false
|
30
|
-
requirement: &
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
31
20
|
none: false
|
32
21
|
requirements:
|
33
22
|
- - ~>
|
34
23
|
- !ruby/object:Gem::Version
|
35
24
|
version: 3.0.0
|
36
25
|
type: :development
|
37
|
-
version_requirements: *
|
26
|
+
version_requirements: *id001
|
38
27
|
- !ruby/object:Gem::Dependency
|
39
28
|
name: sqlite3
|
40
29
|
prerelease: false
|
41
|
-
requirement: &
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
31
|
none: false
|
43
32
|
requirements:
|
44
33
|
- - ">="
|
45
34
|
- !ruby/object:Gem::Version
|
46
35
|
version: "0"
|
47
36
|
type: :development
|
48
|
-
version_requirements: *
|
37
|
+
version_requirements: *id002
|
49
38
|
- !ruby/object:Gem::Dependency
|
50
39
|
name: bson_ext
|
51
40
|
prerelease: false
|
52
|
-
requirement: &
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
42
|
none: false
|
54
43
|
requirements:
|
55
44
|
- - ">="
|
56
45
|
- !ruby/object:Gem::Version
|
57
46
|
version: "0"
|
58
47
|
type: :development
|
59
|
-
version_requirements: *
|
48
|
+
version_requirements: *id003
|
60
49
|
- !ruby/object:Gem::Dependency
|
61
50
|
name: mongoid
|
62
51
|
prerelease: false
|
63
|
-
requirement: &
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
64
53
|
none: false
|
65
54
|
requirements:
|
66
55
|
- - ~>
|
67
56
|
- !ruby/object:Gem::Version
|
68
57
|
version: 2.0.0
|
69
58
|
type: :development
|
70
|
-
version_requirements: *
|
59
|
+
version_requirements: *id004
|
71
60
|
- !ruby/object:Gem::Dependency
|
72
61
|
name: mongo_mapper
|
73
62
|
prerelease: false
|
74
|
-
requirement: &
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
75
64
|
none: false
|
76
65
|
requirements:
|
77
66
|
- - ~>
|
78
67
|
- !ruby/object:Gem::Version
|
79
68
|
version: 0.9.0
|
80
69
|
type: :development
|
81
|
-
version_requirements: *
|
70
|
+
version_requirements: *id005
|
82
71
|
- !ruby/object:Gem::Dependency
|
83
72
|
name: mocha
|
84
73
|
prerelease: false
|
85
|
-
requirement: &
|
74
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
86
75
|
none: false
|
87
76
|
requirements:
|
88
77
|
- - ">="
|
89
78
|
- !ruby/object:Gem::Version
|
90
79
|
version: "0"
|
91
80
|
type: :development
|
92
|
-
version_requirements: *
|
81
|
+
version_requirements: *id006
|
93
82
|
- !ruby/object:Gem::Dependency
|
94
83
|
name: simple_form
|
95
84
|
prerelease: false
|
96
|
-
requirement: &
|
85
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
97
86
|
none: false
|
98
87
|
requirements:
|
99
88
|
- - ">="
|
100
89
|
- !ruby/object:Gem::Version
|
101
90
|
version: "0"
|
102
91
|
type: :development
|
103
|
-
version_requirements: *
|
92
|
+
version_requirements: *id007
|
104
93
|
- !ruby/object:Gem::Dependency
|
105
94
|
name: formtastic
|
106
95
|
prerelease: false
|
107
|
-
requirement: &
|
96
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
108
97
|
none: false
|
109
98
|
requirements:
|
110
99
|
- - ">="
|
111
100
|
- !ruby/object:Gem::Version
|
112
101
|
version: "0"
|
113
102
|
type: :development
|
114
|
-
version_requirements: *
|
103
|
+
version_requirements: *id008
|
115
104
|
- !ruby/object:Gem::Dependency
|
116
105
|
name: sinatra
|
117
106
|
prerelease: false
|
118
|
-
requirement: &
|
107
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
119
108
|
none: false
|
120
109
|
requirements:
|
121
110
|
- - ~>
|
122
111
|
- !ruby/object:Gem::Version
|
123
112
|
version: "1.0"
|
124
113
|
type: :development
|
125
|
-
version_requirements: *
|
114
|
+
version_requirements: *id009
|
126
115
|
- !ruby/object:Gem::Dependency
|
127
116
|
name: shotgun
|
128
117
|
prerelease: false
|
129
|
-
requirement: &
|
118
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
130
119
|
none: false
|
131
120
|
requirements:
|
132
121
|
- - ">="
|
133
122
|
- !ruby/object:Gem::Version
|
134
123
|
version: "0"
|
135
124
|
type: :development
|
136
|
-
version_requirements: *
|
125
|
+
version_requirements: *id010
|
137
126
|
- !ruby/object:Gem::Dependency
|
138
127
|
name: thin
|
139
128
|
prerelease: false
|
140
|
-
requirement: &
|
129
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
141
130
|
none: false
|
142
131
|
requirements:
|
143
132
|
- - ">="
|
144
133
|
- !ruby/object:Gem::Version
|
145
134
|
version: "0"
|
146
135
|
type: :development
|
147
|
-
version_requirements: *
|
136
|
+
version_requirements: *id011
|
148
137
|
- !ruby/object:Gem::Dependency
|
149
138
|
name: json
|
150
139
|
prerelease: false
|
151
|
-
requirement: &
|
140
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
152
141
|
none: false
|
153
142
|
requirements:
|
154
143
|
- - ">="
|
155
144
|
- !ruby/object:Gem::Version
|
156
145
|
version: "0"
|
157
146
|
type: :development
|
158
|
-
version_requirements: *
|
147
|
+
version_requirements: *id012
|
159
148
|
- !ruby/object:Gem::Dependency
|
160
149
|
name: ruby-debug19
|
161
150
|
prerelease: false
|
162
|
-
requirement: &
|
151
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
163
152
|
none: false
|
164
153
|
requirements:
|
165
154
|
- - ">="
|
166
155
|
- !ruby/object:Gem::Version
|
167
156
|
version: "0"
|
168
157
|
type: :development
|
169
|
-
version_requirements: *
|
158
|
+
version_requirements: *id013
|
170
159
|
description: Client Side Validations
|
171
160
|
email:
|
172
161
|
- bcardarella@gmail.com
|
@@ -178,7 +167,6 @@ extra_rdoc_files: []
|
|
178
167
|
|
179
168
|
files:
|
180
169
|
- client_side_validations.gemspec
|
181
|
-
- javascript/rails.validations.js
|
182
170
|
- lib/client_side_validations.rb
|
183
171
|
- lib/client_side_validations/action_view.rb
|
184
172
|
- lib/client_side_validations/action_view/form_builder.rb
|
@@ -211,6 +199,7 @@ files:
|
|
211
199
|
- lib/generators/client_side_validations/install_generator.rb
|
212
200
|
- lib/generators/templates/README
|
213
201
|
- lib/generators/templates/client_side_validations.rb
|
202
|
+
- vendor/assets/javascripts/rails.validations.js
|
214
203
|
- test/action_view/cases/helper.rb
|
215
204
|
- test/action_view/cases/test_helpers.rb
|
216
205
|
- test/action_view/cases/test_legacy_helpers.rb
|
@@ -310,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
310
299
|
requirements: []
|
311
300
|
|
312
301
|
rubyforge_project:
|
313
|
-
rubygems_version: 1.3
|
302
|
+
rubygems_version: 1.5.3
|
314
303
|
signing_key:
|
315
304
|
specification_version: 3
|
316
305
|
summary: Client Side Validations
|