forked from raspberrypi/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove extraneous padding and javascript, add dark mode; todo: mobile…
… toc
- Loading branch information
1 parent
e14224a
commit 18f7b8f
Showing
26 changed files
with
2,368 additions
and
1,557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,9 @@ | ||
<!-- Script for the TOC toggle --> | ||
<script src="{{ site.baseurl }}/scripts/nav.js?ver={{ site.time | date: '%s' }}" type="text/javascript"></script> | ||
|
||
<!-- Asciidoctor tabs --> | ||
<script src="{{ site.baseurl }}/scripts/asciidoctor-tabs.js?ver={{ site.time | date: '%s' }}" type="text/javascript"></script> | ||
|
||
<!-- TOCify scripts --> | ||
<script src="{{ site.baseurl }}/scripts/jquery-1.12.4.min.js"></script> | ||
<script src="{{ site.baseurl }}/scripts/jquery-ui-1.13.0.custom.min.js"></script> | ||
<script src="{{ site.baseurl }}/scripts/jquery.tocify.js?ver={{ site.time | date: '%s' }}"></script> | ||
|
||
<!-- Copy To Clipboard scripts --> | ||
<script src="{{ site.baseurl }}/scripts/clipboard.min.js"></script> | ||
<script src="{{ site.baseurl }}/scripts/copy-to-clipboard.js?ver={{ site.time | date: '%s' }}"></script> | ||
|
||
<!-- Some custom handling for whitepapers --> | ||
<script src="{{ site.baseurl }}/scripts/whitepaper.js?ver={{ site.time | date: '%s' }}"></script> | ||
|
||
<script> | ||
function hasher(text, element) { | ||
return text.toLowerCase().replace(/ /g, "-").replace(/\./g, "-").replace(/[^-\w]/g, "").replace(/-+/g, "-"); | ||
} | ||
|
||
function waitForElementToDisplay(selector, checkFrequencyInMs, timeoutInMs) { | ||
try { | ||
// wait for all the content to load first... | ||
var startTimeInMs = Date.now(); | ||
(function loopSearch() { | ||
// && document.querySelector(selector).getBoundingClientRect().top > 0 | ||
if (document.querySelector(selector) != null && document.querySelector(selector).getBoundingClientRect().top > 0) { | ||
scrollToElement(selector); | ||
return; | ||
} | ||
else { | ||
setTimeout(function () { | ||
if (timeoutInMs && Date.now() - startTimeInMs > timeoutInMs) | ||
return; | ||
loopSearch(); | ||
}, checkFrequencyInMs); | ||
} | ||
})(); | ||
} catch (e) { | ||
console.log("there was an error in scrollToElement:"); | ||
console.log(e); | ||
} | ||
} | ||
|
||
function scrollToElement(selector) { | ||
try { | ||
var target = document.querySelector(selector); | ||
if (target) { | ||
setTimeout(function () { | ||
target.scrollIntoView({ behavior: "instant" }); | ||
setTimeout(function () { | ||
target.scrollIntoView({ behavior: "instant" }); | ||
},100); | ||
},1); | ||
|
||
|
||
} else { | ||
console.log("Target not found :("); | ||
} | ||
} catch (e) { | ||
console.log("there was an error in scrollToElement:"); | ||
console.log(e); | ||
} | ||
} | ||
|
||
$(function() { | ||
$("#toc").tocify({ showAndHide: false, hashGenerator: hasher, extendPage: false, ignoreSelector: ".discrete" }); | ||
// special handling to scroll to tocify elements on the page | ||
if (window.location.hasOwnProperty("hash") && window.location.hash.indexOf("#") > -1) { | ||
var myhash = window.location.hash; | ||
myhash = myhash.replace("#", ""); | ||
var selector = "div[data-unique="+myhash+"] + *"; | ||
waitForElementToDisplay(selector, 1000, 9000); | ||
} | ||
}); | ||
</script> | ||
|
||
<script> | ||
var contents = document.getElementById("contents"); | ||
contents.addEventListener('mouseenter', e => { | ||
contents.style.overflowY = 'auto'; | ||
}); | ||
|
||
contents.addEventListener('mouseleave', e => { | ||
contents.style.overflowY = 'hidden'; | ||
}); | ||
</script> | ||
<script src="{{ site.baseurl }}/scripts/whitepaper.js?ver={{ site.time | date: '%s' }}"></script> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="theme-toggle-container"> | ||
<a id="theme-toggle" alt="toggle site theme" title="toggle site theme" onclick="toggleTheme()"></a> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.