lockup 0.0.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ <img src="http://grantblakeman.com/lockup/lockup_mark.png" width="100" height="134" alt="Lockup Shield" />
2
+
1
3
  # Lockup
2
4
 
3
5
  [![Gem Version](https://badge.fury.io/rb/lockup.png)](http://badge.fury.io/rb/lockup)
@@ -30,10 +32,16 @@ To set a codeword, define LOCKUP_CODEWORD in your environments/your_environment.
30
32
 
31
33
  ENV["LOCKUP_CODEWORD"] = 'secret'
32
34
 
33
- If you're using [Figaro](https://github.com/laserlemon/figaro), set your lockup codeword in your application.yml file:
35
+ If you think you might need a hint:
36
+
37
+ ENV["LOCKUP_HINT"] = 'Something that you do not tell everyone.'
38
+
39
+ If you're using [Figaro](https://github.com/laserlemon/figaro), set your lockup codeword and hint (optional) in your application.yml file:
34
40
 
35
41
  LOCKUP_CODEWORD: "love"
36
42
 
43
+ LOCKUP_HINT: "Pepé Le Pew"
44
+
37
45
  **Codewords are not case-sensitive, by design. Keep it simple.**
38
46
 
39
47
  ### Link it with no typing:
@@ -41,3 +49,5 @@ If you're using [Figaro](https://github.com/laserlemon/figaro), set your lockup
41
49
  http://somedomain.com/or_path/?lockup_codeword=love
42
50
 
43
51
  The visitor is redirected and the cookie is set without them ever seeing the Lockup splash page.
52
+
53
+ (Lockup also makes a rudimentary attempt based on user agent to block major search engine bots/crawlers from following this link and indexing the site, just in case it ever gets out into the wild.)
@@ -1,8 +1,9 @@
1
1
  body {
2
- padding: 15%;
2
+ padding: 12%;
3
3
  font-family: Helvetica, sans-serif;
4
4
  color: #fff;
5
5
  background-color: #252525;
6
+ overflow: hidden;
6
7
  }
7
8
  h1 {
8
9
  font-family: Helvetica, sans-serif;
@@ -89,3 +90,40 @@ form p {
89
90
  text-align: center;
90
91
  background-color: #4a1f23;
91
92
  }
93
+ #hint_icon {
94
+ width: 24px;
95
+ height: 24px;
96
+ position: absolute;
97
+ left: 50%;
98
+ text-align: center;
99
+ cursor: pointer;
100
+ color: #252525;
101
+ font-size: 16px;
102
+ line-height: 26px;
103
+ font-weight: bold;
104
+ margin: -91px 0 0 135px;
105
+ -webkit-border-radius: 15px;
106
+ -moz-border-radius: 15px;
107
+ border-radius: 15px;
108
+ background: #fff;
109
+ }
110
+ #hint {
111
+ font-size: 16px;
112
+ text-align: center;
113
+ overflow: hidden;
114
+ line-height: 0px;
115
+ margin-top: -16px;
116
+ -webkit-transition: all 150ms ease-in-out;
117
+ -moz-transition: all 150ms ease-in-out;
118
+ -ms-transition: all 150ms ease-in-out;
119
+ -o-transition: all 150ms ease-in-out;
120
+ transition: all 150ms ease-in-out;
121
+ }
122
+ #hint.show {
123
+ line-height: 18px;
124
+ margin-bottom: 23px;
125
+ }
126
+ #hint:before {
127
+ content: "Hint: ";
128
+ font-weight: bold;
129
+ }
@@ -0,0 +1,12 @@
1
+ setTimeout(function () {
2
+ var hint = document.getElementById('hint');
3
+ var hint_icon = document.getElementById('hint_icon');
4
+ hint_icon.onclick = function () {
5
+ if(hint.className.indexOf('show') < 0) {
6
+ hint.className = hint.className + " show";
7
+ }
8
+ else {
9
+ hint.className = hint.className.replace(/\sshow/, '');
10
+ }
11
+ }
12
+ }, 50);
@@ -6,6 +6,9 @@
6
6
  <style>
7
7
  <%= render partial: 'layouts/lockup/inline_css' %>
8
8
  </style>
9
+ <script>
10
+ <%= render partial: 'layouts/lockup/inline_js' %>
11
+ </script>
9
12
  </head>
10
13
 
11
14
  <body>
@@ -1,18 +1,23 @@
1
1
  <h1>Please enter the code word to continue…</h1>
2
2
 
3
- <% if @wrong == true %>
3
+ <% if @wrong %>
4
4
  <div class="hmm">
5
5
  <h3>Hmm… that doesn’t seem right. Try again?</h3>
6
6
  </div>
7
7
  <% end %>
8
8
 
9
9
  <%= form_for :lockup, :url => { :action => 'unlock' } do |form| %>
10
- <% if @wrong == true %>
11
- <p><%= form.password_field "codeword", :value => @codeword, :class => 'nope' %></p>
12
- <% else %>
10
+ <% unless @wrong == true %>
13
11
  <p><%= form.password_field "codeword", :placeholder => "code word" %></p>
12
+ <% else %>
13
+ <p><%= form.password_field "codeword", :value => @codeword, :class => 'nope' %></p>
14
14
  <% end %>
15
15
 
16
+ <% if ENV["LOCKUP_HINT"].present? %>
17
+ <p id='hint_icon'>?</p>
18
+ <p id='hint'><%= ENV["LOCKUP_HINT"] %></p>
19
+ <% end %>
20
+
16
21
  <% if params[:return_to].present? %>
17
22
  <%= form.hidden_field "return_to", :value => params[:return_to] %>
18
23
  <% elsif @return_to.present? %>
@@ -1,3 +1,3 @@
1
1
  module Lockup
2
- VERSION = "0.0.5"
2
+ VERSION = "1.0.0"
3
3
  end
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: 21
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
+ - 1
7
8
  - 0
8
9
  - 0
9
- - 5
10
- version: 0.0.5
10
+ version: 1.0.0
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: 2013-08-20 00:00:00 Z
18
+ date: 2013-11-01 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
@@ -51,6 +51,7 @@ files:
51
51
  - app/controllers/lockup/lockup_controller.rb
52
52
  - app/helpers/lockup/application_helper.rb
53
53
  - app/views/layouts/lockup/_inline_css.html.erb
54
+ - app/views/layouts/lockup/_inline_js.html.erb
54
55
  - app/views/layouts/lockup/application.html.erb
55
56
  - app/views/lockup/lockup/unlock.html.erb
56
57
  - config/routes.rb