diff --git a/module/applications/api/application-v2-mixin.mjs b/module/applications/api/application-v2-mixin.mjs index f47eab5e84..b4bb0b1d49 100644 --- a/module/applications/api/application-v2-mixin.mjs +++ b/module/applications/api/application-v2-mixin.mjs @@ -175,7 +175,7 @@ export default function ApplicationV2Mixin(Base) { const selector = `.window-content :is(${[ "INPUT", "SELECT", "TEXTAREA", "BUTTON", "DND5E-CHECKBOX", "COLOR-PICKER", "DOCUMENT-TAGS", "FILE-PICKER", "HUE-SLIDER", "MULTI-SELECT", "PROSE-MIRROR", "RANGE-PICKER", "STRING-TAGS" - ].join(", ")}):not(.interface-only)`; + ].join(", ")}):not(.interface-only, .secret > button)`; for ( const element of this.element.querySelectorAll(selector) ) { if ( element.tagName === "TEXTAREA" ) element.readOnly = true; else element.disabled = true; diff --git a/module/applications/item/sheet-v2-mixin.mjs b/module/applications/item/sheet-v2-mixin.mjs index 66b5f9422d..237aa5e843 100644 --- a/module/applications/item/sheet-v2-mixin.mjs +++ b/module/applications/item/sheet-v2-mixin.mjs @@ -263,7 +263,7 @@ export default function ItemSheetV2Mixin(Base) { const selector = `:is(${[ "INPUT", "SELECT", "TEXTAREA", "BUTTON", "DND5E-CHECKBOX", "COLOR-PICKER", "DOCUMENT-TAGS", "FILE-PICKER", "HUE-SLIDER", "MULTI-SELECT", "PROSE-MIRROR", "RANGE-PICKER", "STRING-TAGS" - ].join(", ")}):not(.interface-only, .description-edit)`; + ].join(", ")}):not(.interface-only, .description-edit, .secret > button)`; for ( const element of form.querySelectorAll(selector) ) { if ( element.tagName === "TEXTAREA" ) element.readOnly = true; else element.disabled = true; diff --git a/module/applications/mixins/sheet-v2-mixin.mjs b/module/applications/mixins/sheet-v2-mixin.mjs index 09af0c8592..91c1e92544 100644 --- a/module/applications/mixins/sheet-v2-mixin.mjs +++ b/module/applications/mixins/sheet-v2-mixin.mjs @@ -215,6 +215,15 @@ export default function DocumentSheetV2Mixin(Base) { /* -------------------------------------------- */ + /** @override */ + _getSecretContent(secret) { + const edit = secret.closest("[data-edit]")?.dataset.edit + ?? secret.closest("[data-target]")?.dataset.target; + if ( edit ) return foundry.utils.getProperty(this.document, edit); + } + + /* -------------------------------------------- */ + /** * Handle the user toggling the sheet mode. * @param {Event} event The triggering event. @@ -277,7 +286,7 @@ export default function DocumentSheetV2Mixin(Base) { const content = await renderTemplate("systems/dnd5e/templates/items/parts/item-summary.hbs", context); summary.querySelectorAll(".item-summary").forEach(el => el.remove()); summary.insertAdjacentHTML("beforeend", content); - await new Promise(resolve => requestAnimationFrame(resolve)); + await new Promise(resolve => { requestAnimationFrame(resolve); }); this._expanded.add(item.id); } @@ -285,5 +294,14 @@ export default function DocumentSheetV2Mixin(Base) { icon.classList.toggle("fa-compress", !expanded); icon.classList.toggle("fa-expand", expanded); } + + /* -------------------------------------------- */ + + /** @override */ + _updateSecret(secret, content) { + const edit = secret.closest("[data-edit]")?.dataset.edit + ?? secret.closest("[data-target]")?.dataset.target; + if ( edit ) return this.document.update({ [edit]: content }); + } }; } diff --git a/templates/actors/tabs/character-biography.hbs b/templates/actors/tabs/character-biography.hbs index ac16df5890..47709fe4c1 100644 --- a/templates/actors/tabs/character-biography.hbs +++ b/templates/actors/tabs/character-biography.hbs @@ -37,7 +37,7 @@ {{!-- Biography --}} -
+

diff --git a/templates/items/parts/item-description2.hbs b/templates/items/parts/item-description2.hbs index ebea47c7bb..9d45c4f129 100644 --- a/templates/items/parts/item-description2.hbs +++ b/templates/items/parts/item-description2.hbs @@ -1,6 +1,6 @@ {{#*inline "description"}} -
+
{{ localize label }} {{#if @root.owner}} @@ -18,7 +18,8 @@
{{/inline}} -
+
{{#if editingDescriptionTarget}} {{ editor enriched.editing target=editingDescriptionTarget button=false editable=true engine="prosemirror"