mirror of https://github.com/docker/docs.git
Re-enable "anchorlink" script
This allows for easier sharing of links to specific sections on a page. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b633d3c21c
commit
5276ea1d9f
|
@ -295,7 +295,7 @@
|
||||||
hljs.initHighlightingOnLoad();
|
hljs.initHighlightingOnLoad();
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- <script src="/js/anchorlinks.js"></script> -->
|
<script defer src="/js/anchorlinks.js"></script>
|
||||||
<script defer src="/js/menu.js"></script>
|
<script defer src="/js/menu.js"></script>
|
||||||
<script src="/js/jquery.js"></script>
|
<script src="/js/jquery.js"></script>
|
||||||
<script src="/js/bootstrap.min.js"></script>
|
<script src="/js/bootstrap.min.js"></script>
|
||||||
|
|
|
@ -116,10 +116,18 @@ pre code {
|
||||||
}
|
}
|
||||||
|
|
||||||
a.anchorLink {
|
a.anchorLink {
|
||||||
|
font-size: 0.5em;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1:hover > a.anchorLink,
|
||||||
|
h2:hover > a.anchorLink,
|
||||||
|
h3:hover > a.anchorLink
|
||||||
|
{
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
a.glossary {
|
a.glossary {
|
||||||
color: $body-text-color;
|
color: $body-text-color;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
(function(d) {
|
(function(d) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var hs = d.getElementById("DocumentationText").querySelectorAll("H1, H2, H3"), h;
|
var hs = d.querySelectorAll("H1, H2, H3"), h;
|
||||||
|
|
||||||
for (var i = 0; i < hs.length; i++) {
|
for (var i = 0; i < hs.length; i++) {
|
||||||
h = hs[i];
|
h = hs[i];
|
||||||
if (h.id != null && h.id.length > 0) {
|
if (h.id != null && h.id.length > 0) {
|
||||||
h.insertAdjacentHTML('beforeend', '<a href="' + window.location.href + '#' + h.id + '" class="anchorLink">¶</a>')
|
h.insertAdjacentHTML('beforeend', '<a href="' + window.location.href + '#' + h.id + '" class="anchorLink">🔗</a>')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue