on master help sign in
clean up
e6044f8ckipp01
links/main.css+1−1
@@ -6,7 +6,7 @@ body div ul { max-width: 800px; padding-bottom: 15px;margin-bottom:15px; overflo
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; }
9−body b { font-weight: normal; font-family: 'input_mono_medium' }
9+body strong { font-weight: normal; font-family: 'input_mono_medium' }
10body div p.readme { max-width:500px; }
10body div p.readme { max-width:500px; }
11body .col3 { columns:3; }
11body .col3 { columns:3; }
12body .selected { background: white; color:black; }
12body .selected { background: white; color:black; }
scripts/hallway.js+1−1
@@ -20,7 +20,7 @@ function Hallway (sites) {
20 this._sidebar.id = 'sidebar'
20 this._sidebar.id = 'sidebar'
21 this._footer = document.createElement('p')
21 this._footer = document.createElement('p')
22 this._footer.id = 'footer'
22 this._footer.id = 'footer'
23− this._footer.innerHTML = `The <b>Wiki</b> is a decentralized forum, to join the conversation, add a <a href="https://github.com/XXIIVV/webring#joining-the-hallway">feed:</a> field to your entry in the <a href="https://github.com/XXIIVV/Webring/">webring</a>.`
23+ this._footer.innerHTML = `The <strong>Wiki</strong> is a decentralized forum, to join the conversation, add a <a href="https://github.com/XXIIVV/webring#joining-the-hallway">feed:</a> field to your entry in the <a href="https://github.com/XXIIVV/Webring/">webring</a>.`
24
24
25 this.install = function (host) {
25 this.install = function (host) {
26 this._el.appendChild(this._entries)
26 this._el.appendChild(this._entries)
scripts/indental.js−2
@@ -55,5 +55,3 @@ function indental (data, Type) {
55 }
55 }
56 return h
56 return h
57}
57}
58−
59−module.exports = indental
scripts/sites.js+1−1
@@ -4,7 +4,7 @@
4// protocol://url.domain.ext
4// protocol://url.domain.ext
5
5
6const sites = [
6const sites = [
7− { url: 'https://wiki.xxiivv.com', title: 'xxiivv', type: 'wiki', author: 'neauoire', contact: 'aliceffekt@gmail.com', rss: 'https://wiki.xxiivv.com/links/rss.xml', feed: 'https://wiki.xxiivv.com/twtxt.txt', feed: 'https://wiki.xxiivv.com/twtxt.txt', wiki: 'https://wiki.xxiivv.com/scripts/database/glossary.ndtl' },
7+ { url: 'https://wiki.xxiivv.com', title: 'xxiivv', type: 'wiki', author: 'neauoire', contact: 'aliceffekt@gmail.com', rss: 'https://wiki.xxiivv.com/links/rss.xml', feed: 'https://wiki.xxiivv.com/twtxt.txt', wiki: 'https://wiki.xxiivv.com/scripts/database/glossary.ndtl' },
8 { url: 'http://estevancarlos.com' },
8 { url: 'http://estevancarlos.com' },
9 { url: 'https://electro.pizza', title: 'electro pizza', type: 'blog', author: 'rho', rss: 'https://electro.pizza/feed.xml', feed: 'https://electro.pizza/twtxt.txt' },
9 { url: 'https://electro.pizza', title: 'electro pizza', type: 'blog', author: 'rho', rss: 'https://electro.pizza/feed.xml', feed: 'https://electro.pizza/twtxt.txt' },
10 { url: 'https://avanier.now.sh', title: 'Arachne', type: 'wiki', author: 'joshavanier', contact: 'joshavanier@protonmail.com', feed: 'https://avanier.now.sh/tw.txt' },
10 { url: 'https://avanier.now.sh', title: 'Arachne', type: 'wiki', author: 'joshavanier', contact: 'joshavanier@protonmail.com', feed: 'https://avanier.now.sh/tw.txt' },
scripts/wiki.js+14−26
@@ -14,7 +14,7 @@ function Wiki (sites) {
14
14
15 this._footer = document.createElement('p')
15 this._footer = document.createElement('p')
16 this._footer.id = 'footer'
16 this._footer.id = 'footer'
17− this._footer.innerHTML = `The <b>Wiki</b> is a decentralized encyclopedia, to join the conversation, add a <a href="https://github.com/XXIIVV/webring#joining-the-wiki">wiki:</a> field to your entry in the <a href="https://github.com/XXIIVV/Webring/">webring</a>.`
17+ this._footer.innerHTML = `The <strong>Wiki</strong> is a decentralized encyclopedia, to join the conversation, add a <a href="https://github.com/XXIIVV/webring#joining-the-wiki">wiki:</a> field to your entry in the <a href="https://github.com/XXIIVV/Webring/">webring</a>.`
18
18
19 this.loc = ''
19 this.loc = ''
20 this.byName = {}
20 this.byName = {}
@@ -38,17 +38,14 @@ function Wiki (sites) {
38 // Main
38 // Main
39 if (this.loc) {
39 if (this.loc) {
40 if (this.byCat[this.loc]) {
40 if (this.byCat[this.loc]) {
41− let html = ''
42− for (const id in this.byCat[this.loc]) {
43− const name = this.byCat[this.loc][id].name
44− html += `${this.templateTerm(name, this.byName[name])}<br />`
41+ const formatHtml = (entries, entry) => `${entries} ${this.templateTerm(entry.name, this.byName[entry.name])}<br />`
45− }
42+ const html = this.byCat[this.loc].reduce(formatHtml, '')
46 this._entry.innerHTML = html
43 this._entry.innerHTML = html
47 } else if (this.byName[this.loc]) {
44 } else if (this.byName[this.loc]) {
48− let html = `${this.templateTerm(this.loc, this.byName[this.loc])}<br />${this.templateRelated(this.loc, this.byName[this.loc])}`
45+ const html = `${this.templateTerm(this.loc, this.byName[this.loc])}<br />${this.templateRelated(this.loc)}`
49 this._entry.innerHTML = html
46 this._entry.innerHTML = html
50 } else {
47 } else {
51− let html = `Unknown: ${this.loc}. Retun <a onclick='wiki.go("")'>home</a>, or try a <a onclick='wiki.go("${this.random()}")'>random page</a>.`
48+ const html = `Unknown: ${this.loc}. Retun <a onclick='wiki.go("")'>home</a>, or try a <a onclick='wiki.go("${this.random()}")'>random page</a>.`
52 this._entry.innerHTML = html
49 this._entry.innerHTML = html
53 }
50 }
54 } else {
51 } else {
@@ -82,16 +79,14 @@ function Wiki (sites) {
82 return this.byName[name] ? this.byName[name][0].cat : ''
79 return this.byName[name] ? this.byName[name][0].cat : ''
83 }
80 }
84
81
85− this.templateRelated = (name, entry) => {
82+ this.templateRelated = (name) => {
86− let html = ''
87− const cat = entry.cat
88 const relatedWords = this.related(name)
83 const relatedWords = this.related(name)
89− 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>`
84+ const 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>`
90 return html
85 return html
91 }
86 }
92
87
93 this.templateTerm = (name, entry) => {
88 this.templateTerm = (name, entry) => {
94− 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>'
89+ return '<ul class="term"><li class="name"><strong>' + name.toLowerCase() + '</strong></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>'
95 }
90 }
96
91
97 this.fetch = () => {
92 this.fetch = () => {
@@ -108,20 +103,13 @@ function Wiki (sites) {
108 }
103 }
109
104
110 this.add = (name, value, cat, origin) => {
105 this.add = (name, value, cat, origin) => {
111− //
112− if (!this.byName[name]) {
113− this.byName[name] = []
106+ this.byName[name] = this.byName[name] || []
114− }
115 this.byName[name].push({ name, value, cat, origin })
107 this.byName[name].push({ name, value, cat, origin })
116− //
108+
117− if (!this.byCat[cat]) {
118− this.byCat[cat] = []
109+ this.byCat[cat] = this.byCat[cat] || []
119− }
120 this.byCat[cat].push({ name, value, cat, origin })
110 this.byCat[cat].push({ name, value, cat, origin })
121− //
111+
122− if (!this.byAuthor[origin.author]) {
123− this.byAuthor[origin.author] = []
112+ this.byAuthor[origin.author] = this.byAuthor[origin.author] || []
124− }
125 this.byAuthor[origin.author].push({ name, value, cat, origin })
113 this.byAuthor[origin.author].push({ name, value, cat, origin })
126 }
114 }
127
115
@@ -136,5 +124,5 @@ function Wiki (sites) {
136 }
124 }
137 }
125 }
138
126
139− String.prototype.toUrl = function () { return this.toLowerCase().replace(/ /g, '+').replace(/[^0-9a-z\+\:\-\.\/\~]/gi, '').trim() }
127+ String.prototype.toUrl = function () { return this.toLowerCase().replace(/ /g, '+').replace(/[^0-9a-z+:\-./~]/gi, '').trim() }
140}
128}