-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
57 lines (41 loc) · 1.53 KB
/
script.js
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
/**
*
* Main headlines
*
*/
let mainHeaders = document.getElementById('main-content').getElementsByTagName('h2');
for (var i = 0; i < mainHeaders.length; i++) {
let liFirstAnchor = mainHeaders[i].getElementsByTagName('a')[0];
liFirstAnchor.innerText = i + 1 + ". " + liFirstAnchor.innerText;
}
/**
*
*/
const romeNumbers = ['0', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII'];
let leftSidebarEl = document.querySelectorAll('.docs_sidebar')[1];
let leftSidebarHeadlines = leftSidebarEl.querySelectorAll('h2');
for (var i = 0; i < leftSidebarHeadlines.length; i++) {
let el = leftSidebarHeadlines[i];
console.log(el.innerText);
el.innerText = romeNumbers[i] + ". " + el.innerText;
}
/**
*
* Right side nav
*
*/
let index = document.getElementById('main-content').getElementsByTagName('ul')[0];
let mainUl = index.cloneNode(true);
const indexContainer = document.createElement('div');
indexContainer.setAttribute('id', "indexContainer");
for (var i = 0; i < mainUl.children.length; i++) {
let liFirstAnchor = mainUl.children[i].getElementsByTagName('a')[0];
liFirstAnchor.innerText = i + 1 + ". " + liFirstAnchor.innerText;
mainUl.children[i].setAttribute('class', 'laraveldocs-main-li');
}
indexContainer.appendChild(mainUl);
document.querySelector('#docsScreen').prepend(indexContainer);
//document.querySelector('#main-content').prepend(indexContainer);
//document.getElementsByClassName('laraveldocs-main-li').style.fontWeight = "bold";
/* Hide original */
index.hidden = true;