-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.js
51 lines (46 loc) · 1.69 KB
/
common.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
const apps = [
['StatSim', 'https://statsim.com/app'],
['Analyze', 'https://analyze.li/analyze'],
['Fit', 'https://statsim.com/fit'],
['Forecast', 'https://statsim.com/forecast'],
['Gen', 'https://statsim.com/gen'],
['Profile', 'https://statsim.com/profile'],
['Preview', 'https://statsim.com/preview'],
['Select', 'https://statsim.com/select'],
['Solve', 'https://statsim.com/solve'],
['Vis', 'https://statsim.com/vis']
]
const lis = apps.map(v => `<li><a href="${v[1]}">${v[0]}</a></li>`).join('\n')
const menuEl = document.getElementById('menu')
if (menuEl) {
menuEl.innerHTML = `
<a class='dropdown-trigger btn-flat' href='#' data-target='dropdown1'>☰</a>
<ul id='dropdown1' class='dropdown-content'>${lis}</ul>
`
var existCondition = setInterval(function () {
if (document.getElementById('dropdown1')) {
clearInterval(existCondition)
var elems = document.querySelectorAll('.dropdown-trigger')
M.Dropdown.init(elems, {})
}
}, 100)
}
// Hide the description block
const desc = document.getElementById('description')
if (desc) {
const but = document.createElement('button')
but.className = 'hide-button'
but.innerText = '✕'
but.onclick = function () {
desc.style.display = 'none'
}
desc.appendChild(but)
const feedback_container = document.createElement('div')
feedback_container.classList.add('feedback')
const feedback = document.createElement('a')
feedback.href = 'https://docs.google.com/forms/d/e/1FAIpQLSco13cEc2x4nbmEaaDu3jDg5fa7yN22ufMrxwNjLKAmn5Pf-g/viewform?usp=sf_link'
feedback.innerText = 'Leave feedback'
feedback.target = '_blank'
feedback_container.appendChild(feedback)
desc.appendChild(feedback_container)
}