mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-14 13:34:42 +00:00
sync: investigation-board_v13 v0.2
This commit is contained in:
@@ -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 }
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user