Commit Graph

10385 Commits

Author SHA1 Message Date
Damien Elmes
cc45789c02 Update translations 2023-05-29 13:36:07 +10:00
Damien Elmes
16c8c9cadc Fix broken styling when path includes certain Latin1 chars
https://forums.ankiweb.net/t/bug-2-1-64-the-updated-version-of-anki-is-causing-functionality-problems-with-autohotkey-and-goldendict/30575/5
2023-05-29 13:35:45 +10:00
Damien Elmes
f3147ce727 Opt in to new sparse index handling
https://blog.rust-lang.org/inside-rust/2023/01/30/cargo-sparse-protocol.html
2023-05-29 12:35:08 +10:00
chrissy0
70ce584d63
Making phrasing more clear in dialog which lets user choose a deck to display options for. (#2522) 2023-05-26 12:50:38 +10:00
Damien Elmes
15dcb09036
Detect incorrect usage of triple slash in TypeScript (#2524)
* Migrate check_copyright to Rust

* Add a new lint to check accidental usages of /// in ts/svelte comments

* Fix a bunch of incorrect jdoc comments

* Move contributor check into minilints

Will allow users to detect the issue locally with './ninja check'
before pushing to CI.

* Make Cargo.toml consistent with other crates
2023-05-26 12:49:44 +10:00
Abdo
8d1e5c373b
Fix some add-on installation errors not being reported (#2518) 2023-05-25 13:15:11 +10:00
Damien Elmes
e100789d24 Update requests for CVE
CVE-2023-32681
2023-05-24 16:09:15 +10:00
Damien Elmes
1ec6901933 Bump version 2023-05-24 16:07:43 +10:00
Damien Elmes
7686cb8de8
Fix misaligned image occlusions (#2512)
* Cloze styling is not required in I/O notetype

* Use raw string for IO template

* Rename to notetype.css and use more specific ids

* Move internal i/o styling into runtime

Storing it in the notetype makes it difficult to make changes, and
makes it easier for the user to break.

* Fix misaligned occlusions

At larger screen sizes, the canvas was not increasing above its configured
size, so it ended up being placed top center instead of expanding to fit
the entire container area.

To resolve this, both the image and canvas are forced to the container
size, and the container is constrained to the size of the viewport,
with the same aspect ratio as the image.

Closes #2492
2023-05-23 11:59:50 +10:00
Damien Elmes
581f82c589 Update translations 2023-05-22 14:08:46 +10:00
Ren Tatsumoto
9c5edfa88c
Ensure there's no duplicate shortcuts after running state_shortcuts_will_change (#2509)
* remove duplicate shortucts after running hook

* normalize shortcuts by converting them to QKeySequence

* no need to copy here

* extract method
2023-05-22 14:07:15 +10:00
Hikaru Y
d2176ff712
Fix page scrolling when input box loses focus (#2508)
… if page content exceeds viewport.

- Set 'opacity' to 0 instead of setting 'left' to a large negative
  value to create an invisible but focusable button.
- Prevent page from scrolling by setting 'left/top' to the values
  of 'scrollX/scrollY'.
2023-05-22 13:57:39 +10:00
Joel Koen
6b1c799cbf
Expose some collection methods already public in rslib backend (#2510)
* Expose some collection methods already public in rslib backend
2023-05-22 13:44:18 +10:00
Damien Elmes
878920712f Mention enter key
https://github.com/ankitects/anki/pull/2496/
2023-05-22 13:41:33 +10:00
Damien Elmes
cb3d2ff97a Move answer keys to right of dialog to reduce vertical space 2023-05-20 17:37:55 +10:00
Damien Elmes
644b003687 Fix Windows CI
The external file should be read at runtime, not compile time.
2023-05-20 11:20:16 +10:00
Damien Elmes
d715ac1675 Fix inability to start on Windows from a path that contains non-Latin text
Somewhat frustratingly, I only discovered this could be resolved with a
manifest change after first wasting hours trying to detect unicode text
in the NSIS installer, and warning the user that they'd need to change
their system locale if unicode text was found. Also tried adjusting the
locale with setlocale() on program startup, which did not help, perhaps
because it needs to be set before libc init.
2023-05-20 10:49:00 +10:00
Damien Elmes
c49ea40ddf Automatically add NSIS plugins as part of the bundle process
Avoids the need to manually copy them into place
2023-05-20 10:49:00 +10:00
Damien Elmes
c520b59311 Support prop queries in filtered decks
https://forums.ankiweb.net/t/phantom-overdue-reviews/30300
2023-05-20 10:49:00 +10:00
Damien Elmes
716db5ee6b Update translations 2023-05-18 18:08:56 +10:00
Ren Tatsumoto
a378e2923e
Allow the user to configure answer keys (#2502)
* add methods that allow the user to configure answer keys

* allow editing answer buttons in preferences

* import optional

* Give the layout referenced in code a clearer name (dae)

* Update placeholder text and make it translatable (dae)

The other items in the preferences screen don't have tooltips, so
placeholder text may be easier for the user to discover than a tooltip.
2023-05-18 17:47:51 +10:00
Martin Grottenthaler
f4f5844ca3
Implement non elevated installer (#2497)
* changed install location and elevation

* change registry keys to HKCU
change context to current user

* filetype associations non elevated

* added an "upgrade" from elevated to non elevated

* added comment to clarify bug

* removed commented out registry entries

* Update CONTRIBUTORS

add mgrottenthaler to contributors

* change upgrade routine to manual uninstall

* added suggestion
2023-05-18 17:06:38 +10:00
Hikaru Y
2fa63af9c2
Upgrade Svelte (#2506)
* Bump Svelte version

* Ignore Svelte a11y warnings
2023-05-18 17:04:58 +10:00
Damien Elmes
61555fef7d Hack around color setting failure in Qt6.5
Closes #2505
2023-05-18 16:36:16 +10:00
Damien Elmes
40a68afad3 Add the ability to search for custom data properties
Closes #2491
2023-05-18 15:54:01 +10:00
Damien Elmes
f1ddfb7af6 Fix inability to import csv when path contains single quote
https://forums.ankiweb.net/t/windows-10-2-1-62-qt6-blank-import-window/30231
2023-05-18 11:50:34 +10:00
Damien Elmes
a19cb75768 Fix broken media importing in non-legacy apkg path
- Ensure our unit tests cover the non-legacy path, and check file
contents and not just existence.
- Pass `compressed` into copy_and_ensure_sha1_set(). We can't just
test for self.sha1.is_none(), as that fails in the case where an existing
media file was found in the legacy path.

https://forums.ankiweb.net/t/anki-media-file-corruption-when-exporting-png-files/30315
2023-05-18 11:33:01 +10:00
Damien Elmes
63fd70ad34 Add a .with_desktop_media_paths() helper 2023-05-18 11:02:02 +10:00
Damien Elmes
cff613bfef Display a more informative message when attempting media op without folder 2023-05-18 10:48:25 +10:00
Damien Elmes
19b08eb280 Store separate state/geometry for each Qt minor version
Quite a few users have been experiencing crashes recently that were
resolved by resetting their window positions/states. I presume this is
related to Qt updates, as there have been previous instances where old
state caused glitchy behaviour or crashes after a Qt upgrade.

The browser headers are now also reset when resetting window positions
in the preferences.
2023-05-18 10:04:30 +10:00
Damien Elmes
4e65793966 Remove offset workaround in restoreGeom()
Way back in Qt4, there was an issue where (some?) windows would open
at a different location to where they were previously open. I've tested
the primary windows in Qt 5.14 on macOS, and the issue no longer seems
to exist, so this code is no longer useful.

The qtmajor > 5 check was a mistake introduced in 70dbd06be3ff56f13b9efe7c886c2a6c4f873ce9;
it was intended to limit the code to Qt 5.

A quick grep of an add-on snapshot indicates there are no add-ons that
were using the offset param, so it has been removed.
2023-05-18 10:04:30 +10:00
Austin S
eebd143a9f
Fix null error on window resizing (#2501)
* Fix null error on window resizing

* Be more specific in type cast (dae)
2023-05-17 16:52:38 +10:00
Damien Elmes
c54b897b4f Don't disable animations on card templates when reduce motion is on
We may wish to revisit this decision in the future, once we no longer
enable reduce motion by default to prevent the toolbar redraw bugs.

Closes #2499
2023-05-17 16:45:57 +10:00
Damien Elmes
25cd181c9f Show an error pop-up when csv import screen fails to load
https://forums.ankiweb.net/t/windows-10-2-1-62-qt6-blank-import-window/30231
2023-05-15 15:32:38 +10:00
Damien Elmes
5f40fd6083 Add fractional scaling workaround 2023-05-15 14:34:01 +10:00
Damien Elmes
accb20c3e9 Update translations 2023-05-15 13:51:10 +10:00
Damien Elmes
75f8372b81 Bump version 2023-05-15 13:50:55 +10:00
Damien Elmes
802f10ea13 Allow anki-console.bat to be run from any folder
https://github.com/ankitects/anki-manual/pull/137
2023-05-12 16:58:58 +10:00
Damien Elmes
28021b76af Rerun eslint rules when tsconfig changes 2023-05-11 15:13:49 +10:00
Damien Elmes
6f650dd7df Add some missing tooltips
https://forums.ankiweb.net/t/two-editor-buttons-do-not-have-tooltips/30203
2023-05-11 15:10:27 +10:00
Damien Elmes
a7578245d0 Add es2019.string back to tsconfig
Our eslint tests were breaking, as it appears that later years do not
include APIs added in previous years, like trimStart()
2023-05-11 15:10:27 +10:00
Damien Elmes
4a7c5b74c1 Log mpv invocation failure for debugging
https://forums.ankiweb.net/t/i-received-this-error-while-reviewing-a-deck-with-cards-that-had-video-mp4/30105
2023-05-11 14:47:23 +10:00
Hikaru Y
5f02765bb1
Fix custom font preloading sometimes not working (#2493)
It didn't work if both a reference to an external style sheet and
a description of a custom font are present in a style element.
2023-05-11 14:10:29 +10:00
Damien Elmes
3999c99af7 Fix a panic when user sets a huge learning step 2023-05-11 09:10:22 +10:00
Damien Elmes
7ff75ca936 Automatically fetch win32 audio tools in .\run.bat 2023-05-11 09:10:22 +10:00
Hikaru Y
779ca57660
Refactor CSS/image preloading; implement custom font preloading (#2356)
* Refactor CSS preloading

- Rename css.ts to preload.ts
- Rename type/function names
- Automatically remove style/link element on load/error event

* Refactor image preloading

- Reuse template element
- Change timeout value from 100ms to 200ms, as it often takes more than
  100ms to load even a single small image on a low-spec machine
- Refactor preloadAnswerImages():
  - Use 'new Image()' instead of <link rel=preload>
  - Stop calculating images that only appear on the answer side as
    cached images are resolved immediately

* Update tsconfig.json

es2020.string -> String.matchAll()
es2018.regexp -> RegExprMatchArray.groups

* Implement custom font preloading

Font files for some languages such as Chinese and Japanese can be as
large as 20MB, so we set the timeout value to 800ms for font preloading.
2023-05-10 13:26:02 +10:00
Damien Elmes
f356f177a2 Fix unreadable bootstrap buttons when hovering
Closes #2297
2023-05-09 17:04:12 +10:00
Damien Elmes
4325c05fe6 Update translations 2023-05-09 16:45:27 +10:00
XeR
0d58a04596
Fix sync client ignoring directories (#2490)
* Fix sync client ignoring directories

Current implementation of the sync client does not properly send requests to a
self-hosted sync server if the URL has directories.

If the self-hosted sync URL is `https://example.org/foo/bar/`, Anki is expected
to send requests to `https://example.org/foo/bar/sync/hostKey`. Instead, it will
discard the directories and wrongly send requests to
`https://example.org/sync/hostKey`.

Fixes: e5d5d1d ("Fix panic with invalid sync server URL with port")

* Add XeR to contributors
2023-05-08 11:40:57 +10:00
Ren Tatsumoto
fef2844d45
Enchance reviewer with new settings (#2489)
* add grading shortcuts

* add a new setting: grade with space

* new key: u for undo

* run ./ninja format

* rename property

* rename translation

* run ./ninja format
2023-05-08 11:04:18 +10:00