Anki/ts
Arthur Milchior b08e454f57
If deck options are modified, ask before closing (#3410)
* If deck options are modified, ask before closing

This imitates the way the note editor behaves. If a user assumes by
error that chanhges are automatically saved, it ensures they won't
lose them.

Also, this will eventually allows to have the same feature on
AnkiDroid. While, currently, we always ask the user whether they want
to close the deck options, even when there are no modification, which
seems to regularly frustate users (including myself).

I'm new to Svelte, please let me know whether there is a better way to
obtain the information from Svelte state that I missed.

Note that I ensured that only a boolean can be obtained. I didn't
cause the whole state to be accessible. May be useful for some
add-ons, I guess, but risks breaking too much things.

Regarding the deckoptions.py, I tried to imitate addcards.py way to
check whether the add card view can be closed. Reusing the same
function and variable name when possible.

* Update qt/aqt/deckoptions.py (dae)
2024-09-22 18:07:24 +10:00
..
editable Svg icon (#3135) 2024-04-24 02:37:31 +01:00
editor Update dprint (#3376) 2024-08-22 18:24:56 +07:00
html-filter Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
icons Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
lib Fix FSRS progress update issues (#3420) 2024-09-20 21:18:02 +10:00
mathjax Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
reviewer Use key instead of code in type-in field (#3166) 2024-05-01 16:59:11 +10:00
routes If deck options are modified, ask before closing (#3410) 2024-09-22 18:07:24 +10:00
src Include error message text on page 2024-06-24 15:35:47 +07: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 Dependency updates (#3403) 2024-09-04 12:21:50 +07: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 Formatting fix 2024-06-20 20:43:43 +07: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