git ssb

2+

mixmix / ticktack



Commit 2f3728d62f4995c91fc3de4f0ca6b5a08ceccfb7

Merge branch 'master' into get

mix irving committed on 8/17/2017, 3:57:01 AM
Parent: 8f710d26c85cbaa5cb40a9ab64fe40cc85df0934
Parent: 48bebcda44d351b3e77a42a761d37c9ff72ec9f0

Files changed

app/index.jschanged
app/page/channel.jschanged
app/page/userShow.jschanged
app/page/image.jsadded
app/page/image.mcssadded
main.jschanged
package-lock.jsonchanged
package.jsonchanged
router/sync/routes.jschanged
styles/mixins.jschanged
styles/suggest-box.mcssadded
app/index.jsView
@@ -10,8 +10,9 @@
1010 },
1111 page: {
1212 channel: require('./page/channel'),
1313 error: require('./page/error'),
14+ image: require('./page/image'),
1415 groupFind: require('./page/groupFind'),
1516 groupIndex: require('./page/groupIndex'),
1617 groupNew: require('./page/groupNew'),
1718 groupShow: require('./page/groupShow'),
@@ -28,4 +29,5 @@
2829
2930
3031
3132
33+
app/page/channel.jsView
@@ -1,8 +1,9 @@
11 const nest = require('depnest')
22 const { h, computed } = require('mutant')
33 const More = require('hypermore')
44 const morphdom = require('morphdom')
5+const get = require('lodash/get')
56
67 exports.gives = nest('app.page.channel')
78
89 exports.needs = nest({
@@ -22,14 +23,14 @@
2223 }
2324
2425 exports.create = (api) => {
2526 return nest('app.page.channel', function (location) {
26- // location here can expected to be: { page: 'home' }
27+ const { channel } = location
2728 var strings = api.translations.sync.strings()
2829
2930 var container = h('div.container', [])
3031
31- var channelObs = api.state.obs.channel(location.channel)
32+ var channelObs = api.state.obs.channel(channel)
3233
3334 //disable "Show More" button when we are at the last thread.
3435 var disableShowMore = computed([channelObs], threads => !!threads.ended)
3536
@@ -41,22 +42,13 @@
4142 // but they are here to be compatible with the old MCSS.
4243 h('div.container', [
4344 //private section
4445 h('section.updates -directMessage', [
45- h('div.threads',
46- Object.keys(threads.roots)
47- .map(function (id) {
48- return threads.roots[id]
49- })
50- .filter(function (thread) {
51- return thread.value && thread.value.content.channel == location.channel
52- })
53- .sort(function (a, b) {
54- return latestUpdate(b) - latestUpdate(a)
55- })
56- .map(function (thread) {
57- return api.app.html.threadCard(thread)
58- })
46+ h('div.threads', Object.keys(threads.roots)
47+ .map(id => threads.roots[id])
48+ .filter(thread => get(thread, 'value.content.channel') == channel)
49+ .sort((a, b) => latestUpdate(b) - latestUpdate(a))
50+ .map(thread => api.app.html.threadCard(thread))
5951 )
6052 ])
6153 ])
6254 )
app/page/userShow.jsView
@@ -29,9 +29,9 @@
2929 function userShow (location) {
3030
3131 const { feed } = location
3232 const myId = api.keys.sync.id()
33- var name = api.about.obs.name(feed)
33+ const name = api.about.obs.name(feed)
3434
3535 const strings = api.translations.sync.strings()
3636
3737 const { followers } = api.contact.obs
app/page/image.jsView
@@ -1,0 +1,33 @@
1+const nest = require('depnest')
2+const { h } = require('mutant')
3+
4+exports.gives = nest('app.page.image')
5+
6+exports.needs = nest({
7+ 'translations.sync.strings': 'first',
8+ 'about.html.image': 'first',
9+ 'about.obs.name': 'first',
10+ 'app.html.thread': 'first',
11+ 'blob.sync.url': 'first'
12+})
13+
14+exports.create = (api) => {
15+ var strings = api.translations.sync.strings()
16+
17+ return nest('app.page.image', function (location) {
18+ return h('Page -image', [
19+ h('div.container', [
20+ h('img', {src: api.blob.sync.url(location.blob || location)})
21+ ])
22+ ])
23+ })
24+}
25+
26+
27+
28+
29+
30+
31+
32+
33+
app/page/image.mcssView
@@ -1,0 +1,9 @@
1+Page -image {
2+ div.container {
3+ display: flex
4+
5+ img {
6+ margin: 0 auto
7+ }
8+ }
9+}
main.jsView
@@ -25,13 +25,24 @@
2525 },
2626 require('patchcore')
2727 )
2828
29-const api = entry(sockets, nest('app.html.app', 'first'))
29+const api = entry(sockets, nest({
30+ 'app.html.app': 'first',
31+ 'invite.async.autofollow': 'first'
32+}))
3033
3134 document.body.appendChild(api.app.html.app())
3235
36+api.invite.async.autofollow(
37+ 'wx.larpa.net:8008:@DTNmX+4SjsgZ7xyDh5xxmNtFqa6pWi5Qtw7cE8aR9TQ=.ed25519~YIRnryeLBhtBa2il9fCWDlAIFWR37Uh63Vep0L6tk6c=',
38+ function (err, follows) {
39+ console.log('autofollowed', err, follows);
40+})
3341
3442
3543
3644
3745
46+
47+
48+
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 192040 bytes
New file size: 192042 bytes
package.jsonView
@@ -32,9 +32,9 @@
3232 "mutant": "^3.21.2",
3333 "obv-debounce": "^1.0.2",
3434 "open-external": "^0.1.1",
3535 "patch-history": "^1.0.0",
36- "patchcore": "^1.9.1",
36+ "patchcore": "^1.10.0",
3737 "pull-next": "^1.0.1",
3838 "pull-obv": "^1.3.0",
3939 "pull-stream": "^3.6.0",
4040 "read-directory": "^2.1.0",
router/sync/routes.jsView
@@ -1,6 +1,6 @@
11 const nest = require('depnest')
2-const { isMsg, isFeed } = require('ssb-ref')
2+const { isMsg, isFeed, isBlob } = require('ssb-ref')
33 exports.gives = nest('router.sync.routes')
44
55 exports.needs = nest({
66 'app.page.error': 'first',
@@ -14,16 +14,18 @@
1414 'app.page.userFind': 'first',
1515 'app.page.userShow': 'first',
1616 'app.page.threadNew': 'first',
1717 'app.page.threadShow': 'first',
18+ 'app.page.image': 'first',
1819 })
1920
2021 exports.create = (api) => {
2122 return nest('router.sync.routes', (sofar = []) => {
2223 const pages = api.app.page
2324 // route format: [ routeValidator, routeFunction ]
2425
2526 const routes = [
27+ [ location => isBlob(location.blob), pages.image ],
2628 [ location => location.page === 'home', pages.home ],
2729 [ location => location.channel , pages.channel ],
2830 [ location => location.page === 'settings', pages.settings ],
2931
@@ -51,12 +53,4 @@
5153 }
5254
5355
5456
55-
56-
57-
58-
59-
60-
61-
62-
styles/mixins.jsView
@@ -64,23 +64,23 @@
6464 }
6565 }
6666
6767 $roundLeft {
68- border-top-left-radius: .9rem
69- border-bottom-left-radius: .9rem
68+ border-top-left-radius: 1.2rem
69+ border-bottom-left-radius: 1.2rem
7070 }
7171
7272 $roundRight {
73- border-top-right-radius: .9rem
74- border-bottom-right-radius: .9rem
73+ border-top-right-radius: 1.2rem
74+ border-bottom-right-radius: 1.2rem
7575 }
7676
7777 $roundTop {
78- border-top-left-radius: .9rem
79- border-top-right-radius: .9rem
78+ border-top-left-radius: 1.2rem
79+ border-top-right-radius: 1.2rem
8080 }
8181
8282 $roundBottom {
83- border-bottom-left-radius: .9rem
84- border-bottom-right-radius: .9rem
83+ border-bottom-left-radius: 1.2rem
84+ border-bottom-right-radius: 1.2rem
8585 }
8686 `
styles/suggest-box.mcssView
@@ -1,0 +1,54 @@
1+body {
2+ div.suggest-box {
3+ width: max-content
4+ background-color: #fff
5+ border: 1px gainsboro solid
6+
7+ padding: .2rem .5rem
8+ margin-top: .35rem
9+
10+ ul {
11+ list-style-type: none
12+ padding: 0
13+
14+ li {
15+ display: flex
16+ align-items: center
17+
18+ padding-right: .2rem
19+ margin-bottom: .2rem
20+
21+ img {
22+ height: 36px
23+ width: 36px
24+ border-radius: 36px
25+
26+ padding: .2rem
27+ /* TODO make smaller emoji thumbnails */
28+ }
29+ strong {
30+ flex-grow: 1
31+ margin-left: .5rem
32+ font-weight: 300
33+ }
34+ small {
35+ font-family: monospace
36+ margin-left: .5rem
37+ padding-right: .2rem
38+ font-size: 1rem
39+ }
40+ }
41+
42+ li.selected {
43+ color: #fff
44+ background: #0caaf9
45+
46+ img {}
47+ strong {}
48+ small {}
49+ }
50+ }
51+ }
52+}
53+
54+

Built with git-ssb-web