-
Notifications
You must be signed in to change notification settings - Fork 1
/
_navigation.html
42 lines (39 loc) · 1.08 KB
/
_navigation.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
<lively-script><script>
// #TODO replace with own.. lively-navigation tag #Feature #Component
var context = lively.query(this, "lively-import")
if (context) {
var contextURL = context.getAttribute("src")
}
if (contextURL) {
contextURL = contextURL.replace(/[^\/]*$/,"")
var links = {
Seminars: "index.md",
PX2018: "PX2018",
PX2019: "PX2019",
RE2018: "RE2018",
RP2018: "RP2018",
RP2019: "RP2019",
SWD2015: "SWD2015",
SWD2016: "SWD2016",
SWD2019: "SWD2019",
WebDev2016: "WebDev2016",
WebDev2017: "WebDev2017",
EUD2020: "EUD2020"
}
var container = lively.query(this, "lively-container")
var base = contextURL;
var div = document.createElement("div")
if (container) {
Object.keys(links).forEach(ea => {
div.appendChild(container.createLink(base, ea, links[ea]))
div.appendChild(document.createTextNode(" | "))
})
} else {
div.appendChild(<span>where is my container?</span>)
}
var result = div
} else {
var result = <b>please use lively-import to include this page</b>
};
result
</script></lively-script>