mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-01-10 15:40:57 -07:00
This commit is contained in:
parent
21e86e28a8
commit
216396b84a
1 changed files with 14 additions and 0 deletions
|
@ -407,6 +407,20 @@
|
||||||
if (e.dataTransfer.files.length > 0) {
|
if (e.dataTransfer.files.length > 0) {
|
||||||
Array.from(e.dataTransfer.files).forEach(this.upload);
|
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 => {
|
this.onkeydown = e => {
|
||||||
|
|
Loading…
Reference in a new issue