obscura_linka 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/obscura_linka/application.js +20 -17
- data/lib/obscura_linka/version.rb +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87940eb35c44494e0ba548efa919c1ec43f97ce0
|
4
|
+
data.tar.gz: a2687812acacbbbe611910a4b3def03f27923831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b80b5c21e5649c70ffc0fed61f3ded6977320fdd864d2b14e267423b96769809a747df277e8832cc63017520e80cc46d8f3729014b02e9363645a4ec97c65d0
|
7
|
+
data.tar.gz: 1cc4670e1d21be2b7501610c8bfd915d5a6f28eec8282f77fd853fc1a378042f049fbca1a19c6842b0be009d77e3b4a5f3f71b5347045bfdea8726b45bfa791a
|
@@ -12,33 +12,34 @@
|
|
12
12
|
//
|
13
13
|
//= require_tree .
|
14
14
|
|
15
|
+
ObscuraLinka = {
|
16
|
+
initialize: function() {
|
17
|
+
var rot_elements = document.getElementsByClassName("rot13_link");
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
window.location = rot13(this.getAttribute("data-href"));
|
25
|
-
}, false);
|
26
|
-
}
|
19
|
+
for (var i = 0; i < rot_elements.length ; i++) {
|
20
|
+
rot_elements[i].addEventListener("click",
|
21
|
+
function (event) {
|
22
|
+
event.preventDefault();
|
23
|
+
window.location = ObscuraLinka.rot13(this.getAttribute("data-href"));
|
24
|
+
}, false);
|
25
|
+
}
|
26
|
+
},
|
27
27
|
|
28
|
-
function
|
28
|
+
rot: function( t, u, v ) {
|
29
29
|
return String.fromCharCode( ( ( t - u + v ) % ( v * 2 ) ) + u );
|
30
|
-
}
|
31
|
-
|
30
|
+
},
|
31
|
+
|
32
|
+
rot13: function( s ) {
|
32
33
|
var b = [], c, i = s.length,
|
33
34
|
a = 'a'.charCodeAt(), z = a + 26,
|
34
35
|
A = 'A'.charCodeAt(), Z = A + 26;
|
35
36
|
while(i--) {
|
36
37
|
c = s.charCodeAt( i );
|
37
38
|
if( c>=a && c<z ) {
|
38
|
-
b[i] = rot( c, a, 13 );
|
39
|
+
b[i] = ObscuraLinka.rot( c, a, 13 );
|
39
40
|
}
|
40
41
|
else if( c>=A && c<Z ) {
|
41
|
-
b[i] = rot( c, A, 13 );
|
42
|
+
b[i] = ObscuraLinka.rot( c, A, 13 );
|
42
43
|
}
|
43
44
|
else {
|
44
45
|
b[i] = s.charAt( i );
|
@@ -46,4 +47,6 @@ window.onload=function() {
|
|
46
47
|
}
|
47
48
|
return b.join( '' );
|
48
49
|
}
|
49
|
-
}
|
50
|
+
};
|
51
|
+
|
52
|
+
$(window).load = ObscuraLinka.initialize();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obscura_linka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Fonacier
|
@@ -10,34 +10,34 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-07-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 4.1.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 4.1.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: sqlite3
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - '>='
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - '>='
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
description: Obscure links by creating and using link_to to move the rot13 the href
|
@@ -51,24 +51,21 @@ executables: []
|
|
51
51
|
extensions: []
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
|
-
- MIT-LICENSE
|
55
|
-
- README.md
|
56
|
-
- Rakefile
|
57
54
|
- app/assets/javascripts/obscura_linka/application.js
|
58
55
|
- app/assets/stylesheets/obscura_linka/application.css
|
59
56
|
- config/routes.rb
|
60
|
-
- lib/obscura_linka.rb
|
61
57
|
- lib/obscura_linka/engine.rb
|
62
58
|
- lib/obscura_linka/version.rb
|
59
|
+
- lib/obscura_linka.rb
|
63
60
|
- lib/tasks/obscura_linka_tasks.rake
|
64
|
-
-
|
65
|
-
-
|
61
|
+
- MIT-LICENSE
|
62
|
+
- Rakefile
|
63
|
+
- README.md
|
66
64
|
- test/dummy/app/assets/javascripts/application.js
|
67
65
|
- test/dummy/app/assets/stylesheets/application.css
|
68
66
|
- test/dummy/app/controllers/application_controller.rb
|
69
67
|
- test/dummy/app/helpers/application_helper.rb
|
70
68
|
- test/dummy/app/views/layouts/application.html.erb
|
71
|
-
- test/dummy/config.ru
|
72
69
|
- test/dummy/config/application.rb
|
73
70
|
- test/dummy/config/boot.rb
|
74
71
|
- test/dummy/config/database.yml
|
@@ -84,10 +81,13 @@ files:
|
|
84
81
|
- test/dummy/config/initializers/wrap_parameters.rb
|
85
82
|
- test/dummy/config/locales/en.yml
|
86
83
|
- test/dummy/config/routes.rb
|
84
|
+
- test/dummy/config.ru
|
87
85
|
- test/dummy/public/404.html
|
88
86
|
- test/dummy/public/422.html
|
89
87
|
- test/dummy/public/500.html
|
90
88
|
- test/dummy/public/favicon.ico
|
89
|
+
- test/dummy/Rakefile
|
90
|
+
- test/dummy/README.rdoc
|
91
91
|
- test/dummy/script/rails
|
92
92
|
- test/integration/navigation_test.rb
|
93
93
|
- test/obscura_linka_test.rb
|
@@ -101,17 +101,17 @@ require_paths:
|
|
101
101
|
- lib
|
102
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
|
-
- -
|
104
|
+
- - '>='
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - '>='
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.0.3
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Obscure links
|