summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/web/app/desktop/tags/post-form.tag14
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 => {