Merge pull request #2368 from XhmikosR/master
This commit is contained in:
commit
31d7afc987
|
@ -1,27 +1,32 @@
|
|||
<script type="text/javascript" charset="utf-8">
|
||||
var anchorForId = function(id){
|
||||
<script>
|
||||
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");
|
||||
anchor.className = "header-link";
|
||||
anchor.href = "#" + id;
|
||||
anchor.innerHTML = '<i class="fa fa-link"></i>';
|
||||
return anchor;
|
||||
}
|
||||
var linkifyAnchors = function(level, containingElement) {
|
||||
var linkifyAnchors = function (level, containingElement) {
|
||||
var headers = containingElement.getElementsByTagName("h" + level);
|
||||
for (var h = 0; h < headers.length; h++) {
|
||||
var header = headers[h];
|
||||
|
||||
var headers = containingElement.getElementsByTagName("h"+level);
|
||||
for(var h=0; h<headers.length; h++){
|
||||
var header = headers[h];
|
||||
if (typeof header.id !== "undefined" && header.id !== "") {
|
||||
header.appendChild(anchorForId(header.id));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if( typeof(header.id) !== "undefined" && header.id !== "" )
|
||||
header.appendChild(anchorForId(header.id));
|
||||
}
|
||||
};
|
||||
document.onreadystatechange = function(){
|
||||
if(this.readyState === "complete"){
|
||||
var contentBlock = document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0]
|
||||
for(var level=1; level<=6; level++)
|
||||
linkifyAnchors(level, contentBlock);
|
||||
}
|
||||
}
|
||||
document.onreadystatechange = function () {
|
||||
if (this.readyState === "complete") {
|
||||
var contentBlock = document.getElementsByClassName("docs")[0] || document.getElementsByClassName("news")[0];
|
||||
if (!contentBlock) {
|
||||
return;
|
||||
}
|
||||
for (var level = 1; level <= 6; level++) {
|
||||
linkifyAnchors(level, contentBlock);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -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="/css/screen.css">
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||
{% include anchor_links.html %}
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/js/html5shiv.min.js"></script>
|
||||
<script src="/js/respond.min.js"></script>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
{{ content }}
|
||||
|
||||
{% include footer.html %}
|
||||
{% include anchor_links.html %}
|
||||
{% include analytics.html %}
|
||||
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue