git ssb

10+

Matt McKegg / patchwork



Commit 0f55f6590b4fcc68e74c2910f6437b56f946b331

bump compose for latest ssb-markdown embedding changes

ssbc/ssb-markdown#22
Matt McKegg committed on 4/14/2018, 9:47:47 AM
Parent: e81b654394d0126eee1fae14be659f26ed3c31cc

Files changed

modules/message/html/compose.jschanged
package-lock.jsonchanged
modules/message/html/compose.jsView
@@ -90,9 +90,11 @@
9090 var spacer = embed ? '\n' : ' '
9191 if (before && !before.endsWith(spacer)) before += spacer
9292 if (!after.startsWith(spacer)) after = spacer + after
9393
94- textArea.value = `${before}${embed}[${file.name}](${file.link})${after}`
94+ var embedPrefix = getEmbedPrefix(file.type)
95+
96+ textArea.value = `${before}${embed}[${embedPrefix}${file.name}](${file.link})${after}`
9597 console.log('added:', file)
9698 }, {
9799 private: isPrivate
98100 })
@@ -225,5 +227,13 @@
225227 }
226228
227229 function isEmbeddable (type) {
228230 return type.startsWith('image/') || type.startsWith('audio/') || type.startsWith('video/')
229-}
231+}
232+
233+function getEmbedPrefix (type) {
234+ if (typeof type === 'string') {
235+ if (type.startsWith('audio/')) return 'audio:'
236+ if (type.startsWith('video/')) return 'video:'
237+ }
238+ return ''
239+}
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 294177 bytes
New file size: 294178 bytes

Built with git-ssb-web