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);
}
});
```
|
||
|---|---|---|
| .. | ||
| admin | ||
| discourse | ||
| discourse-common | ||
| docs | ||
| ember-addons | ||
| locales | ||
| pretty-text | ||
| wizard | ||
| admin.js.erb | ||
| application.js | ||
| deprecated.js | ||
| discourse-loader.js | ||
| discourse-objects.js | ||
| discourse.js.es6 | ||
| ember_include.js.erb | ||
| ember_jquery.js | ||
| ember-shim.js | ||
| env.js | ||
| main_include_admin.js | ||
| markdown-it-bundle.js | ||
| plugin-third-party.js.erb | ||
| plugin.js.erb | ||
| preload-store.js.es6 | ||
| pretty-text-bundle.js | ||
| template_include.js.erb | ||
| vendor.js | ||
| wizard-application.js | ||
| wizard-vendor.js | ||