Merge pull request #2368 from XhmikosR/master

This commit is contained in:
Parker Moore 2014-05-12 01:11:15 -04:00
commit 31d7afc987
3 changed files with 29 additions and 24 deletions

View File

@ -1,27 +1,32 @@
<script type="text/javascript" charset="utf-8"> <script>
var anchorForId = function(id){ var anchorForId = function (id) {
var anchor = document.createElement("a");
anchor.className = "header-link";
anchor.href = "#" + id;
anchor.innerHTML = "<i class=\"fa fa-link\"></i>";
return anchor;
};
var anchor = document.createElement("a"); var linkifyAnchors = function (level, containingElement) {
anchor.className = "header-link"; var headers = containingElement.getElementsByTagName("h" + level);
anchor.href = "#" + id; for (var h = 0; h < headers.length; h++) {
anchor.innerHTML = '<i class="fa fa-link"></i>'; var header = headers[h];
return anchor;
}
var linkifyAnchors = function(level, containingElement) {
var headers = containingElement.getElementsByTagName("h"+level); if (typeof header.id !== "undefined" && header.id !== "") {
for(var h=0; h<headers.length; h++){ header.appendChild(anchorForId(header.id));
var header = headers[h]; }
}
};
if( typeof(header.id) !== "undefined" && header.id !== "" ) document.onreadystatechange = function () {
header.appendChild(anchorForId(header.id)); if (this.readyState === "complete") {
} var contentBlock = document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0];
}; if (!contentBlock) {
document.onreadystatechange = function(){ return;
if(this.readyState === "complete"){ }
var contentBlock = document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0] for (var level = 1; level <= 6; level++) {
for(var level=1; level<=6; level++) linkifyAnchors(level, contentBlock);
linkifyAnchors(level, contentBlock); }
} }
} };
</script> </script>

View File

@ -10,7 +10,6 @@
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900"> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900">
<link rel="stylesheet" href="/css/screen.css"> <link rel="stylesheet" href="/css/screen.css">
<link rel="icon" type="image/x-icon" href="/favicon.ico"> <link rel="icon" type="image/x-icon" href="/favicon.ico">
{% include anchor_links.html %}
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script> <script src="/js/html5shiv.min.js"></script>
<script src="/js/respond.min.js"></script> <script src="/js/respond.min.js"></script>

View File

@ -6,6 +6,7 @@
{{ content }} {{ content }}
{% include footer.html %} {% include footer.html %}
{% include anchor_links.html %}
{% include analytics.html %} {% include analytics.html %}
</body> </body>