on master help sign in
Added related words
c8ebf17Devine Lu Linvega
links/main.css+6−5
@@ -2,23 +2,24 @@
2
2
3body { background:#f4f4f4; padding:0px; margin:0px; }
3body { background:#f4f4f4; padding:0px; margin:0px; }
4body > div { display:block; background: #111;min-height: calc(100vh - 60px);width: calc(100vw - 60px);margin: 15px;color: #333;padding: 15px;font-family:'input_mono_regular', 'Monospaced','Courier New',courier;font-size:11px; position: relative; border-radius: 2px; color:white; overflow: hidden;}
4body > div { display:block; background: #111;min-height: calc(100vh - 60px);width: calc(100vw - 60px);margin: 15px;color: #333;padding: 15px;font-family:'input_mono_regular', 'Monospaced','Courier New',courier;font-size:11px; position: relative; border-radius: 2px; color:white; overflow: hidden;}
5−body div ul { max-width: 800px; border-bottom: 2px solid white;padding-bottom: 15px;margin-bottom:15px; overflow: hidden;}
5+body div ul { max-width: 800px; padding-bottom: 15px;margin-bottom:15px; overflow: hidden;}
6body div p { display:block; padding:0px 5px; line-height: 20px; max-width: 600px}
6body div p { display:block; padding:0px 5px; line-height: 20px; max-width: 600px}
7body div p a { text-decoration: underline; cursor: pointer;}
7body div p a { text-decoration: underline; cursor: pointer;}
8body div p a:hover { text-decoration: underline; }
8body div p a:hover { text-decoration: underline; }
9body b { font-weight: normal; font-family: 'input_mono_medium' }
9body b { font-weight: normal; font-family: 'input_mono_medium' }
10body div p.readme { max-width:500px; }
10body div p.readme { max-width:500px; }
11+body .col3 { columns:3; }
12+body .selected { background: white; color:black; }
11
13
12body #sidebar { position: absolute;top: 0px;right: 0px;padding: 15px;width: 200px; overflow: hidden;}
14body #sidebar { position: absolute;top: 0px;right: 0px;padding: 15px;width: 200px; overflow: hidden;}
13body #sidebar > * { border-bottom: 0px; line-height: 16px; padding-bottom: 0px }
15body #sidebar > * { border-bottom: 0px; line-height: 16px; padding-bottom: 0px }
14body #sidebar > * li { text-transform: lowercase; }
16body #sidebar > * li { text-transform: lowercase; }
15−body #sidebar > * li.selected { background: white; color:black; }
16body #sidebar > * li:hover { cursor: pointer; }
17body #sidebar > * li:hover { cursor: pointer; }
17body #sidebar > * li span.right { color:#555; float:right; }
18body #sidebar > * li span.right { color:#555; float:right; }
18body #sidebar > * li span.right:after { content: " msgs"; }
19body #sidebar > * li span.right:after { content: " msgs"; }
19body #sidebar #channels li:before, body #sidebar #categories li:before { content:'/'; }
20body #sidebar #channels li:before, body #sidebar #categories li:before { content:'/'; }
20body #sidebar #users li:before { content:'@'; }
21body #sidebar #users li:before { content:'@'; }
21−body #footer { padding-left: 60px;background-image: url(../icon.white.svg);background-size: 40px;background-repeat: no-repeat;background-position: 0px 15px;border-top: 2px solid white;padding-top: 15px; margin-top:15px;}
22+body #footer { padding-left: 60px;background-image: url(../icon.white.svg);background-size: 40px;background-repeat: no-repeat;background-position: 0px 15px;border-top: 2px solid white;padding-top: 15px; margin-top:15px; max-width: 100%}
22
23
23@media only screen and (min-width:200px) and (max-width: 800px) {
24@media only screen and (min-width:200px) and (max-width: 800px) {
24 body #hallway #sidebar { position: absolute;top: 0px;right: 0px;padding: 15px;width: 200px;display: none;background-color: #000; }
25 body #hallway #sidebar { position: absolute;top: 0px;right: 0px;padding: 15px;width: 200px;display: none;background-color: #000; }
@@ -31,7 +32,6 @@ body #hallway #entries { width: calc(100vw - 300px) !important; }
31
32
32body #hallway #pagination { margin: 10px; text-align: center; }
33body #hallway #pagination { margin: 10px; text-align: center; }
33body #hallway #pagination span { padding: 3px; margin: 2px; cursor: pointer; }
34body #hallway #pagination span { padding: 3px; margin: 2px; cursor: pointer; }
34−body #hallway #pagination span.selected { background: white; color:black; }
35
35
36body #hallway .entry { line-height: 16px; display: block; position: relative; padding-left:100px; }
36body #hallway .entry { line-height: 16px; display: block; position: relative; padding-left:100px; }
37body #hallway .entry .date { color: #555;display: block;float:right; margin-left:20px; padding-bottom: 16px;}
37body #hallway .entry .date { color: #555;display: block;float:right; margin-left:20px; padding-bottom: 16px;}
@@ -79,9 +79,10 @@ body #portal ul li a:hover { text-decoration: underline; }
79
79
80/* Wiki */
80/* Wiki */
81
81
82−body #wiki #entry { max-width: calc(100% - 230px); margin-bottom: 30px }
82+body #wiki #entry { max-width: calc(100% - 230px); margin-bottom: 30px; line-height: 15px }
83body #wiki #entry a { text-decoration: underline; }
83body #wiki #entry a { text-decoration: underline; }
84body #wiki ul.term { border-bottom: 0px; margin-bottom: 0px; padding-bottom: 0px}
84body #wiki ul.term { border-bottom: 0px; margin-bottom: 0px; padding-bottom: 0px}
85+body #wiki ul.term li { margin-bottom: 5px }
85body #wiki ul.term li.name { margin-bottom: 5px }
86body #wiki ul.term li.name { margin-bottom: 5px }
86body #wiki ul.term li a.author { color:#555; text-decoration: none !important; }
87body #wiki ul.term li a.author { color:#555; text-decoration: none !important; }
87
88
scripts/wiki.js+15−2
@@ -35,8 +35,8 @@ function Wiki (sites) {
35 this.refresh = () => {
35 this.refresh = () => {
36 // Main
36 // Main
37 if (this.loc) {
37 if (this.loc) {
38− if (this.byCat[this.byName]) {
38+ if (this.byName[this.loc]) {
39− let html = `term: ${this.loc}`
39+ let html = `${this.templateTerm(this.loc, this.byName[this.loc])}<br />${this.templateRelated(this.loc, this.byName[this.loc])}`
40 this._entry.innerHTML = html
40 this._entry.innerHTML = html
41 } else if (this.byCat[this.loc]) {
41 } else if (this.byCat[this.loc]) {
42 let html = ''
42 let html = ''
@@ -74,6 +74,19 @@ function Wiki (sites) {
74 return keys[target]
74 return keys[target]
75 }
75 }
76
76
77+ this.related = (name) => {
78+ const cat = this.byName[name][0].cat
79+ return this.byCat[cat]
80+ }
81+
82+ this.templateRelated = (name, entry) => {
83+ let html = ''
84+ const cat = entry.cat
85+ const relatedWords = this.related(name)
86+ html += `<ul class='col3'>${relatedWords.reduce((acc, item, id) => { return `${acc}<li onclick='wiki.go("${item.name}")' class='${wiki.at(item.name) ? 'selected' : ''}'>${item.name.toLowerCase()}</li>` }, '')}</ul>`
87+ return html
88+ }
89+
77 this.templateTerm = (name, entry) => {
90 this.templateTerm = (name, entry) => {
78 return '<ul class="term"><li class="name"><b>' + name.toLowerCase() + '</b></li>' + entry.reduce((acc, item) => { return `${acc}<li>${item.value} <a class='author' target='_blank' href='${item.origin.url}'> — @${item.origin.author}</a></li>` }, '') + '</ul>'
91 return '<ul class="term"><li class="name"><b>' + name.toLowerCase() + '</b></li>' + entry.reduce((acc, item) => { return `${acc}<li>${item.value} <a class='author' target='_blank' href='${item.origin.url}'> — @${item.origin.author}</a></li>` }, '') + '</ul>'
79 }
92 }