git ssb

16+

Dominic / patchbay



Commit ed00f21688c47a809f1724a50ce7a3239f9929a6

style tweaks

mixmix committed on 11/28/2018, 2:57:09 AM
Parent: 21a357c1d2cbc1d5afe8c4a0ddf6a109ac2920ef

Files changed

app/page/channel.jschanged
app/page/thread.mcsschanged
app/styles/mcss/markdown.mcsschanged
message/html/layout/all.mcsschanged
message/html/layout/default.mcsschanged
message/html/meta/unread.jschanged
message/html/backlinks.jsadded
message/html/backlinks.mcssadded
app/page/channel.jsView
@@ -50,22 +50,27 @@
5050
5151 const openChannelSource = api.feed.pull.channel(channelName)
5252
5353 pull(
54- openChannelSource({old: false}),
54 + openChannelSource({ old: false }),
5555 filterUpThrough(),
56- Scroller(container, content, api.message.html.render, true, false)
56 + Scroller(container, content, render, true, false)
5757 )
5858
5959 pull(
60- openChannelSource({reverse: true}),
60 + openChannelSource({ reverse: true }),
6161 filterDownThrough(),
62- Scroller(container, content, api.message.html.render, false, false)
62 + Scroller(container, content, render, false, false)
6363 )
6464 }
6565 draw()
6666
67- var page = h('Page -channel', {title: channel}, [
67 + // TODO rollups
68 + function render (msg) {
69 + return api.message.html.render(msg, { showTitle: true })
70 + }
71 +
72 + var page = h('Page -channel', { title: channel }, [
6873 // filterMenu, // TODO - extract non-scroller els like filterMenu here
6974 container
7075 ])
7176
app/page/thread.mcssView
@@ -47,9 +47,9 @@
4747 section.content {}
4848
4949 section.bottom {
5050 // copied from Message.-default
51- padding: 1rem .5rem
51 + padding: 1rem 0
5252 display: grid
5353 grid-template-columns: 6rem 1fr minmax(6rem, auto)
5454 grid-gap: 1.5rem
5555
app/styles/mcss/markdown.mcssView
@@ -1,14 +1,23 @@
11 Markdown {
2 + (a) {
3 + color: #3c1842
4 + text-decoration: underline
5 +
6 + :hover {
7 + color: #a341b4
8 + }
9 + }
10 +
211 p, ul, ol {
312 }
413
514 p {
615 :first-of-type { margin-top: 0 }
716 :last-of-type { margin-bottom: 0 }
817
918 a {
10- img { margin 0 .5rem }
19 + img { margin: .5rem 0 }
1120
1221 :only-of-type {
1322 img {
1423 display: block
@@ -44,12 +53,17 @@
4453 padding: 0.1rem .2rem
4554 }
4655
4756 blockquote {
57 + font-size: .9rem
58 + line-height: 1.4rem
4859 color: #666
49- font-style: italic
50- font-size: 1rem
5160
61 + background: rgba(0,0,0,.05)
62 + padding: 1rem
63 + border-left: 4px solid rgba(0,0,0,.1)
64 + margin: 0
65 +
5266 p {
5367 :last-child {
5468 margin-bottom: .35ex
5569 }
message/html/layout/all.mcssView
@@ -1,6 +1,6 @@
11 Message {
22 /* UnreadFeature (search codebase for this if extracting) */
3- (i.unread) {
3 + (div.unread) {
44 display: none
55 }
66 }
message/html/layout/default.mcssView
@@ -144,12 +144,17 @@
144144 /* initially unread */
145145 -unread {
146146 section.right {
147147 div.meta {
148- i.unread {
148 + div.unread {
149149 display: initial
150- transition: color 1s ease-in
150 + padding: 1px 4px
151 +
152 + transition: color, border 1s ease-in
153 +
151154 color: hotpink
155 + border: 1px solid hotpink
156 + border-radius: 2px
152157 }
153158 }
154159 }
155160 }
@@ -158,10 +163,11 @@
158163 -unread {
159164 -read {
160165 section.right {
161166 div.meta {
162- i.unread {
167 + div.unread {
163168 color: #bbb
169 + border: 1px solid #bbb
164170 }
165171 }
166172 }
167173 }
message/html/meta/unread.jsView
@@ -12,9 +12,7 @@
1212 return nest('message.html.meta', unread)
1313
1414 // UnreadFeature (search codebase for this if extracting)
1515 function unread (msg) {
16- return h('i.unread.fa.fa-star', {
17- title: 'A new message'
18- })
16 + return h('div.unread', { title: 'A new message' }, 'new')
1917 }
2018 }
message/html/backlinks.jsView
@@ -1,0 +1,48 @@
1 +const nest = require('depnest')
2 +const { h, map, computed, when } = require('mutant')
3 +const ref = require('ssb-ref')
4 +
5 +exports.needs = nest({
6 + 'message.obs.backlinks': 'first',
7 + 'message.obs.name': 'first',
8 + 'message.async.name': 'first',
9 + 'sbot.sync.cache': 'first'
10 +})
11 +
12 +exports.gives = nest('message.html.backlinks')
13 +
14 +exports.create = function (api) {
15 + return nest('message.html.backlinks', function (msg) {
16 + if (!ref.isMsg(msg.key)) return []
17 + var backlinks = api.message.obs.backlinks(msg.key)
18 + var references = computed([backlinks, msg], onlyReferences)
19 + return when(computed(references, hasItems),
20 + h('MessageBacklinks', [
21 + h('header', 'Referenced:'),
22 + h('ul', [
23 + map(references, (backlink) => {
24 + return h('li', [
25 + h('a -backlink', { href: backlink.id, title: backlink.id }, api.message.obs.name(backlink.id))
26 + ])
27 + })
28 + ])
29 + ])
30 + )
31 + })
32 +}
33 +
34 +function onlyReferences (backlinks, msg) {
35 + return backlinks.filter(link => link.root !== msg.key && !includeOrEqual(link.branch, msg.key))
36 +}
37 +
38 +function hasItems (items, msg) {
39 + return (items && items.length)
40 +}
41 +
42 +function includeOrEqual (valueOrArray, item) {
43 + if (Array.isArray(valueOrArray)) {
44 + return valueOrArray.includes(item)
45 + } else {
46 + return valueOrArray === item
47 + }
48 +}
message/html/backlinks.mcssView
@@ -1,0 +1,20 @@
1 +MessageBacklinks {
2 + font-size: .8rem
3 + color: grey
4 +
5 + background: rgba(0,0,0,.05)
6 + padding: .7rem 1rem 1rem
7 + margin-top: 1rem
8 +
9 + header {
10 + font-weight: 600
11 + letter-spacing: 1px
12 + }
13 +
14 + ul {
15 + margin-bottom: 0
16 + li {
17 + a { color: grey }
18 + }
19 + }
20 +}

Built with git-ssb-web