git ssb

0+

dangerousbeans / patchwork



forked from Matt McKegg / patchwork

Commit fdc31e27bc5cf938a560cff2c56cc39de9352cbf

also highlight new subscription, follow and about messages, change flag color

Matt McKegg committed on 4/8/2017, 12:36:09 PM
Parent: be8e636ad6ac100c2299cc221a5e35e396a1ece6

Files changed

modules/feed/html/rollup.jschanged
plugs/message/html/layout/mini.jschanged
styles/feed-event.mcsschanged
styles/message.mcsschanged
modules/feed/html/rollup.jsView
@@ -175,8 +175,13 @@
175175 newSinceRefresh.clear()
176176 }
177177
178178 function renderItem (item) {
179+ var classList = []
180+ if (item.priority >= 2) {
181+ classList.push('-new')
182+ }
183+
179184 if (item.type === 'message') {
180185 var meta = null
181186 var previousId = item.messageId
182187 var replies = item.replies.slice(-4).map((msg) => {
@@ -239,17 +244,17 @@
239244 ])
240245 }
241246 }
242247 } else if (item.type === 'follow') {
243- return h('FeedEvent -follow', [
248+ return h('FeedEvent -follow', {classList}, [
244249 h('div.meta', {
245250 title: names(item.contacts)
246251 }, [
247252 api.profile.html.person(item.id), ' followed ', many(item.contacts, api.profile.html.person)
248253 ])
249254 ])
250255 } else if (item.type === 'subscribe') {
251- return h('FeedEvent -subscribe', [
256+ return h('FeedEvent -subscribe', {classList}, [
252257 h('div.meta', {
253258 title: names(item.subscribers)
254259 }, [
255260 many(item.subscribers, api.profile.html.person),
plugs/message/html/layout/mini.jsView
@@ -16,18 +16,25 @@
1616 exports.create = (api) => {
1717 return nest('message.html.layout', mini)
1818
1919 function mini (msg, opts) {
20+ var classList = []
21+ var additionalMeta = []
22+ if (opts.priority >= 2) {
23+ classList.push('-new')
24+ additionalMeta.push(h('span.flag -new', {title: 'New Message'}))
25+ }
2026 if (opts.layout !== 'mini') return
21- return h('div', {
22- classList: 'Message -mini'
23- }, [
27+ return h('Message -mini', {classList}, [
2428 h('header', [
2529 h('div.mini', [
2630 api.profile.html.person(msg.value.author), ' ',
2731 opts.content
2832 ]),
29- h('div.meta', {}, api.message.html.timestamp(msg))
33+ h('div.meta', {}, [
34+ api.message.html.timestamp(msg),
35+ additionalMeta
36+ ])
3037 ])
3138 ])
3239 }
3340 }
styles/feed-event.mcssView
@@ -5,8 +5,13 @@
55 max-width: 700px
66 width: 100%
77 margin: 10px auto
88
9+ -new {
10+ box-shadow: 0px 0px 2px #ffc800;
11+ background: #fffdf7;
12+ }
13+
914 div {
1015 flex: 1
1116 }
1217
styles/message.mcssView
@@ -108,9 +108,9 @@
108108
109109 @svg new {
110110 width: 12px
111111 height: 12px
112- content: "<circle cx='6' stroke='none' fill='#62baff' cy='6' r='5' />"
112+ content: "<circle cx='6' stroke='none' fill='#ffcf04' cy='6' r='5' />"
113113 }
114114 }
115115
116116 em {

Built with git-ssb-web