Anki/rslib
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
..
benches Update Rust and Python deps (#2567) 2023-07-01 18:26:43 +10:00
i18n Bump Rust to 1.81 for latest CVE 2024-09-05 12:39:59 +07:00
io Fix flaky tests (#3541) 2024-11-05 18:23:50 +10:00
linkchecker lazy_static → once_cell → stabilized versions (#3447) 2024-09-30 23:35:06 +10:00
process Corrected minor non-idiomatic snippet of code (#3108) 2024-04-01 11:34:23 +01:00
proto Bump Rust deps 2024-10-21 15:34:04 +10:00
proto_gen lazy_static → once_cell → stabilized versions (#3447) 2024-09-30 23:35:06 +10:00
src Cloze button get disabled outside of cloze field (#3879) 2025-04-24 18:37:41 +10:00
sync Add distroless Dockerfile and implement internal health check (#3366) 2024-08-29 17:05:33 +07:00
tests/support move linkchecker into separate crate 2021-12-20 17:27:43 +10:00
.gitignore initial Bazel conversion 2020-11-01 14:26:58 +10:00
bench.sh Update Rust and Python deps (#2567) 2023-07-01 18:26:43 +10:00
build.rs Fix building outside workspace 2023-07-02 18:22:44 +10:00
Cargo.toml Fully switch to File::set_times() from utime crate (#3503) 2024-10-16 02:35:37 +10:00
README.md Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
rust_interface.rs Update nightly formatter 2023-09-02 16:13:50 +10:00

Anki's Rust code.