Commit a2b3f21193e91cdc60bd46279f51bf999c49647a
Merge branch 'master' of github.com:ticktackim/ticktack-workplan
mix irving committed on 7/12/2018, 1:20:53 AMParent: 3017608d079e9dea35ca48cf3b913a117a556fa3
Parent: ba050d296a338574b378e2dcc8d67060d46b6fea
Files changed
app/index.js | changed |
app/page/channel.js | deleted |
app/page/groupFind.js | deleted |
app/page/groupFind.mcss | deleted |
app/page/groupIndex.js | deleted |
app/page/groupNew.js | deleted |
app/page/groupShow.js | deleted |
app/page/image.js | deleted |
app/page/image.mcss | deleted |
app/page/userFind.js | deleted |
app/page/userFind.mcss | deleted |
router/sync/routes.js | changed |
app/index.js | ||
---|---|---|
@@ -34,19 +34,11 @@ | ||
34 | 34 | blogSearch: require('./page/blogSearch'), |
35 | 35 | blogShow: require('./page/blogShow'), |
36 | 36 | channelShow: require('./page/channelShow'), |
37 | 37 | channelSubscriptions: require('./page/channelSubscriptions'), |
38 | - // channel: require('./page/channel'), // TODO delete all these files | |
39 | - // image: require('./page/image'), | |
40 | - // groupFind: require('./page/groupFind'), | |
41 | - // groupIndex: require('./page/groupIndex'), | |
42 | - // groupNew: require('./page/groupNew'), | |
43 | - // groupShow: require('./page/groupShow'), | |
44 | - // threadShow: require('./page/threadShow'), | |
45 | 38 | notifications: require('./page/notifications'), |
46 | 39 | error: require('./page/error'), |
47 | 40 | userEdit: require('./page/userEdit'), |
48 | - // userFind: require('./page/userFind'), | |
49 | 41 | userShow: require('./page/userShow'), |
50 | 42 | settings: require('./page/settings'), |
51 | 43 | splash: require('./page/splash'), |
52 | 44 | statsShow: require('./page/statsShow'), |
app/page/channel.js | ||
---|---|---|
@@ -1,63 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { h, computed } = require('mutant') | |
3 | -const More = require('hypermore') | |
4 | -const morphdom = require('morphdom') | |
5 | -const get = require('lodash/get') | |
6 | - | |
7 | -exports.gives = nest('app.page.channel') | |
8 | - | |
9 | -exports.needs = nest({ | |
10 | - 'app.html.link': 'first', | |
11 | - 'app.html.blogCard': 'first', | |
12 | - 'history.sync.push': 'first', | |
13 | - 'state.obs.channel': 'first', | |
14 | - 'translations.sync.strings': 'first' | |
15 | -}) | |
16 | - | |
17 | -function latestUpdate (thread) { | |
18 | - var m = thread.timestamp | |
19 | - if (!thread.replies) return m | |
20 | - | |
21 | - for (var i = 0; i < thread.replies.length; i++) { m = Math.max(thread.replies[i].timestamp, m) } | |
22 | - return m | |
23 | -} | |
24 | - | |
25 | -exports.create = (api) => { | |
26 | - return nest('app.page.channel', function (location) { | |
27 | - const { channel } = location | |
28 | - var strings = api.translations.sync.strings() | |
29 | - | |
30 | - var channelObs = api.state.obs.channel(channel) | |
31 | - | |
32 | - // disable "Show More" button when we are at the last thread. | |
33 | - var disableShowMore = computed([channelObs], threads => !!threads.ended) | |
34 | - | |
35 | - var updates = h('div.threads', []) | |
36 | - var threadsHtmlObs = More( | |
37 | - channelObs, | |
38 | - function render (threads) { | |
39 | - morphdom(updates, | |
40 | - h('div.threads', Object.keys(threads.roots) | |
41 | - .map(id => threads.roots[id]) | |
42 | - .filter(thread => get(thread, 'value.content.channel') == channel) | |
43 | - .sort((a, b) => latestUpdate(b) - latestUpdate(a)) | |
44 | - .map(thread => api.app.html.blogCard(thread)) | |
45 | - ) | |
46 | - ) | |
47 | - return updates | |
48 | - } | |
49 | - ) | |
50 | - | |
51 | - const Link = api.app.html.link | |
52 | - | |
53 | - // TODO change this to -channel | |
54 | - return h('Page -home', {title: channel}, [ | |
55 | - Link({ page: 'threadNew', channel }, h('Button -strong', strings.channel.action.newThread)), | |
56 | - h('div.content', [ threadsHtmlObs ]), | |
57 | - h('Button -showMore', { | |
58 | - 'ev-click': threadsHtmlObs.more, | |
59 | - disabled: disableShowMore | |
60 | - }, [strings.showMore]) | |
61 | - ]) | |
62 | - }) | |
63 | -} |
app/page/groupFind.js | ||
---|---|---|
@@ -1,59 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { h, Value, computed, map } = require('mutant') | |
3 | - | |
4 | -exports.gives = nest('app.page.groupFind') | |
5 | - | |
6 | -exports.needs = nest({ | |
7 | - 'app.html.link': 'first', | |
8 | - 'channel.async.suggest': 'first', | |
9 | - 'translations.sync.strings': 'first' | |
10 | -}) | |
11 | - | |
12 | -exports.create = (api) => { | |
13 | - return nest('app.page.groupFind', groupFind) | |
14 | - | |
15 | - function groupFind (location) { | |
16 | - const strings = api.translations.sync.strings() | |
17 | - const input = Value('') | |
18 | - | |
19 | - // CHANNEL != GROUP | |
20 | - // note we're using channels in initial approximation of groups | |
21 | - const suggester = api.channel.async.suggest() | |
22 | - const groups = computed(input, input => suggester(input)) | |
23 | - | |
24 | - const Link = api.app.html.link | |
25 | - | |
26 | - return h('Page -groupFind', {title: strings.groupFind.pageTitle}, [ | |
27 | - h('div.content', [ | |
28 | - h('div.search', [ | |
29 | - h('i.fa.fa-search'), | |
30 | - h('input', { | |
31 | - placeholder: strings.groupFind.action.findAGroup, | |
32 | - autofocus: 'autofocus', | |
33 | - 'ev-input': e => input.set(e.target.value) | |
34 | - }) | |
35 | - ]), | |
36 | - h('div.results', map(groups, group => { | |
37 | - return Link({ channel: group.title }, | |
38 | - h('div.result', [ | |
39 | - // api.about.html.image(user.id), | |
40 | - h('div.alias', group.id), // channel with # | |
41 | - h('pre.key', group.subtitle || ' ') // subscribed or not | |
42 | - ]) | |
43 | - ) | |
44 | - })), | |
45 | - computed([input, groups], (input, groups) => { | |
46 | - if (input.length && groups.length === 0) { | |
47 | - return h('div.groupNotFound', [ | |
48 | - h('div.info', strings.groupFind.state.groupNotFound), | |
49 | - Link( | |
50 | - { page: 'threadNew', channel: input, flash: strings.groupFind.flash.createFirstThread }, | |
51 | - h('Button -strong', strings.groupFind.action.newGroup) | |
52 | - ) | |
53 | - ]) | |
54 | - } | |
55 | - }) | |
56 | - ]) | |
57 | - ]) | |
58 | - } | |
59 | -} |
app/page/groupFind.mcss | ||
---|---|---|
@@ -1,70 +1,0 @@ | ||
1 | -Page -groupFind { | |
2 | - div.content { | |
3 | - $maxWidthSmaller | |
4 | - div.search { | |
5 | - $backgroundPrimaryText | |
6 | - | |
7 | - margin-bottom: 1rem | |
8 | - | |
9 | - display: flex | |
10 | - align-items: center | |
11 | - | |
12 | - i.fa-search { | |
13 | - margin-left: .8rem | |
14 | - } | |
15 | - | |
16 | - input { | |
17 | - flex-grow: 1 | |
18 | - | |
19 | - $fontBasic | |
20 | - margin: .6rem | |
21 | - | |
22 | - border: none | |
23 | - outline: none | |
24 | - } | |
25 | - } | |
26 | - | |
27 | - | |
28 | - div.results { | |
29 | - $maxWidthSmaller | |
30 | - | |
31 | - div.Link { | |
32 | - div.result { | |
33 | - $backgroundPrimaryText | |
34 | - | |
35 | - padding: .5rem | |
36 | - | |
37 | - display: flex | |
38 | - align-items: center | |
39 | - | |
40 | - img { | |
41 | - $circleSmall | |
42 | - margin-right: 1rem | |
43 | - } | |
44 | - | |
45 | - div.alias { | |
46 | - flex-grow: 1 | |
47 | - margin-right: 1rem | |
48 | - } | |
49 | - | |
50 | - pre.key { | |
51 | - color: #999 | |
52 | - | |
53 | - } | |
54 | - | |
55 | - :hover { | |
56 | - background-color: #eee | |
57 | - | |
58 | - } | |
59 | - } | |
60 | - } | |
61 | - } | |
62 | - div.groupNotFound { | |
63 | - div.info { | |
64 | - text-align: center | |
65 | - margin-bottom: 1rem | |
66 | - } | |
67 | - } | |
68 | - } | |
69 | -} | |
70 | - |
app/page/groupIndex.js | ||
---|---|---|
@@ -1,19 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { h } = require('mutant') | |
3 | - | |
4 | -exports.gives = nest('app.page.groupIndex') | |
5 | - | |
6 | -exports.needs = nest({ | |
7 | - 'translations.sync.strings': 'first' | |
8 | -}) | |
9 | - | |
10 | -exports.create = (api) => { | |
11 | - var strings = api.translations.sync.strings() | |
12 | - return nest('app.page.groupIndex', groupIndex) | |
13 | - | |
14 | - function groupIndex (location) { | |
15 | - return h('Page -groupIndex', {title: strings.groupIndex}, [ | |
16 | - '****' | |
17 | - ]) | |
18 | - } | |
19 | -} |
app/page/groupNew.js | ||
---|---|---|
@@ -1,18 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { h } = require('mutant') | |
3 | - | |
4 | -exports.gives = nest('app.page.groupNew') | |
5 | - | |
6 | -exports.needs = nest({ | |
7 | - 'translations.sync.strings': 'first' | |
8 | -}) | |
9 | - | |
10 | -exports.create = (api) => { | |
11 | - return nest('app.page.groupNew', groupNew) | |
12 | - var strings = api.translations.sync.strings() | |
13 | - function groupNew (location) { | |
14 | - return h('Page -groupNew', {title: strings.groupNew}, [ | |
15 | - '****' | |
16 | - ]) | |
17 | - } | |
18 | -} |
app/page/groupShow.js | ||
---|---|---|
@@ -1,22 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { h } = require('mutant') | |
3 | - | |
4 | -exports.gives = nest('app.page.groupShow') | |
5 | - | |
6 | -exports.needs = nest({ | |
7 | - 'translations.sync.strings': 'first' | |
8 | -}) | |
9 | - | |
10 | -exports.create = (api) => { | |
11 | - var strings = api.translations.sync.strings() | |
12 | - return nest('app.page.groupShow', groupShow) | |
13 | - | |
14 | - function groupShow (location) { | |
15 | - // location here can be the root message of a group : { type: 'group', key } | |
16 | - // TODO show specific group index described by key | |
17 | - | |
18 | - return h('Page -groupShow', {title: strings.groupShow}, [ | |
19 | - h('p', `key: ${location.key}`) | |
20 | - ]) | |
21 | - } | |
22 | -} |
app/page/image.js | ||
---|---|---|
@@ -1,21 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { h } = require('mutant') | |
3 | - | |
4 | -exports.gives = nest('app.page.image') | |
5 | - | |
6 | -exports.needs = nest({ | |
7 | - 'about.html.image': 'first', | |
8 | - 'about.obs.name': 'first', | |
9 | - 'app.html.thread': 'first', | |
10 | - 'blob.sync.url': 'first' | |
11 | -}) | |
12 | - | |
13 | -exports.create = (api) => { | |
14 | - return nest('app.page.image', function (location) { | |
15 | - return h('Page -image', [ | |
16 | - h('div.content', [ | |
17 | - h('img', {src: api.blob.sync.url(location.blob || location)}) | |
18 | - ]) | |
19 | - ]) | |
20 | - }) | |
21 | -} |
app/page/image.mcss | ||
---|---|---|
@@ -1,9 +1,0 @@ | ||
1 | -Page -image { | |
2 | - div.content { | |
3 | - display: flex | |
4 | - | |
5 | - img { | |
6 | - margin: 0 auto | |
7 | - } | |
8 | - } | |
9 | -} |
app/page/userFind.js | ||
---|---|---|
@@ -1,47 +1,0 @@ | ||
1 | -const nest = require('depnest') | |
2 | -const { h, Value, computed, map } = require('mutant') | |
3 | - | |
4 | -exports.gives = nest('app.page.userFind') | |
5 | - | |
6 | -exports.needs = nest({ | |
7 | - 'about.html.image': 'first', | |
8 | - 'app.html.link': 'first', | |
9 | - 'about.async.suggest': 'first', | |
10 | - 'translations.sync.strings': 'first' | |
11 | -}) | |
12 | - | |
13 | -exports.create = (api) => { | |
14 | - return nest('app.page.userFind', userFind) | |
15 | - | |
16 | - function userFind (location) { | |
17 | - const strings = api.translations.sync.strings() | |
18 | - const input = Value() | |
19 | - | |
20 | - const suggester = api.about.async.suggest() | |
21 | - const users = computed(input, input => suggester(input)) | |
22 | - | |
23 | - const Link = api.app.html.link | |
24 | - | |
25 | - return h('Page -userFind', {title: strings.userFind.pageTitle}, [ | |
26 | - h('div.content', [ | |
27 | - h('div.search', [ | |
28 | - h('i.fa.fa-search'), | |
29 | - h('input', { | |
30 | - placeholder: strings.userFind.action.findAUser, | |
31 | - autofocus: 'autofocus', | |
32 | - 'ev-input': e => input.set(e.target.value) | |
33 | - }) | |
34 | - ]), | |
35 | - h('div.results', map(users, user => { | |
36 | - return Link({ feed: user.id }, | |
37 | - h('div.result', [ | |
38 | - api.about.html.image(user.id), | |
39 | - h('div.alias', user.title), | |
40 | - h('pre.key', user.id) | |
41 | - ]) | |
42 | - ) | |
43 | - })) | |
44 | - ]) | |
45 | - ]) | |
46 | - } | |
47 | -} |
app/page/userFind.mcss | ||
---|---|---|
@@ -1,63 +1,0 @@ | ||
1 | -Page -userFind { | |
2 | - div.content { | |
3 | - $maxWidthSmaller | |
4 | - div.search { | |
5 | - $backgroundPrimaryText | |
6 | - | |
7 | - margin-bottom: 1rem | |
8 | - | |
9 | - display: flex | |
10 | - align-items: center | |
11 | - | |
12 | - i.fa-search { | |
13 | - margin-left: .8rem | |
14 | - } | |
15 | - | |
16 | - input { | |
17 | - flex-grow: 1 | |
18 | - | |
19 | - $fontBasic | |
20 | - margin: .6rem | |
21 | - | |
22 | - border: none | |
23 | - outline: none | |
24 | - } | |
25 | - } | |
26 | - | |
27 | - | |
28 | - div.results { | |
29 | - $maxWidthSmaller | |
30 | - | |
31 | - div.Link { | |
32 | - div.result { | |
33 | - $backgroundPrimaryText | |
34 | - | |
35 | - padding: .5rem | |
36 | - | |
37 | - display: flex | |
38 | - align-items: center | |
39 | - | |
40 | - img { | |
41 | - $circleSmall | |
42 | - margin-right: 1rem | |
43 | - } | |
44 | - | |
45 | - div.alias { | |
46 | - flex-grow: 1 | |
47 | - margin-right: 1rem | |
48 | - } | |
49 | - | |
50 | - pre.key { | |
51 | - color: #999 | |
52 | - | |
53 | - } | |
54 | - | |
55 | - :hover { | |
56 | - background-color: #eee | |
57 | - | |
58 | - } | |
59 | - } | |
60 | - } | |
61 | - } | |
62 | - } | |
63 | -} |
router/sync/routes.js | ||
---|---|---|
@@ -15,21 +15,14 @@ | ||
15 | 15 | 'app.page.settings': 'first', |
16 | 16 | 'app.page.channelSubscriptions': 'first', |
17 | 17 | 'app.page.channelShow': 'first', |
18 | 18 | 'app.page.notifications': 'first', |
19 | - // 'app.page.channel': 'first', | |
20 | - // 'app.page.groupFind': 'first', | |
21 | - // 'app.page.groupIndex': 'first', | |
22 | - // 'app.page.groupNew': 'first', | |
23 | - // 'app.page.groupShow': 'first', | |
24 | 19 | 'app.page.userEdit': 'first', |
25 | - // 'app.page.userFind': 'first', | |
26 | 20 | 'app.page.userShow': 'first', |
27 | 21 | 'app.page.splash': 'first', |
28 | 22 | 'app.page.statsShow': 'first', |
29 | 23 | 'app.page.threadNew': 'first', |
30 | 24 | 'app.page.threadShow': 'first', |
31 | - // 'app.page.image': 'first', | |
32 | 25 | 'blob.sync.url': 'first' |
33 | 26 | }) |
34 | 27 | |
35 | 28 | exports.create = (api) => { |
@@ -73,15 +66,9 @@ | ||
73 | 66 | // [ location => location.page === 'userFind', pages.userFind ], |
74 | 67 | [ location => location.page === 'userEdit' && isFeed(location.feed), pages.userEdit ], |
75 | 68 | [ location => isFeed(location.feed), pages.userShow ], |
76 | 69 | |
77 | - // Group pages | |
78 | - // [ location => location.page === 'groupFind', pages.groupFind ], | |
79 | - // [ location => location.page === 'groupIndex', pages.groupIndex ], | |
80 | - // [ location => location.page === 'groupNew', pages.groupNew ], | |
81 | - // // [ location => location.type === 'groupShow' && isMsg(location.key), pages.groupShow ], | |
82 | - // [ location => location.channel , pages.channel ], | |
83 | - | |
70 | + // Settings page | |
84 | 71 | [ location => location.page === 'settings', pages.settings ], |
85 | 72 | |
86 | 73 | // [ location => isBlob(location.blob), pages.image ], |
87 | 74 | [ location => isBlob(location.blob), (location) => { |
Built with git-ssb-web