Files
foundryvtt-reve-de-dragon/module/journal/journal-sheet.mjs
T
fabres 25e3df1f5d Migration Foundry v14 : classes V1→V2, corrections CSS et bugs
- 21 classes Dialog → DialogV2
- 2 classes Application → ApplicationV2 + HandlebarsApplicationMixin
- 1 classe FormApplication → ApplicationV2
- 10 appels new Dialog() → DialogV2 (rdd-confirm, rdd-commands, etc.)
- base-actor-sheet.mjs : 3 appels new Dialog → DialogV2
- Sheet journal : JournalTextPageSheet → JournalEntryPageProseMirrorSheet
- CSS : backdrop-filter, box-shadow, bordures V2 supprimes pour calendar/astrologie
- FenetreRechercheTirage : _getWindowControls + dragDrop ajoutes
- HtmlUtility.showControlWhen : compat jQuery + DOM natif
- rdd-main.js : init calendrier en setTimeout
- Constantes : duplicate → deepClone, _id → id
- renderTemplate global → foundry.applications.handlebars.renderTemplate
2026-07-22 00:29:56 +02:00

32 lines
1.2 KiB
JavaScript

import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js"
import { SYSTEM_RDD } from "../constants.js"
export class RdDJournalSheet extends foundry.applications.sheets.journal.JournalEntryPageProseMirrorSheet {
static register() {
foundry.applications.apps.DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", foundry.appv1.sheets.JournalTextPageSheet)
foundry.applications.apps.DocumentSheetConfig.registerSheet(JournalEntryPage, SYSTEM_RDD, RdDJournalSheet, {
types: ["text"],
makeDefault: true,
})
}
async _prepareContentContext(context, options) {
if ( this.isView ) {
context.text = { ...this.page.text }
context.text.enriched = await RdDTextEditor.enrichHTML(context.text.content, this.page)
}
}
async _onRender(context, options) {
await super._onRender(context, options)
const el = this.element
el.querySelectorAll(".roll-text").forEach(btn =>
btn.addEventListener("click", event => RdDTextEditor.rollText(event, this.actor))
)
el.querySelectorAll(".chat-roll-text").forEach(btn =>
btn.addEventListener("click", event => RdDTextEditor.chatRollText(event))
)
}
}