@explorable-viz/fluid 0.7.30 → 0.7.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +0,0 @@
1
- <div></div>
2
- <div></div>
3
- <div>
4
- <h3 class="title">Overview</h3>
5
- <nav class="sub-header">
6
- <ul>
7
- <li><a href="/">Transparent research outputs</a></li>
8
- <li><a href="/convolution">Matrix convolution</a></li>
9
- <li><a href="/moving-average">Moving average</a></li>
10
- </ul>
11
- </nav>
12
- </div>
@@ -1,72 +0,0 @@
1
- function loadHeader () {
2
- fetch('/shared/header.html')
3
- .then(response => response.text())
4
- .then(data => {
5
- const header = document.createElement('div')
6
- header.innerHTML = data
7
- activateCurrentLink(header)
8
- const divElement = header.children[0]
9
- const grid = document.getElementById('grid')
10
- grid.parentNode.insertBefore(divElement, grid)
11
- })
12
- .catch(error => console.error('Error loading shared HTML:', error))
13
-
14
- fetch('/shared/footer.html')
15
- .then(response => response.text())
16
- .then(data => {
17
- const footer = document.createElement('div')
18
- footer.innerHTML = data
19
- const divElement = footer.children[0]
20
- const grid = document.getElementById('grid')
21
- grid.parentNode.appendChild(divElement)
22
- })
23
- .catch(error => console.error('Error loading shared HTML:', error))
24
- }
25
-
26
- function eqPaths (path1, path2) {
27
- const trailingSlashes = /\/+$/
28
- return path1.replace(trailingSlashes, '') === path2.replace(trailingSlashes, '')
29
- }
30
-
31
- function activateCurrentLink (el) {
32
- const listItems = el.querySelectorAll('li')
33
- const n_ = Array.from(listItems).findIndex(li => {
34
- const link = li.querySelector('a')
35
- return link && eqPaths(link.getAttribute('href'), window.location.pathname)
36
- })
37
- if (n_ !== -1) {
38
- listItems[n_].classList.add('active-page')
39
- }
40
- }
41
-
42
- function loadSubHeader () {
43
- fetch('/shared/sub-header.html')
44
- .then(response => response.text())
45
- .then(data => {
46
- const header = document.createElement('div')
47
- header.innerHTML = data
48
- activateCurrentLink(header)
49
- const divElements = header.children
50
- const grid = document.getElementById('grid')
51
- for (let i = Math.min(3, divElements.length - 1); i >= 0; --i) {
52
- grid.insertBefore(divElements[i], grid.firstChild)
53
- }
54
- })
55
- .catch(error => console.error('Error loading shared HTML:', error))
56
- }
57
-
58
- function toggleDataPane(gridId) {
59
- const grid = document.getElementById(gridId)
60
- const hidden = grid.classList.contains('data-pane-hidden')
61
- const dataPaneButton = document.querySelector('.data-pane-button')
62
-
63
- if (hidden) {
64
- grid.classList.remove('data-pane-hidden')
65
- dataPaneButton.classList.remove('fa-eye-slash')
66
- dataPaneButton.classList.add('fa-eye')
67
- } else {
68
- grid.classList.add('data-pane-hidden')
69
- dataPaneButton.classList.remove('fa-eye')
70
- dataPaneButton.classList.add('fa-eye-slash')
71
- }
72
- }