client_side_validations-simple_form 1.5.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/client_side_validations/simple_form/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Brian Cardarella"]
6
+ gem.email = ["bcardarella@gmail.com"]
7
+ gem.description = %q{SimpleForm Plugin for ClientSideValidaitons}
8
+ gem.summary = %q{SimpleForm Plugin for ClientSideValidations}
9
+ gem.homepage = 'https://github.com/dockyard/client_side_validations-simple_form'
10
+
11
+ gem.files = `git ls-files -- {lib/*,vendor/*,*.gemspec}`.split("\n")
12
+ gem.name = 'client_side_validations-simple_form'
13
+ gem.require_paths = ['lib']
14
+ gem.version = ClientSideValidations::SimpleForm::VERSION
15
+
16
+ gem.add_dependency 'client_side_validations', '~> 3.2.0.beta.1'
17
+ gem.add_dependency 'simple_form', '~> 1.5.0'
18
+
19
+ gem.add_development_dependency 'actionpack', '~> 3.2.0'
20
+ gem.add_development_dependency 'railties', '~> 3.2.0'
21
+ gem.add_development_dependency 'mocha'
22
+
23
+ # For QUnit testing
24
+ gem.add_development_dependency 'sinatra', '~> 1.0'
25
+ gem.add_development_dependency 'shotgun'
26
+ gem.add_development_dependency 'thin'
27
+ gem.add_development_dependency 'json'
28
+ end
@@ -0,0 +1,2 @@
1
+ class ClientSideValidations::SimpleForm::Engine < ::Rails::Engine; end
2
+
@@ -0,0 +1,34 @@
1
+ module ClientSideValidations
2
+ module SimpleForm
3
+ module FormBuilder
4
+
5
+ def self.included(base)
6
+ base.class_eval do
7
+ def self.client_side_form_settings(options, form_helper)
8
+ {
9
+ :type => self.to_s,
10
+ :error_class => ::SimpleForm.error_class,
11
+ :error_tag => ::SimpleForm.error_tag,
12
+ :wrapper_error_class => ::SimpleForm.wrapper_error_class,
13
+ :wrapper_tag => ::SimpleForm.wrapper_tag
14
+ }
15
+ end
16
+ alias_method_chain :input, :client_side_validations
17
+ end
18
+ end
19
+
20
+ def input_with_client_side_validations(attribute_name, options = {}, &block)
21
+ if options.key?(:validate)
22
+ options[:input_html] ||= {}
23
+ options[:input_html].merge!(:validate => options[:validate])
24
+ options.delete(:validate)
25
+ end
26
+
27
+ input_without_client_side_validations(attribute_name, options, &block)
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+
34
+ SimpleForm::FormBuilder.send(:include, ClientSideValidations::SimpleForm::FormBuilder)
@@ -0,0 +1,5 @@
1
+ module ClientSideValidations
2
+ module SimpleForm
3
+ VERSION = '1.5.0.beta.1'
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ require 'simple_form'
2
+ require 'client_side_validations/simple_form/form_builder'
3
+ require 'client_side_validations/simple_form/engine'
@@ -0,0 +1 @@
1
+ require 'client_side_validations/simple_form'
@@ -0,0 +1,28 @@
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
+
10
+ ClientSideValidations.formBuilders['SimpleForm::FormBuilder'] = {
11
+ add: function(element, settings, message) {
12
+ if (element.data('valid') !== false) {
13
+ var wrapper = element.closest(settings.wrapper_tag);
14
+ wrapper.addClass(settings.wrapper_error_class);
15
+ var errorElement = $('<' + settings.error_tag + ' class="' + settings.error_class + '">' + message + '</' + settings.error_tag + '>');
16
+ wrapper.append(errorElement);
17
+ } else {
18
+ element.parent().find(settings.error_tag + '.' + settings.error_class).text(message);
19
+ }
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
+ }
28
+
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: client_side_validations-simple_form
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.0.beta.1
5
+ prerelease: 6
6
+ platform: ruby
7
+ authors:
8
+ - Brian Cardarella
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-01-22 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: client_side_validations
16
+ requirement: &70366212405780 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.0.beta.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70366212405780
25
+ - !ruby/object:Gem::Dependency
26
+ name: simple_form
27
+ requirement: &70366212405220 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 1.5.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70366212405220
36
+ - !ruby/object:Gem::Dependency
37
+ name: actionpack
38
+ requirement: &70366212404720 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 3.2.0
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70366212404720
47
+ - !ruby/object:Gem::Dependency
48
+ name: railties
49
+ requirement: &70366212404220 !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: *70366212404220
58
+ - !ruby/object:Gem::Dependency
59
+ name: mocha
60
+ requirement: &70366212403800 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70366212403800
69
+ - !ruby/object:Gem::Dependency
70
+ name: sinatra
71
+ requirement: &70366212403240 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: '1.0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *70366212403240
80
+ - !ruby/object:Gem::Dependency
81
+ name: shotgun
82
+ requirement: &70366212402780 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *70366212402780
91
+ - !ruby/object:Gem::Dependency
92
+ name: thin
93
+ requirement: &70366212396080 !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: *70366212396080
102
+ - !ruby/object:Gem::Dependency
103
+ name: json
104
+ requirement: &70366212395180 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: *70366212395180
113
+ description: SimpleForm Plugin for ClientSideValidaitons
114
+ email:
115
+ - bcardarella@gmail.com
116
+ executables: []
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - client_side_validations-simple_form.gemspec
121
+ - lib/client_side_validations-simple_form.rb
122
+ - lib/client_side_validations/simple_form.rb
123
+ - lib/client_side_validations/simple_form/engine.rb
124
+ - lib/client_side_validations/simple_form/form_builder.rb
125
+ - lib/client_side_validations/simple_form/version.rb
126
+ - vendor/assets/javascripts/rails.validations.simple_form.js
127
+ homepage: https://github.com/dockyard/client_side_validations-simple_form
128
+ licenses: []
129
+ post_install_message:
130
+ rdoc_options: []
131
+ require_paths:
132
+ - lib
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
142
+ - - ! '>'
143
+ - !ruby/object:Gem::Version
144
+ version: 1.3.1
145
+ requirements: []
146
+ rubyforge_project:
147
+ rubygems_version: 1.8.10
148
+ signing_key:
149
+ specification_version: 3
150
+ summary: SimpleForm Plugin for ClientSideValidations
151
+ test_files: []