Anki/ts
Arthur Milchior efaaae8ce4
Cloze button get disabled outside of cloze field (#3879)
* NF: replace `disabled` by `enabled`

This allows to remove the negations and, in my opinion, make the code
easier to understand and edit.

* Cloze button get disabled outside of cloze field

More specifically, if the user focus in a field that is not a cloze
field, the button are still there but appear as disabled. The shortcut
instead of adding the cloze context shows an alert explaining why this
can't be done.

While this message is already displayed when the user tries to add a
note with cloze in non-cloze field, I suspect it will save time to
stop the user as soon as possible from making mistake. This should
make very clear what is authorized and what is not.

It'll also be a reminder of whether the current field is a cloze or
not.

In order to do this, I added a back-end method (that I expect we may
reuse in ankidroid) to get the index of the fields used in cloze. This
set is sent to the note editor, which propagates it where needed.

In mathjax, the cloze symbol is removed when the selected field is not
a cloze field.
2025-04-24 18:37:41 +10:00
..
editable add min-height to fields (#3922) 2025-04-15 20:24:43 +10:00
editor Cloze button get disabled outside of cloze field (#3879) 2025-04-24 18:37:41 +10:00
html-filter Reduce use of type casting (#3723) 2025-01-12 20:05:05 +11:00
icons Use tilted (filled and unfilled) sticky icons in the cards editor (#3825) 2025-02-16 22:24:11 +07:00
lib Add help modal to TR table (#3874) 2025-04-24 18:31:45 +10:00
mathjax Issue 2563 - remove mhchem (#3705) 2025-01-09 22:24:39 +11:00
reviewer Reduce use of type casting (#3723) 2025-01-12 20:05:05 +11:00
routes Add help modal to TR table (#3874) 2025-04-24 18:31:45 +10:00
src ts/src/app.html: Changed from favicon.png to favicon.ico (#3485) 2024-10-11 22:25:58 +10:00
tools Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
.gitignore Update eslint to 4.22.0 2021-04-22 19:19:39 +02:00
bundle_svelte.mjs Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
bundle_ts.mjs Add env var to enable sourcemaps 2022-12-04 11:37:16 +10:00
licenses.json Use CSP to block inline JS content in editor (#3939) 2025-04-23 16:21:48 +10:00
page.html Load page script after body created (#1802) 2022-04-19 17:16:56 +10:00
README.md add add.sh helper for adding dependency and updating licenses 2020-12-31 12:20:51 +10:00
svelte.config.js Fix import order 2024-05-17 17:11:28 +07:00
transform_ts.mjs Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
tsconfig.json Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
tsconfig_legacy.json Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
vite.config.ts Update vitest and unpin vite 2024-10-26 18:41:59 +10:00
yarn.sh Fix yarn.sh failing with linked out folder 2023-03-31 13:08:59 +10:00

Anki's TypeScript and Sass dependencies. Some TS/JS code is also stored separately in ../qt/aqt/data/web/.

To update all dependencies:

./update.sh

To add a new dev dependency, use something like:

./add.sh -D @rollup/plugin-alias