dev_toolbar 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dev_toolbar/middleware.rb +46 -9
- data/lib/dev_toolbar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b5f82f64e412b3c84ead79dd80b612f52af3e45bb590fba94f24aafd148b1ef
|
4
|
+
data.tar.gz: f6ad406e103b96573194853a79cb89f5b3dc4ed78e48bfd692112c8203168d7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f4289abfef772cad1b0ef858dfa760a77e3071e8fad8aa42e8ce348477fabb0575cd52d710388808e7ccfc3d24d504d43d21baee46fc540265aaa50e2de8c4d
|
7
|
+
data.tar.gz: 70cbbfce13c9fa7c67edd150e4b429ef0d9a03477a47979553e2eabe48518181549888d234feb7d38c0ac2047fcf81b7000328a42fc3e96a0cf1f915791f0729
|
@@ -11,24 +11,61 @@ module DevToolbar
|
|
11
11
|
response_body = response.body
|
12
12
|
toolbar_html = <<-HTML
|
13
13
|
<div id="dev-toolbar">
|
14
|
-
|
14
|
+
<div id="dev-toolbar-button">
|
15
|
+
<a id="dev-toolbar-toggle">🛠️</a>
|
16
|
+
</div>
|
17
|
+
<div id="dev-toolbar-links" class="hidden">
|
18
|
+
#{toolbar_links}
|
19
|
+
</div>
|
15
20
|
</div>
|
16
21
|
<style>
|
17
22
|
#dev-toolbar {
|
18
23
|
position: fixed;
|
19
24
|
right: 0;
|
20
|
-
top:
|
21
|
-
|
22
|
-
color: #
|
23
|
-
|
25
|
+
top: 50vh;
|
26
|
+
transform: translateY(-50%);
|
27
|
+
background-color: #f0f0f0;
|
28
|
+
border: 1px solid #ccc;
|
24
29
|
z-index: 1000;
|
30
|
+
display: flex;
|
31
|
+
flex-direction: column;
|
32
|
+
align-items: center;
|
33
|
+
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
|
34
|
+
color: #808080;
|
35
|
+
}
|
36
|
+
|
37
|
+
#dev-toolbar-toggle {
|
38
|
+
font-size: 2em;
|
39
|
+
border: none;
|
40
|
+
cursor: pointer;
|
41
|
+
line-height: 1.5;
|
42
|
+
padding: 0 10px;
|
43
|
+
text-decoration: none;
|
44
|
+
}
|
45
|
+
|
46
|
+
#dev-toolbar-links {
|
47
|
+
display: flex;
|
48
|
+
flex-direction: column;
|
25
49
|
}
|
26
50
|
|
27
|
-
|
28
|
-
|
29
|
-
|
51
|
+
.dev-toolbar-link {
|
52
|
+
padding: 5px 10px;
|
53
|
+
border-bottom: 1px #f0f0f0 solid;
|
54
|
+
color: #808080;
|
55
|
+
text-decoration: none;
|
56
|
+
background-color: white;
|
57
|
+
}
|
58
|
+
|
59
|
+
#dev-toolbar-links.hidden {
|
60
|
+
display: none;
|
30
61
|
}
|
31
62
|
</style>
|
63
|
+
<script>
|
64
|
+
document.getElementById('dev-toolbar-toggle').addEventListener('click', function() {
|
65
|
+
var links = document.getElementById('dev-toolbar-links');
|
66
|
+
links.classList.toggle('hidden');
|
67
|
+
});
|
68
|
+
</script>
|
32
69
|
HTML
|
33
70
|
|
34
71
|
response_body.sub!('</body>', "#{toolbar_html}</body>")
|
@@ -44,7 +81,7 @@ module DevToolbar
|
|
44
81
|
|
45
82
|
def toolbar_links
|
46
83
|
DevToolbar.configuration.links.map do |link|
|
47
|
-
"<a href='#{link[:path]}' target='_blank'>#{link[:name]}</a>"
|
84
|
+
"<a href='#{link[:path]}' target='_blank' class='dev-toolbar-link'>#{link[:name]}</a>"
|
48
85
|
end.join(' ')
|
49
86
|
end
|
50
87
|
end
|
data/lib/dev_toolbar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dev_toolbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Purinton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|