From 6c72605156e4de9cf16cec9a686bfbab1ab8c487 Mon Sep 17 00:00:00 2001 From: Alexander Minges Date: Sat, 12 Jul 2025 21:46:47 +0200 Subject: [PATCH] feat: complete ApplicationV1 to V2 migration cleanup - Remove jQuery dependency from render hooks - Update selectTargetInputOnFocus to use modern DOM methods - Remove legacy appv1 sheet unregistration calls - Eliminate all remaining V1 compatibility code --- src/hooks/init.js | 2 -- src/hooks/render.js | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hooks/init.js b/src/hooks/init.js index a57f4a6e..0f339af2 100644 --- a/src/hooks/init.js +++ b/src/hooks/init.js @@ -65,7 +65,6 @@ async function init() { registerSystemSettings(); - foundry.applications.apps.DocumentSheetConfig.unregisterSheet(Actor, "core", foundry.appv1.sheets.ActorSheet); foundry.applications.apps.DocumentSheetConfig.registerSheet(Actor, "ds4", DS4CharacterActorSheet, { types: ["character"], makeDefault: true, @@ -74,7 +73,6 @@ async function init() { types: ["creature"], makeDefault: true, }); - foundry.applications.apps.DocumentSheetConfig.unregisterSheet(Item, "core", foundry.appv1.sheets.ItemSheet); foundry.applications.apps.DocumentSheetConfig.registerSheet(Item, "ds4", DS4ItemSheet, { makeDefault: true }); foundry.applications.apps.DocumentSheetConfig.unregisterSheet( ActiveEffect, diff --git a/src/hooks/render.js b/src/hooks/render.js index c8028dbf..1714f6d5 100644 --- a/src/hooks/render.js +++ b/src/hooks/render.js @@ -17,10 +17,13 @@ export function registerForRenderHooks() { * Select the text of input elements in given application when focused via an on focus listener. * * @param {Application} app The application in which to activate the listener. - * @param {JQuery} html The {@link JQuery} representing the HTML of the application. + * @param {HTMLElement} element The HTML element representing the HTML of the application. */ -function selectTargetInputOnFocus(app, html) { - html.find("input").on("focus", (ev) => { - ev.currentTarget.select(); +function selectTargetInputOnFocus(app, element) { + const inputs = element.querySelectorAll("input"); + inputs.forEach(input => { + input.addEventListener("focus", (ev) => { + ev.currentTarget.select(); + }); }); }