Commit Graph

51 Commits

Author SHA1 Message Date
9811a1c5d9 DEV: Allow transformed values to be used in all widget hbs statements (#13331)
Previously, the `transformed.blah` shortcut could only be used in top-level hbs statements like {{transformed.blah}}. When attempting to use it in a sub-expression like `{{concat "hello" transformed.world}}`, it would raise a "transformed is not defined" error.

This commit updates the shortcut logic to make `transformed.blah` and `attrs.blah` work consistently in all hbs expressions.

Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
2021-06-08 16:46:07 +01:00
59097b207f DEV: Correct typos and spelling mistakes (#12812)
Over the years we accrued many spelling mistakes in the code base. 

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change 

- comments
- test descriptions
- other low risk areas
2021-05-21 11:43:47 +10:00
8957e4d9d0 A11Y: makes user notifications list more accessible (#11992)
Previous markup used to be

```
<div>
  <div>
    <li>
```

Instead we will now have:

```
<ul>
  <li>
    <div>
```

Note this commit also adds two things:
- ability to override tagName of a widget when attaching it
- ability to pass opts and otherOpts to {{attach}}, it could be useful in templates but is mostly useful to test `tagName` for now
2021-02-08 08:45:14 +01:00
61f5d501cb DEV: Migrate to Ember CLI (#11932)
This encompasses a lot of work done over the last year, much of which
has already been merged into master. This is the final set of changes
required to get Ember CLI running locally for development.

From here on it will be bug fixes / enhancements.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com>

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com>
2021-02-03 14:22:20 -05:00
ce3fe2f4c4 REFACTOR: Support bundling our admin section as an ember addon 2020-09-22 15:14:29 -04:00
7df57b35da REFACTOR: Remove Discourse.__widget_helpers
It's now a variable in the context where the templates are created.
2020-08-06 14:35:46 -04:00
8c03868808 DEV: Correctly render data- attributes in widget hbs templates (#10376)
In virtualdom, element 'properties' are not completely synonymous with element 'attributes'. In particular, `data-` properties will not be rendered as attributes. To ensure all attributes are passed through, we need to include them under an `attributes` key. For more info, see https://github.com/Matt-Esch/virtual-dom/blob/master/docs/vnode.md#custom-attributes-data-
2020-08-06 14:33:09 +01:00
23d585f255 REFACTOR: removes unreachable statement (#9680) 2020-05-07 16:37:02 +02:00
b2b7afd310 Rename the server side widget hbs compiler 2020-03-27 12:06:14 -04:00
eaa324ecbd Revert "Move the widget-hbs compiler to js from es6"
This reverts commit 5d66a2c16e6bd21246e6becbef34da8ed07926bc.
2020-03-25 16:13:26 -04:00
5d66a2c16e Move the widget-hbs compiler to js from es6 2020-03-25 15:03:21 -04:00
a5e80079d6 FEATURE: Add Belarusian language 2019-07-04 11:37:37 +02:00
4f97f85178 DEV: Fix lint. (#7824) 2019-06-28 20:24:09 +02:00
3cb0d27d38 DEV: Upgrade our widget handlebars compiler
Now supports subexpressions such as i18n and concat, plus automatic
attaching of widgets similar to ember.
2019-05-02 15:47:57 -04:00
dd29af4475 REFACTOR: {{avatar}} and {{date}} helpers in vdom templates
This is a step towards a nicer flag display under posts.
2019-04-30 15:22:38 -04:00
d43f4206c7 FEATURE: Add Armenian language 2019-03-28 14:24:14 +01:00
5cef5b34ef DEV: Yarn-manage moment and moment-timezone libraries 2019-02-12 13:57:52 -05:00
5407036ef9 DEV: Run prettier. (#6420) 2018-09-21 11:02:23 +00:00
0732c69f73 updates moment.js 2.22.1 and vendor moment-timezone 0.5.14 2018-04-26 09:15:53 +02:00
234aa68bf8 Correct Arabic month names
Correct Arabic month names. It's not right to concatenate month names from two different calendars [Assyrian calendar](https://en.wikipedia.org/wiki/Assyrian_calendar) and [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar)
2018-01-14 20:01:45 +01:00
364e6fdd53 FIX: pluralization rules for Serbian language (#5453)
Updated SR pluralization to use 3 keys: one, few, other (as by Transifex)
2017-12-22 12:20:19 +01:00
0c84352386 Add support for transformations 2017-10-05 16:24:58 -04:00
07d04aba1d Support {{unless}} in virtual dom templates 2017-10-05 14:35:07 -04:00
051b49efdb FIX: Properly encode string literals in hbs compiler 2017-10-04 15:53:06 -04:00
0caf6a0f7d Support for HTML values in widget hbs templates 2017-09-29 09:56:14 -04:00
df81d109e5 The ability to attach attrs when embedding widgets 2017-09-28 16:08:43 -04:00
e980322ed6 Allow hbs widgets to access their parent state 2017-09-28 15:19:44 -04:00
8c2d6118ff Remove some of the last few fa-icon helpers 2017-09-14 11:20:36 -04:00
cb56dcdf2e FIX: Use proper iconNode when compiling virtual dom templates 2017-09-01 11:20:33 -04:00
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
0f2e2ea175 Update moment locales as well. 2017-04-20 12:24:20 +08:00
8052218f61 Upgrade momentjs. 2017-04-19 22:04:35 +08:00
477b237e45 FIX: use 'other' instead of 'many' for Ukrainian pluralization until translations are fixed 2016-12-30 11:49:25 -05:00
3f765e0227 Added Urdu locale file for moment.js 2016-12-06 13:55:38 -05:00
4eeae880b6 fix deprecation comment in momentjs 2016-05-21 12:49:29 +02:00
d43231da92 FIX: force date-picker to work with english locale 2016-05-18 20:58:33 +02:00
cc25716e47 FIX: Allow message format translations to be overridden 2016-04-08 14:49:50 -04:00
44e41df76b FIX: add missing MessageFormat files for fa_IR, pl_PL and tr_TR 2016-03-30 14:02:42 -04:00
8ced8350ba Upgrade moment.js to version 2.11.2
In order to make future upgrades easier we don't rename the locale files anymore.
2016-02-05 21:42:48 +01:00
c42a5551a1 Update RU pluralization to use 3 keys: one, few, other (as by Transifex) 2014-08-23 15:28:14 +03:00
55c01d3320 Upgrade moment.js to latest version, add missing locales now that we
support more languages.
2014-08-20 14:41:50 -04:00
cb11967715 Add transifex config. Reconcile client.yml and server.yml translations in github and transifex. Transifex is now the source of all client.yml and server.yml files. 2014-04-10 15:42:38 -04:00
c6bc324259 CLEANUP: remove unused pseudo locale 2014-02-26 19:03:04 +01:00
Sam
e922f10f4e correct locale helper so it falls back to english message format if mf is missing 2013-07-25 11:16:07 +10:00
Sam
d0f50cb266 fixing up moment locales, they were not set up properly 2013-07-25 11:09:29 +10:00
8c5e0e7550 Adding Portuguese-Brazil language 2013-07-15 14:45:16 -03:00
Sam
c2cfbce9ce automatically updating times for posts on topic
moved moment.js into localization file (we need to localize it)
added helpers for date formatting use, moment().shortDate() moment().longDate() moment().shortDateNoYear()
2013-06-11 17:25:50 +10:00
Sam
5fa20ce357 more progress towards full migration to moment.js 2013-06-07 18:27:42 +10:00
Sam
c2e597c57c missing message format files 2013-05-30 17:03:47 +10:00
Sam
c26d70e68a make precompile happier 2013-05-30 16:58:31 +10:00