Widgets can now specify a template which is precompiled using Glimmer's
AST and then converted into our virtual dom code.
Example:
```javascript
createWidget('post-link-arrow', {
template: hbs`
{{#if attrs.above}}
<a class="post-info arrow" title={{i18n "topic.jump_reply_up"}}>
{{fa-icon "arrow-up"}}
</a>
{{else}}
<a class="post-info arrow" title={{i18n "topic.jump_reply_down"}}>
{{fa-icon "arrow-down"}}
</a>
{{/if}}
`,
click() {
DiscourseURL.routeTo(this.attrs.shareUrl);
}
});
```
|
||
|---|---|---|
| .. | ||
| actions-summary.js.es6 | ||
| avatar-flair.js.es6 | ||
| button.js.es6 | ||
| category-link.js.es6 | ||
| connector.js.es6 | ||
| decorator-helper.js.es6 | ||
| embedded-post.js.es6 | ||
| emoji.js.es6 | ||
| glue.js.es6 | ||
| hamburger-categories.js.es6 | ||
| hamburger-menu.js.es6 | ||
| hbs-compiler.js.es6 | ||
| header-topic-info.js.es6 | ||
| header.js.es6 | ||
| home-logo.js.es6 | ||
| hooks.js.es6 | ||
| link.js.es6 | ||
| menu-panel.js.es6 | ||
| notification-item.js.es6 | ||
| post-admin-menu.js.es6 | ||
| post-cooked.js.es6 | ||
| post-edits-indicator.js.es6 | ||
| post-gap.js.es6 | ||
| post-links.js.es6 | ||
| post-menu.js.es6 | ||
| post-placeholder.js.es6 | ||
| post-small-action.js.es6 | ||
| post-stream.js.es6 | ||
| post.js.es6 | ||
| poster-name.js.es6 | ||
| private-message-map.js.es6 | ||
| raw-html.js.es6 | ||
| search-menu-controls.js.es6 | ||
| search-menu-results.js.es6 | ||
| search-menu.js.es6 | ||
| time-gap.js.es6 | ||
| toggle-topic-summary.js.es6 | ||
| topic-admin-menu.js.es6 | ||
| topic-map.js.es6 | ||
| topic-notifications-button.js.es6 | ||
| topic-status.js.es6 | ||
| topic-timeline.js.es6 | ||
| user-menu.js.es6 | ||
| user-notifications-large.js.es6 | ||
| user-notifications.js.es6 | ||
| widget.js.es6 | ||