forked from public/foundryvtt-reve-de-dragon
Start SheetV2 & fields
This commit is contained in:
22
module/common/description.mjs
Normal file
22
module/common/description.mjs
Normal file
@ -0,0 +1,22 @@
|
||||
import { RdDTextEditor } from "../apps/rdd-text-roll-editor.js"
|
||||
import CommonTemplate from "./common-template.mjs"
|
||||
import { HTMLSTRING } from "./field-types.mjs"
|
||||
|
||||
const fields = foundry.data.fields
|
||||
|
||||
export class CommonDescription extends CommonTemplate {
|
||||
fields() {
|
||||
return {
|
||||
description: new fields.HTMLField({ ...HTMLSTRING }),
|
||||
descriptionmj: new fields.HTMLField({ gmOnly: true, ...HTMLSTRING })
|
||||
}
|
||||
}
|
||||
|
||||
async prepareContext(item) {
|
||||
return {
|
||||
description: await RdDTextEditor.enrichHTML(item.system.description, item),
|
||||
descriptionmj: await RdDTextEditor.enrichHTML(item.system.descriptionmj, item),
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user