midas-g_form_submit_protector 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,9 @@
1
- == 1.0.0 2009-03-21
1
+ == 1.0.2 2009-08-13
2
+
3
+ * Changed :form_class option to be :selector so that any jquery selector can be used, including multiple selectors
4
+ * Added :all shortcut for the selector option which extrapolates out to 'form', :selector => :all = :selector => 'form'
5
+
6
+ == 1.0.1 2009-03-21
2
7
 
3
8
  * Fixed bug with not including view_helpers file
4
9
 
data/README.rdoc CHANGED
@@ -17,7 +17,17 @@ submit button has been used.
17
17
 
18
18
  == USAGE:
19
19
 
20
- <% g_form_submit_protector :form_class => 'itemForm' %>
20
+ To protect all forms:
21
+
22
+ <% g_form_submit_protector :selector => :all %>
23
+
24
+ To protect a specific form use any selector that jQuery supports:
25
+
26
+ <% g_form_submit_protector :selector => '.protectedForm' %>
27
+
28
+ You can even use multiple selectors:
29
+
30
+ <% g_form_submit_protector :selector => '.protectedForm,#anotherform' %>
21
31
 
22
32
 
23
33
  == REQUIREMENTS:
@@ -34,7 +44,11 @@ In rails environment.rb file:
34
44
 
35
45
  config.gem 'midas-g_form_submit_protector', :version => "1.0.1", :lib => 'g_form_submit_protector', :source => 'http://gems.github.com'
36
46
 
47
+ Generate:
37
48
 
49
+ script/generate form_submit_protector_assets
50
+
51
+
38
52
  == LICENSE:
39
53
 
40
54
  (The MIT License)
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{g_form_submit_protector}
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["C. Jason Harrelson (midas)"]
9
- s.date = %q{2009-03-21}
9
+ s.date = %q{2009-08-13}
10
10
  s.description = %q{A Rails Guilded (http://github.com/midas/guilded/tree/master) component that will disable form elements once the submit button has been used.}
11
11
  s.email = ["jason@lookforwardenterprises.com"]
12
12
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
@@ -25,18 +25,18 @@ Gem::Specification.new do |s|
25
25
  s.specification_version = 2
26
26
 
27
27
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
- s.add_development_dependency(%q<newgem>, [">= 1.2.3"])
28
+ s.add_development_dependency(%q<newgem>, [">= 1.3.0"])
29
29
  s.add_development_dependency(%q<rails>, [">= 2.2.0"])
30
30
  s.add_development_dependency(%q<midas-guilded>, [">= 0.1.4"])
31
31
  s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
32
32
  else
33
- s.add_dependency(%q<newgem>, [">= 1.2.3"])
33
+ s.add_dependency(%q<newgem>, [">= 1.3.0"])
34
34
  s.add_dependency(%q<rails>, [">= 2.2.0"])
35
35
  s.add_dependency(%q<midas-guilded>, [">= 0.1.4"])
36
36
  s.add_dependency(%q<hoe>, [">= 1.8.0"])
37
37
  end
38
38
  else
39
- s.add_dependency(%q<newgem>, [">= 1.2.3"])
39
+ s.add_dependency(%q<newgem>, [">= 1.3.0"])
40
40
  s.add_dependency(%q<rails>, [">= 2.2.0"])
41
41
  s.add_dependency(%q<midas-guilded>, [">= 0.1.4"])
42
42
  s.add_dependency(%q<hoe>, [">= 1.8.0"])
@@ -4,7 +4,7 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require 'g_form_submit_protector/view_helpers'
5
5
 
6
6
  module GFormSubmitProtector
7
- VERSION = '1.0.1'
7
+ VERSION = '1.0.2'
8
8
  end
9
9
 
10
10
  if defined?( ActionView::Base )
@@ -4,7 +4,8 @@ module GFormSubmitProtector
4
4
  def g_form_submit_protector( *args )
5
5
  return if Guilded::Guilder.instance.include_component?( :form_submit_protector ) # We only need one field highligher per page
6
6
  options = args.extract_options!
7
- throw Guilded::Exception::GuildedException.new( "'form_class' is a required option" ) unless options.has_key?( :form_class )
7
+ throw Guilded::Exception::GuildedException.new( "'form_class' is a required option" ) unless options.has_key?( :selector )
8
+ options[:selector] = 'form' if options[:selector] == :all
8
9
  options.merge! :id => "form-submit-protector"
9
10
  options.merge! :exclude_css => true
10
11
  Guilded::Guilder.instance.add( :form_submit_protector, options, [ 'jquery/jquery-disable_on_submit-1.0.min.js' ] )
@@ -13,9 +13,9 @@ g.formSubmitProtectorInit = function( options )
13
13
  }
14
14
 
15
15
  if( g.doFormSubmitProtector )
16
- options['should_inactivate'] = g.doFormSubmitProtector
16
+ options['should_inactivate'] = g.doFormSubmitProtector;
17
17
 
18
- $jc( options.form_class ).disableOnSubmit( options );
18
+ $j( options.selector ).disableOnSubmit( options );
19
19
 
20
20
  if( g.afterFormSubmitProtectorInit )
21
21
  {
@@ -1,4 +1,4 @@
1
1
  /* Guilded Form Submit Protector 1.0.0
2
2
  * Copyright (c) 2009 C. Jason Harrelson (midas)
3
3
  * Guilded Form Submit Protector is licensed under the terms of the MIT License */
4
- g.formSubmitProtectorInit=function(options){if(!options)options={};if(g.beforeFormSubmitProtectorInit){g.beforeFormSubmitProtectorInit(options);}if(options.disable_list){$jc( options.form_class ).disableOnSubmit(options);else{$jc(options.form_class).disableOnSubmit();}if(g.afterFormSubmitProtectorInit){g.afterFormSubmitProtectorInit(options);}};
4
+ g.formSubmitProtectorInit=function(options){if(!options)options={};if(g.beforeFormSubmitProtectorInit){g.beforeFormSubmitProtectorInit(options)}if(g.doFormSubmitProtector)options['should_inactivate']=g.doFormSubmitProtector; $jc(options.form_class).disableOnSubmit(options);if(g.afterFormSubmitProtectorInit){g.afterFormSubmitProtectorInit(options)}};
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midas-g_form_submit_protector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Jason Harrelson (midas)
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-21 00:00:00 -07:00
12
+ date: 2009-08-13 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 1.2.3
23
+ version: 1.3.0
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rails
@@ -87,6 +87,7 @@ files:
87
87
  - tasks/rspec.rake
88
88
  has_rdoc: true
89
89
  homepage: http://github.com/midas/g_form_submit_protector/tree/master
90
+ licenses:
90
91
  post_install_message: PostInstall.txt
91
92
  rdoc_options:
92
93
  - --main
@@ -108,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
109
  requirements: []
109
110
 
110
111
  rubyforge_project: g_form_submit_protector
111
- rubygems_version: 1.2.0
112
+ rubygems_version: 1.3.5
112
113
  signing_key:
113
114
  specification_version: 2
114
115
  summary: A Rails Guilded (http://github.com/midas/guilded/tree/master) component that will disable form elements once the submit button has been used.