diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-14 05:40:30 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-14 05:40:30 +0900 |
| commit | ef409107e4035cc4b7d6182f5edb0b1bdb7d3a0b (patch) | |
| tree | a3f1331f8a593f922569ba546bcb3a22338e1db7 /src | |
| parent | Merge pull request #913 from syuilo/write-file-use-stream (diff) | |
| download | misskey-ef409107e4035cc4b7d6182f5edb0b1bdb7d3a0b.tar.gz misskey-ef409107e4035cc4b7d6182f5edb0b1bdb7d3a0b.tar.bz2 misskey-ef409107e4035cc4b7d6182f5edb0b1bdb7d3a0b.zip | |
#914
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/app/desktop/tags/post-form.tag | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/web/app/desktop/tags/post-form.tag b/src/web/app/desktop/tags/post-form.tag index e49beeedbc..e2948adddb 100644 --- a/src/web/app/desktop/tags/post-form.tag +++ b/src/web/app/desktop/tags/post-form.tag @@ -407,6 +407,20 @@ if (e.dataTransfer.files.length > 0) { Array.from(e.dataTransfer.files).forEach(this.upload); } + + // データ取得 + const data = e.dataTransfer.getData('text'); + if (data == null) return false; + + // パース + // TODO: Validate JSON + const obj = JSON.parse(data); + + // (ドライブの)ファイルだったら + if (obj.type == 'file') { + this.files.push(obj.file); + this.update(); + } }; this.onkeydown = e => { |