middleman-gibberish 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/lib/middleman-gibberish.rb +26 -14
- data/middleman-gibberish.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWMzNGMwYmE2ZTExMzcwYTQ5NmYxMmQ4N2I4ZTc5ZGMwMmMwY2VmNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzZmOGFhZjQ0YzA1Yzg1M2YwZDE3ZGJlMzk4YmJiMWJlYTcxYmQ3ZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGIzNGUzNjRiN2U2NjFmZmI0YTNhYTM3MzIwNmJmY2ZlNTBmYjI0YjY2OGEz
|
10
|
+
NDY2YTg5MzZmYjQ3ZDZlYmQ2MmVlMzUxMTQ5ZDc3ZGYyMmU5ODljYmJhZWNj
|
11
|
+
MzcwOTczYmE5ODg0YjJjYTMyZWM2ZTkzMmYzYjA1MjZkNzQ5Yjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjY2YTYwNGVhOWEwMmRmZmRkOGUyNWI0NGEyNzU2NDcxNTg0ODMwYWE3NDBk
|
14
|
+
YzVkNDAyNDk4YmQ4MDYwMTg3NWVhYjg5NDczZGVmMjQyMzU5ZDI0MjYwZjJm
|
15
|
+
NDVkYjBlMDhmNTY1OTMzMDYyOGM2YzUwNGFhNzRlOWIzZTZiYTU=
|
data/README.md
CHANGED
data/lib/middleman-gibberish.rb
CHANGED
@@ -3,7 +3,7 @@ require 'gibberish'
|
|
3
3
|
|
4
4
|
module ::Middleman
|
5
5
|
class Gibberish < Middleman::Extension
|
6
|
-
Version = '0.
|
6
|
+
Version = '0.6.0'
|
7
7
|
|
8
8
|
def Gibberish.version
|
9
9
|
Version
|
@@ -191,7 +191,6 @@ module ::Middleman
|
|
191
191
|
var cookie = #{ glob.to_json };
|
192
192
|
var options = {path: "/", expires: 1};
|
193
193
|
|
194
|
-
|
195
194
|
jQuery(function(){
|
196
195
|
var password = jQuery('.gibberish-password');
|
197
196
|
var message = jQuery('.gibberish-message');
|
@@ -199,14 +198,8 @@ module ::Middleman
|
|
199
198
|
password.focus();
|
200
199
|
message.html('');
|
201
200
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
e.preventDefault();
|
206
|
-
|
207
|
-
var _password = (jQuery.cookie(cookie) || password.val());
|
208
|
-
|
209
|
-
if(code==13 && !_password==""){
|
201
|
+
var decrypt = function(_password){
|
202
|
+
if(_password){
|
210
203
|
try{
|
211
204
|
var decrypted = GibberishAES.dec(encrypted, _password);
|
212
205
|
|
@@ -216,19 +209,38 @@ module ::Middleman
|
|
216
209
|
jQuery.cookie(cookie, _password, options);
|
217
210
|
} catch(e) {
|
218
211
|
};
|
212
|
+
|
213
|
+
return true;
|
219
214
|
} catch(e) {
|
220
215
|
try{
|
221
216
|
jQuery.removeCookie(cookie, options);
|
222
217
|
} catch(e) {
|
223
218
|
};
|
224
|
-
|
219
|
+
|
220
|
+
return false;
|
225
221
|
};
|
226
|
-
}
|
227
|
-
|
228
|
-
|
222
|
+
}
|
223
|
+
|
224
|
+
return false;
|
225
|
+
};
|
226
|
+
|
227
|
+
password.keyup(function(e){
|
228
|
+
var code = e.which;
|
229
|
+
e.preventDefault();
|
230
|
+
|
231
|
+
if(code==13){
|
232
|
+
var _password = password.val();
|
233
|
+
if(!decrypt(_password)){
|
234
|
+
message.html("sorry, wrong password - try again.");
|
235
|
+
}
|
236
|
+
}
|
229
237
|
|
230
238
|
return(false);
|
231
239
|
});
|
240
|
+
|
241
|
+
|
242
|
+
var _password = jQuery.cookie(cookie);
|
243
|
+
decrypt(_password);
|
232
244
|
});
|
233
245
|
</script>
|
234
246
|
__
|
data/middleman-gibberish.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "middleman-gibberish"
|
6
|
-
spec.version = "0.
|
6
|
+
spec.version = "0.6.0"
|
7
7
|
spec.platform = Gem::Platform::RUBY
|
8
8
|
spec.summary = "middleman-gibberish"
|
9
9
|
spec.description = "password protect middleman pages - even on s3"
|