forked from bisq-network/bisq-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docinfo-footer.html
100 lines (87 loc) · 3.37 KB
/
docinfo-footer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<script>
var devMode = ( ( window.location.protocol ).indexOf( 'file' ) > -1 ) ? true : false;
var pathName = ( window.location.pathname ).replace( "index.html", "" );
var relativePath = "./";
//remove local environment cruft to make local pathname like live pathname
if( devMode ) {
var localEnvMarker = "/html5";
pathName = pathName.substring( pathName.indexOf( localEnvMarker ) + localEnvMarker.length );
}
relativePath = findRelativePath( pathName );
addFavicon();
addLogoImage();
addQuickLinks();
if( pathName !== '/' ) {
addBackLink();
}
function addBackLink() {
var link = document.createElement("a");
link.setAttribute("href", relativePath + "index.html");
link.innerHTML = "← Back to index<br><br>";
var ul = document.createElement("ul");
var li = document.createElement("li");
ul.appendChild(li);
li.appendChild(link);
var toc = document.getElementById('toc');
var next = document.getElementById('toctitle').nextElementSibling;
toc.insertBefore(ul, next);
return;
}
function findRelativePath( pathName ) {
var relativePath = "./";
var pathDepth = 0;
var s = ( pathName ).split('/').length;
if( s > 2 ) {
pathDepth = s - 2;
relativePath = "";
for( var i = 0; i < pathDepth; i++ ) {
relativePath += "../";
}
}
return relativePath;
}
function addLogoImage() {
var tocTop = document.getElementById('toctitle');
var logoImg = document.createElement("img");
var toc = document.getElementById('toc')
logoImg.setAttribute("src", relativePath + "images/bisq-docs.png");
toc.insertBefore(logoImg, tocTop);
logoImg.onclick = function() {
window.location = relativePath + "index.html";
}
return;
}
function addQuickLinks() {
var links = document.getElementsByClassName('quick-link');
var elementClasses = "";
for( var i = 0; i < links.length; i++ ) {
elementClasses = links[i].getAttribute('class');
(function(linkElement) {
linkElement.onclick = function() {
window.location = linkElement.getAttribute("class").split(" ").slice(-1).pop() + ".html";
}
})(links[i]);
}
return;
}
function addFavicon() {
var faviconLink = document.createElement("link");
faviconLink.setAttribute( 'rel', 'icon' );
faviconLink.setAttribute( 'type', 'image/x-icon' );
faviconLink.setAttribute( 'href', relativePath + 'images/favicon.ico' );
document.head.appendChild( faviconLink );
return;
}
//matomo
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo.bisq.network/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '2']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>