Go to file
Joffrey JAFFEUX be75773375
FIX: fully rely on keyValueStore to prevent error (#12)
* FIX: fully rely on keyValueStore to prevent error

The component was generating errors for some users due to direct access to `localStorage`:

```
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.expireOldValues (https://d3bpeqsaub0i6y.cloudfront.net/theme-javascripts/33bf35dc19b970a42f8c1e7d57d8cc72d6205bbd.js?__ws=meta.discourse.org:157:14)
    at Object.initialize (https://d3bpeqsaub0i6y.cloudfront.net/theme-javascripts/33bf35dc19b970a42f8c1e7d57d8cc72d6205bbd.js?__ws=meta.discourse.org:193:12)
    at o.initialize (https://d11a6trkgmumsb.cloudfront.net/assets/discourse-2bd9a9aa6b5c9cbee990a03159f5bff41fe503fe74814c3b66b3770876913dd5.gz.js:68:38)
```

This commits removes old unnecessary code using cookies and uses latest API from core `removeKeys`. Old discourse instances will just not evict old keys which is a minor annoyance.

* linting
2022-08-22 00:25:50 +02:00
.github/workflows DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00
common UX: makes texts more readable 2021-06-01 11:38:29 +02:00
javascripts/discourse FIX: fully rely on keyValueStore to prevent error (#12) 2022-08-22 00:25:50 +02:00
locales REFACTOR: various code/UI/UX changes and refactorings 2020-04-20 16:07:10 +02:00
mobile removes links and clear placeholders for now 2020-04-22 12:41:42 +02:00
.discourse-compatibility DEV: Fix `key-value-store:main` deprecation (#11) 2022-08-13 22:40:11 +02:00
.eslintrc DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00
.gitignore DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00
.prettierrc DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00
.template-lintrc.js DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00
LICENSE init 2019-05-14 11:18:12 +02:00
README.md Update README.md 2019-05-30 10:17:22 +02:00
about.json DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00
package.json DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00
yarn.lock DEV: Add CI setup and fix linting issues (#9) 2022-06-18 21:27:31 +02:00

README.md

discourse-placeholder-theme-component

https://meta.discourse.org/t/discourse-placeholder-theme-component/113533

Usage

[wrap=placeholder key=NAME][/wrap]
[wrap=placeholder key=COUNTRY default=FR][/wrap]
[wrap=placeholder key=SECRET description="Used to open the bank"][/wrap]

I'm =NAME=, I come from =COUNTRY= let me tell you my secret: =SECRET==

Feedback

If you have issues or suggestions for the plugin, please bring them up on Discourse Meta.