28 lines
871 B
JavaScript

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);
html.find('.roll-carac-competence').click(async event => await RdDTextEditor.rollText(event, this.actor))
}
}