Commit Graph

412 Commits

Author SHA1 Message Date
12423b56cb Update translations (#15928) 2022-02-15 15:10:10 +01:00
fa9b2b4f42 Update translations (#15864) 2022-02-08 14:13:14 +01:00
0dfaaf49a5 Update translations (#15816) 2022-02-04 16:23:45 +00:00
febe997bee FIX: Regression in timezone name localizations (#15761)
This also switches to using the NPM package for better build stability. And adds a clearer label in the alert that is displayed to show your current timezone (when changing timezones).
2022-02-02 23:41:42 +01:00
5fd13380d8 Update translations (#15705) 2022-01-25 14:27:05 +01:00
f0435ca1a7 Update translations (#15673) 2022-01-23 11:14:20 +01:00
17ec3bc5b9 FEATURE: date-range tag for local dates (#15474)
New range tag for local dates with syntax like:
```
[date-range from=2022-01-06T13:00 to=2022-01-08 timezone=Australia/Sydney]
```

Previously, 2 dates in one line were considered as range. It was hard to decide if 2 dates are range when they were in separate lines or have some content between them.

New explicit tag should clearly distinguish between single date and range.

Common code from `addLocalDate` is extracted to `addSingleLocalDate`.

Both `addLocalDate` and new `addLocalRange` are using `addSingleLocalDate`.

Also, `defaultDateConfig` was extracted to have one place for all possible parameters.
2022-01-10 08:02:36 +01:00
c665003203 Update translations (#15416) 2021-12-28 14:13:58 +01:00
4afd6f0189 Update translations (#15292) 2021-12-14 14:53:35 +01:00
3fec579ede Update translations (#15210) 2021-12-07 16:19:44 +01:00
4c46c7e334 DEV: Remove xlink hrefs (#15059) 2021-11-25 15:22:43 +11:00
563b27b763 Update translations (#15065) 2021-11-23 17:29:39 +01:00
8420cf047e Update translations (#14970) 2021-11-16 16:17:10 +01:00
906a71a607 DEV: Fix linting issues in core plugins (#14916) 2021-11-13 15:31:42 +01:00
4ad77f3382 DEV: Remove .es6 extensions from core (#14912)
Still supported in plugins though.
2021-11-13 12:51:53 +01:00
431f0dce4c DEV: Update discourse-local-dates for eslint shorthand rule (#14872)
See 4f7aba06c0
2021-11-10 11:58:11 +11:00
a87216f1f3 A11Y: set modal widths with EMs; improves scaling (#14863) 2021-11-09 14:56:05 -05:00
5d20304f95 Update translations (#14855) 2021-11-09 14:54:59 +01:00
d162229758 DEV: Replace equal() with strictEqual() (#14827) 2021-11-08 10:26:28 +01:00
6894b3f3af Update translations (#14792) 2021-11-02 18:49:00 +01:00
0f71a43434 Update translations (#14714) 2021-10-27 14:24:43 +02:00
25097fa0af Update translations (#14648) 2021-10-19 15:23:54 +02:00
9062fd9b7a FIX: improvements for download local dates (#14588)
* FIX: do not display add to calendar for past dates

There is no value in saving past dates into calendar

* FIX: remove postId and move ICS to frontend

PostId is not necessary and will make the solution more generic for dates which doesn't belong to a specific post.

Also, ICS file can be generated in JavaScript to avoid calling backend.
2021-10-14 09:22:44 +11:00
b44119cdb2 Update translations (#14579) 2021-10-12 16:00:22 +02:00
837bd5a6e5 FIX: Fix local-dates in non-post contexts, and in long topics (#14565)
- Stop looking up the topic title from the DOM. On long topics, the topic title may not be present. Instead, we can store the topic title in a data-title attribute during decorateCookedElement, and then access it later. This approach would also allow us to add customize titles per-local-date in future. If there is no topic title available (e.g. when local dates are used elsewhere in the UI), we use the site name to build a sensible default

- Don't require a postId for creating calendar events. We don't have postIds in non-post contexts. At the moment, the 'download ICS' function will fail without a valid postId, so that will need to be fixed in a future commit.
2021-10-08 20:22:52 +01:00
4285706d97 FIX: local date trim when no time available (#14525)
When there is a blank space in the end of date, moment is returning a different value:

```javascript
  console.log(moment.tz("2021-09-09 ", "Australia/Sydney").toISOString());
  // 2021-09-09T00:00:00.000Z
  console.log(moment.tz("2021-09-09", "Australia/Sydney").toISOString());
  // 2021-09-08T14:00:00.000Z
```
2021-10-06 16:18:32 +11:00
cb5b0cb9d8 FEATURE: save local date to calendar (#14486)
It allows saving local date to calendar.
Modal is giving option to pick between ics and google. User choice can be remembered as a default for the next actions.
2021-10-06 14:11:52 +11:00
0f5d737a61 Update translations (#14513) 2021-10-05 15:59:26 +02:00
62b27ea9f3 DEV: Fix moment warnings (#14482)
When start/end was missing the time component the string passed to `moment()` would have a space at the end. This was causing these warnings:

```
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
```
2021-09-30 22:07:48 +02:00
c9e7b64a64 DEV: Add toolbar button when chat in installed (#14422) 2021-09-22 13:46:06 -05:00
e28a2735bc FIX: correctly defines data-attributes used by local-dates (#14418)
This was previously relying on data-* being allowed by other initialisers which could cause bugs if local dates ends up being used in other contexts.
2021-09-22 16:49:45 +02:00
38c3a44bf9 FIX: return empty array when no parent for range (#14386)
If parent element for range does not exists, range calculator should
return empty array. In that case duration calculations will stop because
of:

```
if (_rangeElements(element).length === 2) {
  opts.duration = _calculateDuration(element);
}
```
2021-09-20 16:03:02 +10:00
82b7e34f30 FEATURE: local dates range on click (#14355)
This PR is introducing 2 changes.
1. Date popup is displayed on click instead on hover
2. If the range is given then the whole range is always displayed for both startDate and endDate
3. For range, short time is displayed for end if the range is < 24 hours
2021-09-20 09:23:18 +10:00
5cce1b38e4 Update translations (#14336) 2021-09-14 16:21:00 +02:00
09764291b1 FIX: In test mode, initializers were modifying classes over and over
This adds a new property, `pluginId` which you can pass to `modifyClass`
which prevent the class from being modified over and over again.

This also includes a fix for polls which was leaking state between tests
which this new functionality exposed.
2021-09-02 11:22:01 -04:00
c995b20ca4 Update translations (#14063) 2021-08-24 15:25:44 +02:00
4ca34940d3 DEV: ensures container is not destroyed before showing tooltip (#13992)
In fast tests it could results in an error.
2021-08-10 11:48:31 +02:00
11668ee85b PERF: generates dates tooltip on demand (#13944) 2021-08-04 16:28:07 +02:00
d23c0c06c3 PERF: reduces rendering time of local-dates (#13931)
- prefers insertAdjacentHTML over innerHTML as it's much faster in this case (about 5x)
- memoizes tz.guess()
- memoizes list of timezones
- inlines template
- applies main element class in one pass

All in all for a very edge case of about 80 dates it should be faster of about 15/20ms.
2021-08-04 08:27:22 +02:00
0c422cff1e Update translations (#13898) 2021-07-30 11:30:10 +02:00
e951cb9aef Update translations (#13860) 2021-07-27 15:24:03 +02:00
3667cc6447 Update translations (#13821) 2021-07-22 12:31:19 +02:00
28b5e6e47d Update translations (#13796) 2021-07-21 10:30:34 +02:00
53fe8b2e77 Update translations (#13647) 2021-07-13 20:30:09 +02:00
aa56e2a758 DEV: Don't use the Ember global (#13535) 2021-06-29 19:54:18 +02:00
23930738a7 Update translations (#13565) 2021-06-29 16:02:02 +02:00
252dd169a4 Update translations (#13476) 2021-06-22 15:21:20 +02:00
77d33ebe21 FIX: Lots of plugin tests were using old, non-Ember compat CLI APIs (#13320) 2021-06-09 10:58:55 -04: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
55611a5b80 Update translations (#13089) 2021-05-18 16:49:18 +02:00