2025-01-11 02:21:11 +01:00
|
|
|
import { RdDTextEditor } from "../apps/rdd-text-roll.js";
|
|
|
|
import { SYSTEM_RDD } from "../constants.js";
|
|
|
|
import { Misc } from "../misc.js";
|
|
|
|
|
|
|
|
|
|
|
|
export class RdDJournalSheet extends JournalTextPageSheet {
|
|
|
|
static register() {
|
|
|
|
DocumentSheetConfig.unregisterSheet(JournalEntryPage, "core", JournalTextPageSheet)
|
|
|
|
DocumentSheetConfig.registerSheet(JournalEntryPage,
|
|
|
|
SYSTEM_RDD,
|
|
|
|
RdDJournalSheet, {
|
|
|
|
types: ["text"],
|
|
|
|
makeDefault: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async getData(options) {
|
|
|
|
const journalData = await super.getData(options);
|
|
|
|
journalData.editor.content = await RdDTextEditor.enrichHTML(journalData.document.text.content, this.object)
|
|
|
|
return journalData
|
|
|
|
}
|
|
|
|
|
|
|
|
activateListeners(html) {
|
|
|
|
super.activateListeners(html);
|
|
|
|
|
2025-01-11 17:32:43 +01:00
|
|
|
html.find('.roll-text').click(async event => await RdDTextEditor.rollText(event, this.actor))
|
2025-01-11 02:21:11 +01:00
|
|
|
}
|
|
|
|
}
|