Skip to content

Commit

Permalink
update documentation, allow proto stuff in handlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
esheyw committed Jan 29, 2024
1 parent cdd37e7 commit cc7f887
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
artifacts: "./module.json, ./module.zip"
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}

# - name: Foundry Package Admin Release
# uses: fjogeleit/http-request-action@v1
# with:
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@

## Version 0.2.5
- become npm package, write own simple sass compile job
- it works! release finally.
- it works! release finally.

## Version 0.2.6
- Attempt new foundry package release API
- Update MHLDialog's template-as-content support to allow prototype method and property use, matching the behaviour of foundry's `renderTemplate()`
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ The purple text is the `indentifier`, which can be supplied to disambiguated thi

---
## Classes
Classes are accessed via `game.pf2emhl.classes.`
### `MHLDialog`
MHLDialog is designed to be a drop-in replacement for the foundry Dialog class, with a few improvements:
#### Defaults to `jQuery:false` in options
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"paths": ["lang", "styles", "templates"]
}
},
"version": "0.1",
"version": "0.2.6",
"manifest": "updatedByRelease",
"url": "updatedByRelease",
"download": "updatedByRelease",
Expand Down
5 changes: 4 additions & 1 deletion scripts/classes/MHLDialog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ export class MHLDialog extends Dialog {
if (/\.(hbs|html)$/.test(data.content)) {
data.content = await renderTemplate(originalContent, data);
} else {
data.content = Handlebars.compile(originalContent)(data);
data.content = Handlebars.compile(originalContent, {
allowProtoMethodsByDefault: true,
allowProtoPropertiesByDefault: true,
})(data);
}
data.content ||= localize(`${PREFIX}.Error.TemplateFailure`);
}
Expand Down
3 changes: 2 additions & 1 deletion styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
--mhl-frame-color-1: var(--color-primary-1, var(--color-bg-trait));
--mhl-frame-color-2: var(--color-primary-2, var(--color-pf-primary-light));
--mhl-text-color: var(--text-dark);
--mhl-text-header-color: var(--mhl-text-color);

[data-color-scheme='dark'] {
--mhl-text-color: var(--text-color-1, var(--text-light));
--mhl-text-header-color: var(--mhl-text-color);
}

--mhl-text-header-color: var(--mhl-text-color);


[disabled] {
cursor: not-allowed;
Expand Down

0 comments on commit cc7f887

Please sign in to comment.