|
|
@@ -4,8 +4,33 @@ import NESBank from "/app/js/models/NESBank.js"; |
|
|
|
import NESPalette from "/app/js/models/NESPalette.js"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function HANDLE_DragOver(e){ |
|
|
|
e.stopPropagation(); |
|
|
|
e.preventDefault(); |
|
|
|
e.dataTransfer.dropEffect = 'copy'; |
|
|
|
}; |
|
|
|
|
|
|
|
function HANDLE_FileDrop(e){ |
|
|
|
e.stopPropagation(); |
|
|
|
e.preventDefault(); |
|
|
|
var files = e.dataTransfer.files; |
|
|
|
|
|
|
|
for (let i=0; i < files.length; i++){ |
|
|
|
console.log(files[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class CTRLIO{ |
|
|
|
constructor(){} |
|
|
|
|
|
|
|
initialize(){ |
|
|
|
var e = document.querySelectorAll(".drop-zone"); |
|
|
|
for (let i=0; i < e.length; e++){ |
|
|
|
e[i].addEventListener("dragover", HANDLE_DragOver); |
|
|
|
e[i].addEventListener("drop", HANDLE_FileDrop); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|