aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-28 19:31:32 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-28 19:53:31 -1000
commit05865706da36f4f3f7c2d03df4065ffdd9911a69 (patch)
tree60cc30fcd23813d1a653cc5e1a4db1f275b3aee0 /lib/serve.js
parent932500d6d44c7aba8f2f1eb077365ed0ee504d2c (diff)
downloadpatchfoo-05865706da36f4f3f7c2d03df4065ffdd9911a69.tar.gz
patchfoo-05865706da36f4f3f7c2d03df4065ffdd9911a69.zip
Make nav links configurable
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js31
1 files changed, 10 insertions, 21 deletions
diff --git a/lib/serve.js b/lib/serve.js
index e4f2c9e..e3901a0 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1666,27 +1666,16 @@ Serve.prototype.wrapPage = function (title, searchQ) {
),
h('body',
h('nav.nav-bar', h('form', {action: render.toUrl('/search'), method: 'get'},
- h('a', {href: render.toUrl('/new')}, 'new') , ' ',
- h('a', {href: render.toUrl('/public')}, 'public'), ' ',
- h('a', {href: render.toUrl('/private')}, 'private') , ' ',
- h('a', {href: render.toUrl('/mentions')}, 'mentions') , ' ',
- h('a', {href: render.toUrl('/peers')}, 'peers') , ' ',
- self.app.sbot.status ?
- [h('a', {href: render.toUrl('/status')}, 'status'), ' '] : '',
- h('a', {href: render.toUrl('/channels')}, 'channels') , ' ',
- h('a', {href: render.toUrl('/tags')}, 'tags') , ' ',
- h('a', {href: render.toUrl('/friends')}, 'friends'), ' ',
- h('a', {href: render.toUrl('/advsearch')}, 'search'), ' ',
- h('a', {href: render.toUrl('/live')}, 'live'), ' ',
- h('a', {href: render.toUrl('/compose')}, 'compose'), ' ',
- // h('a', {href: render.toUrl('/votes')}, 'votes'), ' ',
- h('a', {href: render.toUrl('/emojis')}, 'emojis'), ' ',
- render.idLink(self.app.sbot.id, done()), ' ',
- h('input.search-input', {name: 'q', value: searchQ,
- placeholder: 'search'})
- // h('a', {href: '/convos'}, 'convos'), ' ',
- // h('a', {href: '/friends'}, 'friends'), ' ',
- // h('a', {href: '/git'}, 'git')
+ self.app.navLinks.map(function (link, i) {
+ return [i == 0 ? '' : ' ',
+ link === 'self' ? render.idLink(self.app.sbot.id, done()) :
+ link === 'searchbox' ? h('input.search-input',
+ {name: 'q', value: searchQ, placeholder: 'search'}) :
+ link === 'search' ? h('a', {href: render.toUrl('/advsearch')}, 'search') :
+ typeof link === 'string' ? h('a', {href: render.toUrl('/' + link)}, link) :
+ link ? h('a', {href: render.toUrl(link.url)}, link.name) : ''
+ ]
+ })
)),
self.publishedMsg ? h('div',
'published ',