From 60e88d61aaafe73bdd4b8834caa9945d08737c00 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 17 May 2025 23:14:10 -0700 Subject: [PATCH] Mostly have text editors working again --- css/deltagreen.css | 33 +++++++++++++++-------- module/item/item-sheet.js | 18 +++++++------ templates/actor/npc-sheet.html | 2 +- templates/actor/unnatural-sheet.html | 2 +- templates/actor/vehicle-sheet.html | 2 +- templates/item/item-armor-sheet.html | 2 +- templates/item/item-bond-sheet.html | 2 +- templates/item/item-gear-sheet.html | 2 +- templates/item/item-motivation-sheet.html | 2 +- templates/item/item-ritual-sheet.html | 4 +-- templates/item/item-tome-sheet.html | 4 +-- templates/item/item-weapon-sheet.html | 9 ++++--- 12 files changed, 48 insertions(+), 34 deletions(-) diff --git a/css/deltagreen.css b/css/deltagreen.css index 383781b..d1831a4 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -816,20 +816,22 @@ div.motivation-editor-container div.editor { min-height: 100% !important; } -.editor-host .tox .tox-editor-container { - background: none !important; -} - -.deltagreen .tox-editor-header { - background: none !important; -} - -.deltagreen .tox .tox-edit-area { - padding: 0 8px; +.deltagreen .editor-host { + align-items: stretch; } .deltagreen .editor-host .editor { - min-height: 50px; + min-height: 150px; + height: 100% !important; +} + +.deltagreen .editor .editor-container { + height: 100% !important; +} + +/* I think all the stuff below is now obsolete +.editor-host .tox .tox-editor-container { + background: none !important; } .deltagreen .editor-host .tox { @@ -848,6 +850,15 @@ div.motivation-editor-container div.editor { height: 300px; } +.deltagreen .tox-editor-header { + background: none !important; +} + +.deltagreen .tox .tox-edit-area { + padding: 0 8px; +} +*/ + /* Item Sheet Common CSS */ diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index fcbf356..0d9df28 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -41,16 +41,18 @@ export default class DeltaGreenItemSheet extends foundry.appv1.sheets async getData() { const data = super.getData(); - data.enrichedDescription = await TextEditor.enrichHTML( - this.object.system.description, - { async: true } - ); - - if (data.item.type === "tome" || data.item.type === "ritual") { - data.enrichedHandlerNotes = await TextEditor.enrichHTML( - this.object.system.handlerNotes, + data.enrichedDescription = + await foundry.applications.ux.TextEditor.implementation.enrichHTML( + this.object.system.description, { async: true } ); + + if (data.item.type === "tome" || data.item.type === "ritual") { + data.enrichedHandlerNotes = + await foundry.applications.ux.TextEditor.implementation.enrichHTML( + this.object.system.handlerNotes, + { async: true } + ); } return data; diff --git a/templates/actor/npc-sheet.html b/templates/actor/npc-sheet.html index 0f18924..129b6c3 100644 --- a/templates/actor/npc-sheet.html +++ b/templates/actor/npc-sheet.html @@ -126,7 +126,7 @@
- {{editor enrichedDescription target="system.notes" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.notes" engine="prosemirror" button=true owner=owner editable=editable}}
diff --git a/templates/actor/unnatural-sheet.html b/templates/actor/unnatural-sheet.html index 8a8d298..3d941e7 100644 --- a/templates/actor/unnatural-sheet.html +++ b/templates/actor/unnatural-sheet.html @@ -120,7 +120,7 @@
- {{editor enrichedDescription target="system.notes" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.notes" engine="prosemirror" button=true owner=owner editable=editable}}
diff --git a/templates/actor/vehicle-sheet.html b/templates/actor/vehicle-sheet.html index 8728340..9d8393b 100644 --- a/templates/actor/vehicle-sheet.html +++ b/templates/actor/vehicle-sheet.html @@ -51,7 +51,7 @@
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-armor-sheet.html b/templates/item/item-armor-sheet.html index 3b292b5..1b38c2f 100644 --- a/templates/item/item-armor-sheet.html +++ b/templates/item/item-armor-sheet.html @@ -42,7 +42,7 @@ {{!-- Description Tab --}}
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-bond-sheet.html b/templates/item/item-bond-sheet.html index f9f6ce3..3798876 100644 --- a/templates/item/item-bond-sheet.html +++ b/templates/item/item-bond-sheet.html @@ -30,7 +30,7 @@ {{!-- Description Tab --}}
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-gear-sheet.html b/templates/item/item-gear-sheet.html index e7253ab..85bd83d 100644 --- a/templates/item/item-gear-sheet.html +++ b/templates/item/item-gear-sheet.html @@ -39,7 +39,7 @@ {{!-- Description Tab --}}
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-motivation-sheet.html b/templates/item/item-motivation-sheet.html index abd9a67..5ebc25a 100644 --- a/templates/item/item-motivation-sheet.html +++ b/templates/item/item-motivation-sheet.html @@ -54,7 +54,7 @@
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}}
diff --git a/templates/item/item-ritual-sheet.html b/templates/item/item-ritual-sheet.html index 0110c69..d048644 100644 --- a/templates/item/item-ritual-sheet.html +++ b/templates/item/item-ritual-sheet.html @@ -71,7 +71,7 @@ {{!-- Description Tab --}}
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}}
{{!-- Handler Notes Tab --}} @@ -101,7 +101,7 @@ {{localize 'DG.ItemWindow.Tome.HandlerNotes'}}:
- {{editor enrichedHandlerNotes target="system.handlerNotes" button=true owner=owner editable=editable}} + {{editor enrichedHandlerNotes target="system.handlerNotes" engine="prosemirror" button=true owner=owner editable=editable}}
{{/if}} diff --git a/templates/item/item-tome-sheet.html b/templates/item/item-tome-sheet.html index ca84371..2806709 100644 --- a/templates/item/item-tome-sheet.html +++ b/templates/item/item-tome-sheet.html @@ -62,7 +62,7 @@ {{!-- Description Tab --}}
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} + {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}}
{{!-- Handler Notes Tab --}} @@ -87,7 +87,7 @@ {{localize 'DG.ItemWindow.Tome.HandlerNotes'}}:
- {{editor enrichedHandlerNotes target="system.handlerNotes" button=true owner=owner editable=editable}} + {{editor enrichedHandlerNotes target="system.handlerNotes" engine="prosemirror" button=true owner=owner editable=editable}}
{{/if}} diff --git a/templates/item/item-weapon-sheet.html b/templates/item/item-weapon-sheet.html index 127b939..cc03669 100644 --- a/templates/item/item-weapon-sheet.html +++ b/templates/item/item-weapon-sheet.html @@ -111,16 +111,17 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}}
{{!-- Description Tab --}} -
- {{editor enrichedDescription target="system.description" button=true owner=owner editable=editable}} +
+
+ {{editor enrichedDescription target="system.description" engine="prosemirror" button=true owner=owner editable=editable}} +