diff options
author | Ev Bogue <ev@evbogue.com> | 2019-12-07 07:27:54 -0600 |
---|---|---|
committer | Ev Bogue <ev@evbogue.com> | 2019-12-07 07:27:54 -0600 |
commit | f574b936cf06efac899f6dfea2681a3c59fd2fa6 (patch) | |
tree | 681727a75df78d3df947f952aee3807f44f26c32 /render.js | |
parent | dca488003d1f57db840fb9473e61a22a15b96ed7 (diff) |
break settings into own route and make it possible for guests to post advertisements
Diffstat (limited to 'render.js')
-rw-r--r-- | render.js | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -14,22 +14,27 @@ function renderAd (ad) { adspace.appendChild(h('span', {classList: 'right'}, [h('pre', ['ad'])])) } - newAd = h('div', {id: 'ad'}, [ - adspace, - h('p', {innerHTML: marked(ad.content)}), - h('button', {classList: 'right', - onclick: function () { - adspot = document.getElementById('ad') - adspot.parentNode.removeChild(adspot) - } - }, ['Heard']), - h('span', [ - '—', - h('a', {href: ad.name}, [ad.name]) - ]) - ]) - - screen.appendChild(newAd) + open(ad).then(opened => { + quickName(ad.author).then(gotName => { + newAd = h('div', {id: 'ad'}, [ + adspace, + h('p', {innerHTML: marked(opened)}), + h('button', {classList: 'right', + onclick: function () { + adspot = document.getElementById('ad') + adspot.parentNode.removeChild(adspot) + } + }, ['Heard']), + h('span', [ + '—', + h('a', {href: '#' + ad.author}, [gotName]), + ' from ', + h('a', {href: ad.name}, [ad.name]) + ]) + ]) + screen.appendChild(newAd) + }) + }) } function getHeader (post, keys, mini) { |