Commit Graph

63 Commits

Author SHA1 Message Date
Sam Saffron e9cf0de588 FEATURE: do not replace ↔ with an emoji
↔ technically can be an emoji, but usually will not be used in that way
2019-08-30 15:06:23 +10:00
Joffrey JAFFEUX 5d72561f4f
FIX: allows replacement of digits and symbols emojis (#7978) 2019-08-07 11:38:58 +02:00
Joffrey JAFFEUX 9ee2c121c1
FIX: ensures emoji helper is working with custom emojis (#7843) 2019-07-03 09:23:40 +02:00
Joffrey JAFFEUX dfde59f631
FIX: provides an emoji helper to replace codes by images (#7802) 2019-06-26 15:11:04 +02:00
Sam fa2a5f6f56
FEATURE: SKIP_DB_AND_REDIS env var (#7756)
Sometimes we would like to create a base image without any DB access, this
assists in creating custom base images with custom plugins that already
includes `public/assets`

Following this change set you can run:

```
SPROCKETS_CONCURRENT=1 DONT_PRECOMPILE_CSS=1 SKIP_DB_AND_REDIS=1 RAILS_ENV=production bin/rake assets:precompile
```

Then it is straight forward to create a base image without needing a DB or
Redis.
2019-06-13 12:58:27 +10:00
Sam Saffron 30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00
Tim Lange f7b156ffbd UX: Better emoji escaping for topic title (#7218)
* FIX: Fixed failing discourse-prometheus-alert-receiver plugin specs
2019-03-21 09:11:33 +01:00
Régis Hanol 6fb49e74a1
Revert "UX: Better emoji escaping for topic title (#7176)" (#7201)
This reverts commit 0d9bc0aaa6.
2019-03-19 12:02:47 +01:00
Tim Lange 0d9bc0aaa6 UX: Better emoji escaping for topic title (#7176) 2019-03-19 09:33:10 +01:00
Joffrey JAFFEUX d91b47064e
FIX: windows has no country flags (#7199) 2019-03-18 19:28:49 +01:00
Joffrey JAFFEUX 0a8f950281
FIX: bumps emoji cache version (#7195)
Might not be necessary, but might avoid weird results with all the recents emoji changes.
2019-03-18 08:22:36 +01:00
Joffrey JAFFEUX aa4b84925a FEATURE: updates emoji to latest 12.0 version (#7095)
* improved emoji support

- always optimize images as part of the task
- use the unicode standard ordering/naming for sections

* UX: more height for when there are recently used
2019-03-15 16:12:07 +01:00
Joffrey JAFFEUX d32557ea32 Revert "FIX: Better emoji escaping for topic title"
This reverts commit 35426b5ad6.
2019-03-13 13:02:56 +01:00
Tim Lange 35426b5ad6 FIX: Better emoji escaping for topic title
This commit also puts emojiVersion in its own erb file.
2019-03-13 11:17:59 +01:00
Régis Hanol 95e5f8380d FEATURE: Allow plugins to add custom emoji translations
FIX: buildTranslationTree was erroring when translations overlapped (ie. ":-)" and ":-))")
FIX: emoji translations wasn't working properly when translations overlapped
2019-01-04 15:27:46 +01:00
Joffrey JAFFEUX 3fbf7b164d
FEATURE: emoji 11.0 "recently added" update (#6275)
Adds support for emojis in the http://www.unicode.org/emoji/charts-11.0/emoji-released.html list
2018-08-16 11:59:45 +02:00
Joffrey JAFFEUX 691174fa8f
FEATURE: adds emoji search aliases 2018-05-01 15:43:49 +02:00
Régis Hanol 2d48caffdf FIX: be more lenient when deleting a custom emoji 2017-11-20 23:50:23 +01:00
Guo Xiang Tan 23b787e0a6 Require dependency otherwise it causes Sidekiq to lock up in development. 2017-09-25 13:48:59 +08:00
Guo Xiang Tan f496302c2c `order` scope is ignored when using `find_each`. 2017-08-07 11:46:18 +09:00
Régis Hanol c26ba890bd prevent N+1 when loading custom emojis 2017-08-04 17:04:59 +02:00
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Robin Ward 574681dc47 FIX: Show emoji in inline oneboxes 2017-07-21 14:24:48 -04:00
Joffrey JAFFEUX 54e0075a3e use the EMOJI_VERSION constant 2017-07-21 19:42:49 +02:00
Joffrey JAFFEUX 6de258d4cf FEATURE: Introduces new emoji-picker 2017-07-19 16:48:23 +02:00
Guo Xiang Tan fa35137d3a PERF: Reduce allocations in `Emoji.unicode_replacements`.
```
MemoryProfiler.report { Emoji.unicode_replacements }.pretty_print
```

Before:

```
Total allocated: 2032131 bytes (30219 objects)
Total retained:  798059 bytes (10734 objects)

allocated memory by gem
-----------------------------------
   1270762  discourse/app
    690149  2.4.1/lib
     48764  activesupport-4.2.8
     11405  bootsnap-1.0.0
      5266  logster-1.2.7
      2473  hiredis-0.6.1
      2056  redis-3.3.3
       840  discourse/lib
       240  activerecord-4.2.8
       176  thread_safe-0.3.6
```

After:

```
Total allocated: 1715713 bytes (22449 objects)
Total retained:  797985 bytes (10737 objects)

allocated memory by gem
-----------------------------------
    957250  discourse/app
    690028  2.4.1/lib
     48764  activesupport-4.2.8
     11445  bootsnap-1.0.0
      2745  hiredis-0.6.1
      2624  redis-3.3.3
      1473  logster-1.2.7
       928  discourse/lib
       280  activerecord-4.2.8
       176  thread_safe-0.3.6
```
2017-06-20 13:50:37 +09:00
Guo Xiang Tan 40ef5c4f14 PERF: Reduce memory allocation by `Emoji.unicode_replacements`.
Calling `Emoji.tonable_emojis` fetches from the cache but creates
a giant array each time it is called.

```
MemoryProfiler.report { Emoji.unicode_replacements }.pretty_print
```

Before:

```
Total allocated: 16560770 bytes (246364 objects)
Total retained:  784793 bytes (10624 objects)

allocated memory by gem
-----------------------------------
  10224581  activesupport-4.2.8
   3504241  hiredis-0.6.1
   1449466  discourse/app
    679314  2.4.1/lib
    419592  discourse/lib
    226720  redis-3.3.3
     56680  activerecord-4.2.8
       176  thread_safe-0.3.6
```

After:

```
Total allocated: 2127703 bytes (30556 objects)
Total retained:  798099 bytes (10735 objects)

allocated memory by gem
-----------------------------------
   1270762  discourse/app
    690149  2.4.1/lib
    106977  bootsnap-1.0.0
     48764  activesupport-4.2.8
      5266  logster-1.2.7
      2473  hiredis-0.6.1
      2056  redis-3.3.3
       840  discourse/lib
       240  activerecord-4.2.8
       176  thread_safe-0.3.6
```
2017-06-20 13:10:44 +09:00
Régis Hanol f77e6c8fc6 Merge pull request #4928 from jjaffeux/transform-native-emojis-to-names
Transforms native emojis to valid names
2017-06-14 15:43:09 +02:00
Joffrey JAFFEUX ab6086bce9 Transforms native skin toned emojis to valid names 2017-06-14 15:35:37 +02:00
Régis Hanol 04e175bc06 Merge pull request #4925 from jjaffeux/adds-tones-to-clear-cache
Makes sure we clear tonable_emojis cache
2017-06-14 14:56:41 +02:00
Joffrey JAFFEUX fa508042ff Makes sure we clear tonable_emojis cache 2017-06-14 11:11:02 +02:00
Joffrey JAFFEUX 299339a373 Fixes emoji name to code missing tones 2017-06-13 14:10:26 -04:00
Joffrey JAFFEUX 2aae6cfdbe look for aliases in Emoji.lookup_unicode 2017-06-05 18:53:11 +02:00
Joffrey JAFFEUX 64336a8c75 Emoji 5.0 support 2017-06-05 14:06:23 +02:00
Sam 44d7fe89ed FIX: unescape emoji in pretty title
This makes emoji in title consistent, it is later escaped back when needed
2017-05-15 10:28:05 -04:00
Guo Xiang Tan e61959e6a8 FIX: `CustomEmoji` may contain an invalid upload_id.
https://meta.discourse.org/t/white-screen-after-deleting-custom-emoji/61608
2017-05-05 14:53:38 +08:00
Guo Xiang Tan 99abbc2e2d UX: Order custom emojis by name. 2017-03-30 13:24:18 +08:00
Régis Hanol 747f4812e4 fix custom emoji support when using subfolder 2017-03-24 02:09:39 +01:00
Guo Xiang Tan 58de40154d Bump `EMOJI_VERSION` to clear cache. 2017-03-14 15:31:01 +08:00
Guo Xiang Tan 1a7e954e09 FIX: Store custom emojis as uploads.
* Depending on a hardcoded directory was a flawed design
  which made it impossible to debug when custom emojis go
  missing.
2017-03-14 13:07:18 +08:00
Rafael dos Santos Silva 9ee67ad89c FIX: Use full path for emoji resize job 2017-01-02 13:34:32 -02:00
Sam 89daa43754 FEATURE: remap emojis back for push notifications and desktop alerts 2016-10-11 13:03:48 +11:00
Robin Ward af266acac1 FIX: Plugin Custom emoji weren't working correctly on the server side 2016-07-22 12:59:43 -04:00
Robin Ward 3fe4903e63 FIX: Support unicode replacements with multiple codepoints 2016-07-05 13:55:41 -04:00
Robin Ward 55ba81494f
FIX: Allow `👍` and `👎` to work even though not in emoji.json 2016-04-27 14:56:23 -04:00
Robin Ward 616006a9ce FIX: All unicode replacements beside words. Omit some symbols. 2016-03-09 14:59:36 -05:00
Régis Hanol d7bc340310 FIX: Emoji.clear_cached wasn't deleting the right caches 2016-03-07 19:47:40 +01:00
Robin Ward 396713718b FEATURE: Adds ~200 more emoji
This includes all new emoji from Unicode 7 and Unicode 8 with the
exception of skin tones which will require a new interface.
2016-03-04 15:10:14 -05:00
Robin Ward 0167f6bb57 FIX: Don't substitute emojis within code blocks 2016-03-02 14:32:00 -05:00
Robin Ward 74780c1688 Add more server side unicode replacements for emoji 2015-12-30 14:46:52 -05:00