git ssb

16+

Dominic / patchbay



Commit 822d7aba3e5e907a98c48a9abe3223cc278c6c95

changes from mix's feedback

Michael Williams committed on 12/27/2016, 4:01:34 AM
Parent: f11783d11c708f64970a272ab558eb7e3ad1820b

Files changed

index.jschanged
modules_basic/about.jschanged
modules_basic/about.mcsschanged
modules_basic/message-author.jschanged
modules_basic/message.jschanged
package.jsonchanged
index.jsView
@@ -1,4 +1,7 @@
1 +// polyfills
2 +require('setimmediate')
3 +
14 require('depject')(
25 // from more specialized to more general
36 require('./modules_extra'),
47 require('./modules_basic'),
modules_basic/about.jsView
@@ -42,9 +42,9 @@
4242 var { content: about, author: authorId } = msg.value
4343 var { about: aboutId, name, image, description } = about
4444
4545 if (!aboutId) return null
46- if (!image && !description)
46 + if (image || description) return null
4747
4848 return h('About', Name({ aboutId, authorId, name }))
4949 }
5050
modules_basic/about.mcssView
@@ -2,17 +2,19 @@
22 display: flex
33 flex-wrap: wrap
44
55 section {
6- a {
7- -target {
8- color: green
9- }
10- -name {
6 + header {
7 + a {
8 + -target {
9 + color: green
10 + }
11 + -name {
1112
12- }
13- -image {
13 + }
14 + -image {
1415
16 + }
1517 }
1618 }
1719
1820 -name {
modules_basic/message-author.jsView
@@ -21,15 +21,16 @@
2121 mcss: () => fs.readFileSync(Path.join(__dirname, 'message-author.mcss'))
2222 }
2323
2424 function message_author (msg, opts = {}) {
25- var { size = 1 } = opts
25 + var { size = 'small' } = opts
2626 var { value } = msg
2727 var { author } = value
28 +
2829 return h('MessageAuthor', {
29- className: size === 0 ? '-mini' : ''
30 + className: `-${size}`
3031 }, [
31- when(size > 0,
32 + when(size !== 'mini',
3233 h('section -image', api.avatar_link(author, api.avatar_image(author, 'thumbnail')))
3334 ),
3435 h('section -name', api.avatar_link(author, api.avatar_name(author))),
3536 h('section -timestamp', api.timestamp(msg))
modules_basic/message.jsView
@@ -31,9 +31,9 @@
3131 function message_render (msg, sbot) {
3232 var content = api.message_content_mini(msg)
3333 if (content) return mini(msg, content)
3434
35- var content = api.message_content(msg)
35 + content = api.message_content(msg)
3636 if (!content) return mini(msg, message_content_mini_fallback(msg))
3737
3838 return h('Message', {
3939 'ev-keydown': navigateToMessageOnEnter,
@@ -72,9 +72,9 @@
7272 attributes: {
7373 tabindex: '0'
7474 }
7575 }, [
76- h('header.author', api.message_author(msg, { size: 0 })),
76 + h('header.author', api.message_author(msg, { size: 'mini' })),
7777 h('section.meta', api.message_meta(msg)),
7878 h('section.content', el)
7979 ])
8080 }
package.jsonView
@@ -38,8 +38,9 @@
3838 "pull-reconnect": "^0.0.3",
3939 "pull-scroll": "^0.2.0",
4040 "pull-stream": "^3.4.5",
4141 "scuttlebot": "^8.7.2",
42 + "setimmediate": "^1.0.5",
4243 "simple-mime": "^0.1.0",
4344 "split-buffer": "^1.0.0",
4445 "ssb-avatar": "^0.2.0",
4546 "ssb-blobs": "^0.1.7",

Built with git-ssb-web