lockup 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +16 -2
- data/app/views/layouts/lockup/_inline_js.html.erb +8 -6
- data/lib/lockup/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -10,7 +10,7 @@ _“Can I come into your fort?”_
|
|
10
10
|
|
11
11
|
_“…what's the codeword?”_
|
12
12
|
|
13
|
-
(currently used in production with Rails 3.X and
|
13
|
+
(currently used in production with Rails 3.X and Rails 4)
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -34,7 +34,7 @@ If you think you might need a hint:
|
|
34
34
|
|
35
35
|
ENV["LOCKUP_HINT"] = 'Something that you do not tell everyone.'
|
36
36
|
|
37
|
-
If you're using [Figaro](https://github.com/laserlemon/figaro), set your
|
37
|
+
If you're using [Figaro](https://github.com/laserlemon/figaro), set your Lockup codeword and hint (optional) in your application.yml file:
|
38
38
|
|
39
39
|
LOCKUP_CODEWORD: "love"
|
40
40
|
|
@@ -42,6 +42,20 @@ If you're using [Figaro](https://github.com/laserlemon/figaro), set your lockup
|
|
42
42
|
|
43
43
|
**Codewords are not case-sensitive, by design. Keep it simple.**
|
44
44
|
|
45
|
+
## Advanced Usage
|
46
|
+
|
47
|
+
### Use Lockup around a specific controller:
|
48
|
+
|
49
|
+
1. Follow the installtion instructions above.
|
50
|
+
|
51
|
+
2. In your application_controller.rb file, add:
|
52
|
+
|
53
|
+
skip_before_action :check_for_lockup
|
54
|
+
|
55
|
+
4. In the controller(s) you would like to restrict:
|
56
|
+
|
57
|
+
before_action :check_for_lockup
|
58
|
+
|
45
59
|
### Link it with no typing:
|
46
60
|
|
47
61
|
http://somedomain.com/or_path/?lockup_codeword=love
|
@@ -1,12 +1,14 @@
|
|
1
1
|
setTimeout(function () {
|
2
2
|
var hint = document.getElementById('hint');
|
3
3
|
var hint_icon = document.getElementById('hint_icon');
|
4
|
-
hint_icon
|
5
|
-
|
6
|
-
hint.className
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
if (hint_icon != null) {
|
5
|
+
hint_icon.onclick = function () {
|
6
|
+
if(hint.className.indexOf('show') < 0) {
|
7
|
+
hint.className = hint.className + " show";
|
8
|
+
}
|
9
|
+
else {
|
10
|
+
hint.className = hint.className.replace(/\sshow/, '');
|
11
|
+
}
|
10
12
|
}
|
11
13
|
}
|
12
14
|
}, 50);
|
data/lib/lockup/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lockup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- gb Studio
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2014-
|
18
|
+
date: 2014-03-15 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rails
|