git ssb

2+

mixmix / ticktack



Commit 10e34b53d3a68d175823c7588d903463e08056ce

check that text is a string, remove dead code, comment functional css

Dominic Tarr committed on 10/16/2017, 1:47:08 AM
Parent: f7625b47743ad250e7a0c780a3520e726cf3f2dd

Files changed

app/html/thread-card.jschanged
app/html/thread-card.jsView
@@ -83,30 +83,23 @@
8383 var strings = api.translations.sync.strings()
8484 const { subject } = api.message.html
8585
8686 if(!thread.value) return
87- if(!thread.value.content.text) return
87+ if('string' === typeof thread.value.content.text) return
8888
89-// const subjectEl = h('div.subject', [
90-// opts.nameRecipients
91-// ? h('div.recps', buildRecipientNames(thread).map(recp => h('div.recp', recp)))
92-// : null,
93-// subject(thread)
94-// ])
95-
9689 const lastReply = thread.replies && maxBy(thread.replies, r => r.timestamp)
97-// const replySample = lastReply ? subject(lastReply) : null
9890
9991 const onClick = opts.onClick || function () { api.history.sync.push(thread) }
10092 const id = `${thread.key.replace(/[^a-z0-9]/gi, '')}` //-${JSON.stringify(opts)}`
10193 // id is only here to help morphdom morph accurately
10294
10395 var img = marksum.image(thread.value.content.text)
10496 var m = /\!\[[^]+\]\(([^\)]+)\)/.exec(img)
105- console.log(m, img)
97+
10698 if(m) {
107- //hey this works! fit an image into a specific size (see thread-card.mcss)
99+ //Hey this works! fit an image into a specific size (see thread-card.mcss)
108100 //centered, and scaled to fit the square (works with both landscape and portrait!)
101+ //This is functional css not opinionated css, so all embedded.
109102 img = h('Thumbnail')
110103 img.style = 'background-image: url("'+api.blob.sync.url(m[1])+'"); background-position:center; background-size: cover;'
111104 }
112105 else img = ''
@@ -134,33 +127,4 @@
134127 ])
135128 })
136129 }
137130
138-
139-
140-
141-
142-
143-
144-
145-
146-
147-
148-
149-
150-
151-
152-
153-
154-
155-
156-
157-
158-
159-
160-
161-
162-
163-
164-
165-
166-

Built with git-ssb-web