recaptcha 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/recaptcha/client_helper.rb +17 -14
- data/lib/recaptcha/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afcac99e8320b419d5b69964022d2dfb52787a35
|
4
|
+
data.tar.gz: dc49f2c7ac4f4cd78224cd3c1cdb8aa0ef794ef4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73dfefd7474f71251c2e196f7a56f22ab2fa994383002b8aae79b15df3ed4bc6d2e45f4eb6bad85de0afd2f10a27bb3b51c7cd650abfc495f0c97f18e2c7ed69
|
7
|
+
data.tar.gz: edc37ce377e3d51788dbcee70d832cb86e68d27aa284ec65a5e72cc42868ecd7b57ca7986478bfe1edb0f16525725f7558177ec6a82bd946adbbd5b918732a49
|
data/README.md
CHANGED
@@ -109,7 +109,7 @@ Some of the options available:
|
|
109
109
|
```Erb
|
110
110
|
<%= form_for @foo, html: {id: 'invisible-recaptcha-form'} do |f| %>
|
111
111
|
# ... other tags
|
112
|
-
<%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm' %>
|
112
|
+
<%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm', text: 'Submit form' %>
|
113
113
|
<% end %>
|
114
114
|
```
|
115
115
|
|
@@ -57,24 +57,27 @@ module Recaptcha
|
|
57
57
|
def self.recaptcha_components(options = {})
|
58
58
|
site_key = options.delete(:site_key) || Recaptcha.configuration.site_key!
|
59
59
|
html = ""
|
60
|
-
attributes = {
|
61
|
-
|
62
|
-
}
|
60
|
+
attributes = {}
|
61
|
+
fallback_uri = ""
|
63
62
|
|
64
|
-
|
65
|
-
script_url = Recaptcha.configuration.api_server_url
|
66
|
-
script_url += "?hl=#{hl}" unless hl.to_s == ""
|
67
|
-
html << %(<script src="#{script_url}" async defer></script>\n) unless options.delete(:script) == false
|
68
|
-
fallback_uri = "#{script_url.chomp('.js')}/fallback?k=#{site_key}"
|
63
|
+
attributes["class"] = "g-recaptcha #{options.delete(:class)}"
|
69
64
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
65
|
+
unless Recaptcha::Verify.skip?(options[:env])
|
66
|
+
hl = options.delete(:hl).to_s
|
67
|
+
script_url = Recaptcha.configuration.api_server_url
|
68
|
+
script_url << "?hl=#{hl}" unless hl == ""
|
69
|
+
html << %(<script src="#{script_url}" async defer></script>\n) unless options.delete(:script) == false
|
70
|
+
fallback_uri = %(#{script_url.chomp(".js")}/fallback?k=#{site_key})
|
71
|
+
|
72
|
+
# Pull out reCaptcha specific data attributes.
|
73
|
+
[:badge, :theme, :type, :callback, :expired_callback, :size].each do |data_attribute|
|
74
|
+
value = options.delete(data_attribute)
|
75
|
+
|
76
|
+
attributes["data-#{data_attribute}"] = value if value
|
74
77
|
end
|
75
|
-
end
|
76
78
|
|
77
|
-
|
79
|
+
attributes["data-sitekey"] = site_key
|
80
|
+
end
|
78
81
|
|
79
82
|
# Append whatever that's left of options to be attributes on the tag.
|
80
83
|
tag_attributes = attributes.merge(options).map { |k, v| %(#{k}="#{v}") }.join(" ")
|
data/lib/recaptcha/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason L Perry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|