on master help sign in
Merge branch 'master' into patch-2
commit291b6ceda846bf4a00afa4291111fc8c1b22d0e1 authorFundor333 <github@fundor333.com> dateMon 12 Aug 2019, 21:44 (7 years ago) parent0d077171f8934c
4 files changed+13−6
scripts/opml.js+2−2 scripts/sites.js+3−2 scripts/wiki.js+7−2 wiki.html+1
scripts/opml.js+2−2
@@ -4,10 +4,10 @@ const outlines = sites.filter(site => site.rss).map(site => {
44
55const template = `<?xml version="1.0" encoding="UTF-8"?><opml version="1.1"><head></head><body>${outlines.join('')}</body></opml>`
66
7−window.onload = function () {
7+window.addEventListener('DOMContentLoaded', () => {
88 const a = document.getElementById('opml')
99 if (a) {
1010 a.setAttribute('href', 'data:text/plain;charset=utf-8,' + window.encodeURIComponent(template))
1111 a.setAttribute('download', 'webring.opml')
1212 }
13−}
13+})
scripts/sites.js+3−2
@@ -74,7 +74,7 @@ const sites = [
7474 { url: 'https://patrikarvidsson.com' },
7575 { url: 'https://sophieleetmaa.com' },
7676 { url: 'https://xinniw.github.io' },
77− { url: 'https://mboxed.github.io/forida', title: 'Forida', type: 'wiki', author: 'm', contact: 'mboxxed@gmail.com', feed: 'https://mboxed.github.io/forida/tw.txt' },
77+ { url: 'https://mboxed.github.io/sodatsu', title: 'sodatsu', type: 'wiki', author: 'm', contact: 'mboxxed@gmail.com', feed: 'https://mboxed.github.io/sodatsu/tw.txt' },
7878 { url: 'https://letters.vexingworkshop.com' },
7979 { url: 'https://tom.org.nz', title: 'Tom Hackshaw', type: 'portfolio', author: 'tomupom', contact: 'tom@tomhackshaw.com', wiki: 'https://a.tom.org.nz/glossary.ndtl' },
8080 { url: 'https://teknari.com' },
@@ -96,5 +96,6 @@ const sites = [
9696 { url: 'https://opinionatedguide.github.io/', title: 'OpGuides', author: 'vega', contact: 'vegac@protonmail.com', feed: 'https://opinionatedguide.github.io/twtxt.txt' },
9797 { url: 'https://chrismaughan.com/', title: 'CMaughan', author: 'cmaughan', contact: 'mornymorny@gmail.com', feed: 'https://chrismaughan.com/twtxt.txt' },
9898 { url: 'https://oddworlds.org/', title: 'oddworlds soliloquy', type: 'blog', author: 'RaelZero', contact: 'gaz.gong@gmail.com' },
99− { url: 'https://fundor333.com/', title: 'Fundor333', type: 'blog', author: 'Fundor 333', contact: 'blog@fundor333.com' , feed: "https://fundor333.com/twtxt.txt" }
99+ { url: 'https://fundor333.com/', title: 'Fundor333', type: 'blog', author: 'Fundor 333', contact: 'blog@fundor333.com' , feed: "https://fundor333.com/twtxt.txt" },
100+ { url: 'https://cass.si/', contact: 'm@cass.si' }
100101]
scripts/wiki.js+7−2
@@ -55,11 +55,16 @@ const Wiki = sites => {
5555 return `${currentHtml}${newHtml}`
5656 }
5757
58+ const formatLinks = text => text.replace(
59+ /\b((https?|dat):\/\/[^"\s]+)/g,
60+ '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>'
61+ )
62+
5863 const formatEntry = (definitions, definition) => {
59− const formatEntryList = entryList => entryList.reduce((items, item) => `${items}<li>${item}</li>`, '')
64+ const formatEntryList = entryList => entryList.reduce((items, item) => `${items}<li>${formatLinks(item)}</li>`, '')
6065
6166 const newHtml = typeof definition.entry === 'string'
62− ? `<li>${definition.entry}
67+ ? `<li>${formatLinks(definition.entry)}
6368 - <a class='author' target='_blank' href='${definition.url}'> @${definition.author}</a>
6469 </li>`
6570 : `<li><ul>${formatEntryList(definition.entry)}
wiki.html+1
@@ -9,6 +9,7 @@
99 <script src="scripts/wiki.js"></script>
1010 <script src="scripts/sites.js"></script>
1111 <script src="scripts/indental.js"></script>
12+ <script src="scripts/opml.js"></script>
1213 <title>Wiki</title>
1314</head>
1415<body>