import NESPalette from "/app/js/models/NESPalette.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{ | class CTRLIO{ | ||||
constructor(){} | 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); | |||||
} | |||||
} | |||||
} | } | ||||
import CTRLPalettesStore from "/app/js/ctrls/CTRLPalettesStore.js"; | import CTRLPalettesStore from "/app/js/ctrls/CTRLPalettesStore.js"; | ||||
import CTRLBanksStore from "/app/js/ctrls/CTRLBanksStore.js"; | import CTRLBanksStore from "/app/js/ctrls/CTRLBanksStore.js"; | ||||
import CTRLBankTools from "/app/js/ctrls/CTRLBankTools.js"; | import CTRLBankTools from "/app/js/ctrls/CTRLBankTools.js"; | ||||
import CTRLIO from "/app/js/ctrls/CTRLIO.js"; | |||||
import NESPalette from "/app/js/models/NESPalette.js"; | import NESPalette from "/app/js/models/NESPalette.js"; | ||||
CTRLPalettesStore.initialize(); | CTRLPalettesStore.initialize(); | ||||
CTRLBanksStore.initialize(); | CTRLBanksStore.initialize(); | ||||
CTRLIO.initialize(); | |||||
} | } | ||||