From ef409107e4035cc4b7d6182f5edb0b1bdb7d3a0b Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 14 Nov 2017 05:40:30 +0900 Subject: [PATCH] #914 --- src/web/app/desktop/tags/post-form.tag | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/web/app/desktop/tags/post-form.tag b/src/web/app/desktop/tags/post-form.tag index e49beeedb..e2948addd 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 => {