diff --git a/investigation-board_v13/investigation-board/module.json b/investigation-board_v13/investigation-board/module.json index f9c4c9f..fc8f02e 100644 --- a/investigation-board_v13/investigation-board/module.json +++ b/investigation-board_v13/investigation-board/module.json @@ -1,15 +1,31 @@ - { - "id": "investigation-board", +{ "title": "Investigation Board", - "description": "A Foundry VTT module that lets everyone create...photo notes on the scene as collaborative investigation tools.", + "description": "A Foundry VTT module that lets everyone create, edit, and move sticky and photo notes on the scene as collaborative investigation tools.", "version": "1.3.2", - "authors": [{ "name": "Gus", "url": "", "email": "" }], - "compatibility": { "minimum": "12", "verified": "13" }, + "authors": [ + { + "name": "Gus", + "url": "", + "email": "" + } + ], + "compatibility": { + "minimum": "12", + "verified": "13" + }, "esmodules": [ "scripts/settings.js", "scripts/investigation-board.js" ], - "styles": ["styles/style.css"], + "styles": [ + "styles/style.css" + ], "packs": [], - "templates": ["templates/drawing-sheet.html"], -} + "templates": [ + "templates/drawing-sheet.html" + ], + "url": "https://github.com/mordachai/investigation-board", + "manifest": "https://github.com/mordachai/investigation-board/raw/main/module.json", + "download": "https://github.com/mordachai/investigation-board/raw/main/investigation-board.zip", + "id": "investigation-board" +} \ No newline at end of file diff --git a/investigation-board_v13/investigation-board/scripts/investigation-board.js b/investigation-board_v13/investigation-board/scripts/investigation-board.js index c55922c..923443a 100644 --- a/investigation-board_v13/investigation-board/scripts/investigation-board.js +++ b/investigation-board_v13/investigation-board/scripts/investigation-board.js @@ -76,8 +76,8 @@ class CustomDrawingSheet extends DrawingConfig { // Add activateListeners to hook up the file-picker button. activateListeners(element) { - super.activateListeners(html); - html.find(".file-picker-button").click(ev => { + super.activateListeners(element); + element.querySelectorAll(".file-picker-button").forEach(btn => btn.addEventListener("click", ev => { ev.preventDefault(); // Open Foundry's FilePicker for images; adjust the "current" directory if needed. new FilePicker({ @@ -88,7 +88,7 @@ class CustomDrawingSheet extends DrawingConfig { const input = element.querySelector("input[name='image']"); if (input) input.value = path; } }).browse(); - }); + })); } @@ -444,13 +444,13 @@ async function createNote(noteType) { Hooks.on("getSceneControlButtons", (controls) => { - const journalControls = controls.find((c) => c.name === "notes"); + const journalControls = Array.isArray(controls) ? controls.find((c) => c.name === "notes") : (controls["notes"] ?? controls.notes); if (!journalControls) return; journalControls.tools.push( - { name: "createStickyNote", title: "Create Sticky Note", icon: "fas fa-sticky-note", onClick: () => createNote("sticky"), button: true }, - { name: "createPhotoNote", title: "Create Photo Note", icon: "fa-solid fa-camera-polaroid", onClick: () => createNote("photo"), button: true }, - { name: "createIndexCard", title: "Create Index Card", icon: "fa-regular fa-subtitles", onClick: () => createNote("index"), button: true } + { name: "createStickyNote", title: "Create Sticky Note", icon: "fa-solid fa-note-sticky", onChange: (ev, active) => { if (active) createNote("sticky"); }, button: true }, + { name: "createPhotoNote", title: "Create Photo Note", icon: "fa-solid fa-camera-polaroid", onChange: (ev, active) => { if (active) createNote("photo"); }, button: true }, + { name: "createIndexCard", title: "Create Index Card", icon: "fa-regular fa-rectangle-list", onChange: (ev, active) => { if (active) createNote("index"); }, button: true } ); }); diff --git a/investigation-board_v13/version.nfo b/investigation-board_v13/version.nfo index 49d5957..3b04cfb 100644 --- a/investigation-board_v13/version.nfo +++ b/investigation-board_v13/version.nfo @@ -1 +1 @@ -0.1 +0.2