Commit Graph

6 Commits

Author SHA1 Message Date
Robin Ward
0caf6a0f7d Support for HTML values in widget hbs templates 2017-09-29 09:56:14 -04:00
Robin Ward
df81d109e5 The ability to attach attrs when embedding widgets 2017-09-28 16:08:43 -04:00
Robin Ward
e980322ed6 Allow hbs widgets to access their parent state 2017-09-28 15:19:44 -04:00
Robin Ward
8c2d6118ff Remove some of the last few fa-icon helpers 2017-09-14 11:20:36 -04:00
Robin Ward
cb56dcdf2e FIX: Use proper iconNode when compiling virtual dom templates 2017-09-01 11:20:33 -04:00
Robin Ward
dffb1fc4ee FEATURE: Use Glimmer compiler for widget templates
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);
  }
});
```
2017-09-01 09:28:16 -04:00