Commit 1a1110c2e82bfc339186396f16b13e1ed2425d4c
minimal "public" feed
mix irving committed on 2/26/2017, 12:38:01 AMParent: 2d0af0cab4123fd7135e10336529dce4672c29df
Files changed
index.js | changed |
message/html/compose.mcss | changed |
message/html/message.mcss | deleted |
message/html/layout/default.js | added |
message/html/layout/default.mcss | added |
message/html/layout/mini.mcss | added |
package.json | changed |
blob/sync/url.js | added |
index.js | ||
---|---|---|
@@ -8,11 +8,9 @@ | ||
8 | 8 | |
9 | 9 | // from more specialized to more general |
10 | 10 | const sockets = combine( |
11 | 11 | // require(patchgit) |
12 | - bulk(__dirname, [ | |
13 | - '!(node_modules|junk)/**/*.js' | |
14 | - ]), | |
12 | + bulk(__dirname, [ '!(node_modules|junk)/**/*.js' ]), | |
15 | 13 | require('patchcore') |
16 | 14 | ) |
17 | 15 | |
18 | 16 | const api = entry(sockets, nest('main.html.app', 'first')) |
message/html/compose.mcss | ||
---|---|---|
@@ -1,9 +1,9 @@ | ||
1 | 1 | Compose { |
2 | 2 | display: flex |
3 | 3 | flex-direction: column |
4 | 4 | |
5 | - padding: 1rem .5rem 1rem 7.3rem | |
5 | + padding: 1rem .5rem 1rem 6rem | |
6 | 6 | |
7 | 7 | textarea { |
8 | 8 | border: 1px solid gainsboro |
9 | 9 | border-top-left-radius: 0 |
message/html/message.mcss | ||
---|---|---|
@@ -1,108 +1,0 @@ | ||
1 | -Message { | |
2 | - padding: 1rem .5rem 1rem 7.5rem | |
3 | - min-height: 5rem | |
4 | - | |
5 | - position: relative | |
6 | - display: flex | |
7 | - flex-direction: row | |
8 | - flex-wrap: wrap | |
9 | - justify-content: flex-end | |
10 | - | |
11 | - header.author { | |
12 | - position: absolute | |
13 | - left: .5rem | |
14 | - } | |
15 | - | |
16 | - section.title { | |
17 | - flex-grow: 1 | |
18 | - font-size: .9rem | |
19 | - } | |
20 | - | |
21 | - section.meta { | |
22 | - display: flex | |
23 | - align-items: center | |
24 | - * { | |
25 | - margin-left: .4rem | |
26 | - } | |
27 | - | |
28 | - a { | |
29 | - _textSubtle | |
30 | - } | |
31 | - | |
32 | - /* this is for private message_meta, TODO find a better home */ | |
33 | - (img) { | |
34 | - height: 1.8rem | |
35 | - width: 1.8rem | |
36 | - margin: 0 .2rem -.2rem | |
37 | - } | |
38 | - } | |
39 | - | |
40 | - section.content { | |
41 | - flex-basis: 100% | |
42 | - | |
43 | - (img) { | |
44 | - max-width: 100% | |
45 | - } | |
46 | - } | |
47 | - | |
48 | - section.raw-content { | |
49 | - margin-left: -7rem | |
50 | - flex-basis: 130% | |
51 | - pre { | |
52 | - border: 1px gainsboro solid | |
53 | - padding: .8rem | |
54 | - | |
55 | - span { | |
56 | - font-weight: 600 | |
57 | - } | |
58 | - a { | |
59 | - word-break: break-all | |
60 | - } | |
61 | - } | |
62 | - } | |
63 | - | |
64 | - section.actions { | |
65 | - flex-basis: 100% | |
66 | - display: flex | |
67 | - justify-content: flex-end | |
68 | - | |
69 | - font-size: .9rem | |
70 | - a { | |
71 | - margin-left: .5em | |
72 | - } | |
73 | - } | |
74 | - | |
75 | - footer.backlinks { | |
76 | - flex-basis: 100% | |
77 | - } | |
78 | - | |
79 | - | |
80 | - -mini { | |
81 | - font-size: .9rem | |
82 | - justify-content: flex-start | |
83 | - padding: .25rem .5rem | |
84 | - min-height: inherit | |
85 | - | |
86 | - header.author { | |
87 | - order: 0 | |
88 | - position: initial | |
89 | - left: initial | |
90 | - min-width: 7rem | |
91 | - } | |
92 | - | |
93 | - section.content { | |
94 | - order: 1 | |
95 | - flex-basis: initial | |
96 | - flex-grow: 1 | |
97 | - } | |
98 | - | |
99 | - section.meta { | |
100 | - order: 2 | |
101 | - } | |
102 | - | |
103 | - section.raw-content { | |
104 | - order: 3 | |
105 | - margin-left: 0 | |
106 | - } | |
107 | - } | |
108 | -} |
message/html/layout/default.js | ||
---|---|---|
@@ -1,0 +1,36 @@ | ||
1 | +const { h } = require('mutant') | |
2 | +var nest = require('depnest') | |
3 | + | |
4 | +exports.needs = nest({ | |
5 | + 'message.html': { | |
6 | + backlinks: 'first', | |
7 | + author: 'first', | |
8 | + meta: 'map', | |
9 | + action: 'map', | |
10 | + timestamp: 'first' | |
11 | + }, | |
12 | + 'about.html.image': 'first' | |
13 | +}) | |
14 | + | |
15 | +exports.gives = nest('message.html.layout') | |
16 | + | |
17 | +exports.create = (api) => { | |
18 | + return nest('message.html.layout', message_layout) | |
19 | + | |
20 | + function message_layout (msg, opts) { | |
21 | + if (!(opts.layout === undefined || opts.layout === 'default')) return | |
22 | + | |
23 | + return h('Message', [ | |
24 | + h('section.avatar', {}, api.about.html.image(msg.value.author)), | |
25 | + h('section.timestamp', {}, api.message.html.timestamp(msg)), | |
26 | + h('header.author', {}, api.message.html.author(msg)), | |
27 | + h('section.meta', {}, api.message.html.meta(msg)), | |
28 | + h('section.title', {}, opts.title), | |
29 | + h('section.content', {}, opts.content), | |
30 | + h('section.raw-content'), | |
31 | + h('section.actions', {}, api.message.html.action(msg)), | |
32 | + h('footer.backlinks', {}, api.message.html.backlinks(msg)) | |
33 | + ]) | |
34 | + } | |
35 | +} | |
36 | + |
message/html/layout/default.mcss | ||
---|---|---|
@@ -1,0 +1,104 @@ | ||
1 | +Message { | |
2 | + padding: 1rem .5rem 1rem 6rem | |
3 | + /* min-height: 5rem */ | |
4 | + | |
5 | + position: relative | |
6 | + display: flex | |
7 | + flex-direction: row | |
8 | + flex-wrap: wrap | |
9 | + justify-content: flex-end | |
10 | + | |
11 | + section.avatar { | |
12 | + position: absolute | |
13 | + left: .5rem | |
14 | + | |
15 | + img { | |
16 | + width: 4rem | |
17 | + height: 4rem | |
18 | + } | |
19 | + } | |
20 | + | |
21 | + section.timestamp { | |
22 | + position: absolute | |
23 | + left: .5rem | |
24 | + top: 5rem | |
25 | + | |
26 | + a { | |
27 | + font-size: .8rem | |
28 | + _textSubtle | |
29 | + } | |
30 | + } | |
31 | + | |
32 | + header.author { | |
33 | + margin-right: .4rem | |
34 | + } | |
35 | + | |
36 | + section.meta { | |
37 | + display: flex | |
38 | + flex-grow: 1 | |
39 | + justify-content: flex-end | |
40 | + align-items: center | |
41 | + * { | |
42 | + margin-left: .4rem | |
43 | + } | |
44 | + | |
45 | + a { | |
46 | + _textSubtle | |
47 | + } | |
48 | + | |
49 | + /* this is for private message_meta, TODO find a better home */ | |
50 | + (img) { | |
51 | + height: 1.8rem | |
52 | + width: 1.8rem | |
53 | + margin: 0 .2rem -.2rem | |
54 | + } | |
55 | + } | |
56 | + | |
57 | + section.title { | |
58 | + flex-basis: 100% | |
59 | + font-size: .9rem | |
60 | + } | |
61 | + | |
62 | + section.content { | |
63 | + flex-basis: 100% | |
64 | + | |
65 | + margin-top: .4rem | |
66 | + | |
67 | + (img) { | |
68 | + max-width: 100% | |
69 | + } | |
70 | + } | |
71 | + | |
72 | + section.raw-content { | |
73 | + margin-left: -7rem | |
74 | + flex-basis: 130% | |
75 | + pre { | |
76 | + border: 1px gainsboro solid | |
77 | + padding: .8rem | |
78 | + | |
79 | + span { | |
80 | + font-weight: 600 | |
81 | + } | |
82 | + a { | |
83 | + word-break: break-all | |
84 | + } | |
85 | + } | |
86 | + } | |
87 | + | |
88 | + section.actions { | |
89 | + flex-basis: 100% | |
90 | + display: flex | |
91 | + justify-content: flex-end | |
92 | + | |
93 | + font-size: .9rem | |
94 | + a { | |
95 | + margin-left: .5em | |
96 | + } | |
97 | + } | |
98 | + | |
99 | + footer.backlinks { | |
100 | + flex-basis: 100% | |
101 | + } | |
102 | + | |
103 | + | |
104 | +} |
message/html/layout/mini.mcss | ||
---|---|---|
@@ -1,0 +1,41 @@ | ||
1 | +Message { | |
2 | + -mini { | |
3 | + font-size: .9rem | |
4 | + justify-content: flex-start | |
5 | + padding: .25rem .5rem | |
6 | + min-height: inherit | |
7 | + | |
8 | + header.author { | |
9 | + order: 0 | |
10 | + position: initial | |
11 | + left: initial | |
12 | + min-width: 5.5rem | |
13 | + } | |
14 | + | |
15 | + section.timestamp { | |
16 | + order: 1 | |
17 | + margin-right: .5rem | |
18 | + | |
19 | + position: initial | |
20 | + left: initial | |
21 | + top: initial | |
22 | + } | |
23 | + | |
24 | + section.content { | |
25 | + order: 2 | |
26 | + flex-basis: initial | |
27 | + flex-grow: 1 | |
28 | + | |
29 | + margin-top: 0 | |
30 | + } | |
31 | + | |
32 | + section.meta { | |
33 | + order: 3 | |
34 | + } | |
35 | + | |
36 | + section.raw-content { | |
37 | + order: 4 | |
38 | + margin-left: 0 | |
39 | + } | |
40 | + } | |
41 | +} |
package.json | ||
---|---|---|
@@ -3,8 +3,9 @@ | ||
3 | 3 | "version": "0.0.1", |
4 | 4 | "description": "patchbay 2? building on patchcore", |
5 | 5 | "main": "index.js", |
6 | 6 | "scripts": { |
7 | + "rebuild": "npm rebuild --runtime=electron --target=$(electron -v) --abi=$(electron --abi) --disturl=https://atom.io/download/atom-shell", | |
7 | 8 | "start": "electro index.js", |
8 | 9 | "test": "echo \"Error: no test specified\" && exit 1" |
9 | 10 | }, |
10 | 11 | "repository": { |
Built with git-ssb-web