abongo 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/abongo/version.rb +1 -1
- data/lib/abongo/view_helper.rb +9 -0
- metadata +3 -3
data/lib/abongo/version.rb
CHANGED
data/lib/abongo/view_helper.rb
CHANGED
@@ -56,6 +56,15 @@ class Abongo
|
|
56
56
|
#This causes an AJAX post against the URL. That URL should call Abongo.human!
|
57
57
|
#This guarantees that anyone calling Abongo.human! is capable of at least minimal Javascript execution, and thus is (probably) not a robot.
|
58
58
|
def include_humanizing_javascript(url = "/abongo_mark_human", style = :prototype)
|
59
|
+
begin
|
60
|
+
return if Abongo.is_human?
|
61
|
+
rescue
|
62
|
+
if Abongo.options[:failsafe]
|
63
|
+
else
|
64
|
+
raise
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
59
68
|
script = nil
|
60
69
|
if (style == :prototype)
|
61
70
|
script = "var a=Math.floor(Math.random()*11); var b=Math.floor(Math.random()*11);var x=new Ajax.Request('#{url}', {parameters:{a: a, b: b, c: a+b}})"
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 5
|
9
|
+
version: 1.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Fairley
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-03-12 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|