Commit 78c1c971ce74b33515d5785a53347186166297db
add support for embedding audio and video into messages
fixes #771Matt McKegg committed on 4/13/2018, 10:41:13 AM
Parent: 6b993159aa69170259a3947c0509e821593c4fb5
Files changed
modules/message/html/compose.js | changed |
package-lock.json | changed |
package.json | changed |
styles/dark/markdown.mcss | changed |
styles/light/markdown.mcss | changed |
modules/message/html/compose.js | ||
---|---|---|
@@ -78,11 +78,12 @@ | ||
78 | 78 | } |
79 | 79 | |
80 | 80 | files.push(file) |
81 | 81 | |
82 | - var embed = file.type.indexOf('image/') === 0 ? '!' : '' | |
83 | 82 | var blob = ref.parseBlob(file.link) |
84 | 83 | filesById[blob.id] = file |
84 | + | |
85 | + var embed = isEmbeddable(file.type) ? '!' : '' | |
85 | 86 | var pos = textArea.selectionStart |
86 | 87 | var before = textArea.value.slice(0, pos) |
87 | 88 | var after = textArea.value.slice(pos) |
88 | 89 | |
@@ -221,4 +222,8 @@ | ||
221 | 222 | function showDialog (opts) { |
222 | 223 | var electron = require('electron') |
223 | 224 | electron.remote.dialog.showMessageBox(electron.remote.getCurrentWindow(), opts) |
224 | 225 | } |
226 | + | |
227 | +function isEmbeddable (type) { | |
228 | + return type.startsWith('image/') || type.startsWith('audio/') || type.startsWith('video/') | |
229 | +} |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 287625 bytes New file size: 287398 bytes |
package.json | ||
---|---|---|
@@ -41,9 +41,9 @@ | ||
41 | 41 | "mutant": "^3.21.2", |
42 | 42 | "mutant-pull-reduce": "^1.1.0", |
43 | 43 | "obv": "0.0.1", |
44 | 44 | "patch-settings": "~1.1.0", |
45 | - "patchcore": "~1.25.0", | |
45 | + "patchcore": "github:ssbc/patchcore#embed-audio-video", | |
46 | 46 | "pull-abortable": "^4.1.0", |
47 | 47 | "pull-cat": "^1.1.11", |
48 | 48 | "pull-defer": "^0.2.2", |
49 | 49 | "pull-file": "~1.0.0", |
Built with git-ssb-web