git ssb

10+

Matt McKegg / patchwork



Commit 78c1c971ce74b33515d5785a53347186166297db

add support for embedding audio and video into messages

fixes #771
Matt McKegg committed on 4/13/2018, 10:41:13 AM
Parent: 6b993159aa69170259a3947c0509e821593c4fb5

Files changed

modules/message/html/compose.jschanged
package-lock.jsonchanged
package.jsonchanged
styles/dark/markdown.mcsschanged
styles/light/markdown.mcsschanged
modules/message/html/compose.jsView
@@ -78,11 +78,12 @@
7878 }
7979
8080 files.push(file)
8181
82- var embed = file.type.indexOf('image/') === 0 ? '!' : ''
8382 var blob = ref.parseBlob(file.link)
8483 filesById[blob.id] = file
84+
85+ var embed = isEmbeddable(file.type) ? '!' : ''
8586 var pos = textArea.selectionStart
8687 var before = textArea.value.slice(0, pos)
8788 var after = textArea.value.slice(pos)
8889
@@ -221,4 +222,8 @@
221222 function showDialog (opts) {
222223 var electron = require('electron')
223224 electron.remote.dialog.showMessageBox(electron.remote.getCurrentWindow(), opts)
224225 }
226+
227+function isEmbeddable (type) {
228+ return type.startsWith('image/') || type.startsWith('audio/') || type.startsWith('video/')
229+}
package-lock.jsonView
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.jsonView
@@ -41,9 +41,9 @@
4141 "mutant": "^3.21.2",
4242 "mutant-pull-reduce": "^1.1.0",
4343 "obv": "0.0.1",
4444 "patch-settings": "~1.1.0",
45- "patchcore": "~1.25.0",
45+ "patchcore": "github:ssbc/patchcore#embed-audio-video",
4646 "pull-abortable": "^4.1.0",
4747 "pull-cat": "^1.1.11",
4848 "pull-defer": "^0.2.2",
4949 "pull-file": "~1.0.0",
styles/dark/markdown.mcssView
@@ -29,8 +29,17 @@
2929 }
3030 }
3131 }
3232
33+ (video) {
34+ max-width: 100%
35+ object-fit: scale-down
36+ }
37+
38+ (audio) {
39+ width: 100%
40+ }
41+
3342 (table) {
3443 margin: 10px 0
3544 border-collapse: collapse
3645 (th) {
styles/light/markdown.mcssView
@@ -29,8 +29,17 @@
2929 }
3030 }
3131 }
3232
33+ (video) {
34+ max-width: 100%
35+ object-fit: scale-down
36+ }
37+
38+ (audio) {
39+ width: 100%
40+ }
41+
3342 (table) {
3443 margin: 10px 0
3544 border-collapse: collapse
3645 (th) {

Built with git-ssb-web