Commit d7f7025973a74edf124dc7a5e5cf20aa2a013e9b
add copy-paste images
mixmix committed on 10/10/2018, 9:54:31 PMParent: 9ed5958b4528f84958df37e404fc8ec072d3632b
Files changed
message/html/compose.js | changed |
message/html/compose.js | |||
---|---|---|---|
@@ -3,8 +3,9 @@ | |||
3 | 3 … | const ssbMentions = require('ssb-mentions') | |
4 | 4 … | const extend = require('xtend') | |
5 | 5 … | const addSuggest = require('suggest-box') | |
6 | 6 … | const blobFiles = require('ssb-blob-files') | |
7 … | +const get = require('lodash/get') | ||
7 | 8 … | ||
8 | 9 … | exports.gives = nest('message.html.compose') | |
9 | 10 … | ||
10 | 11 … | exports.needs = nest({ | |
@@ -81,8 +82,17 @@ | |||
81 | 82 … | clearTimeout(blurTimeout) | |
82 | 83 … | blurTimeout = setTimeout(() => textAreaFocused.set(false), 200) | |
83 | 84 … | }, | |
84 | 85 … | 'ev-focus': send(textAreaFocused.set, true), | |
86 … | + 'ev-paste': ev => { | ||
87 … | + const files = get(ev, 'clipboardData.files') | ||
88 … | + if (!files || !files.length) return | ||
89 … | + const opts = { | ||
90 … | + stripExif: api.settings.obs.get('patchbay.removeExif', true), | ||
91 … | + isPrivate | ||
92 … | + } | ||
93 … | + blobFiles(files, api.sbot.obs.connection, opts, afterBlobed) | ||
94 … | + }, | ||
85 | 95 … | placeholder | |
86 | 96 … | }) | |
87 | 97 … | textArea.publish = publish // TODO: fix - clunky api for the keyboard shortcut to target | |
88 | 98 … | ||
Built with git-ssb-web