Commit graph

10188 commits

Author SHA1 Message Date
Damien Elmes
4d997fd551 Update hakari and licenses 2023-05-29 17:54:00 +10:00
Damien Elmes
a3747844de Continue with install if old installer fails
User may have manually removed files, or the installation may be corrupt.

https://forums.ankiweb.net/t/installing-anki-when-there-seems-to-be-a-previous-version/30621
2023-05-29 15:07:44 +10:00
Damien Elmes
f5e66a042a percent-encoding -> percent-encoding-iri
Closes #2526
2023-05-29 14:46:02 +10:00
Damien Elmes
d52f9564bc Update translations 2023-05-29 13:36:07 +10:00
Damien Elmes
4075b7ae26 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
f4977cbe92 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
e90701e5f8 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
db4936d87e 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
bbabe956a6 Fix some add-on installation errors not being reported (#2518) 2023-05-25 13:15:11 +10:00
Damien Elmes
a4c50d37f3 Update requests for CVE
CVE-2023-32681
2023-05-24 16:09:15 +10:00
Damien Elmes
091071ed56 Bump version 2023-05-24 16:07:43 +10:00
Damien Elmes
f0a17b51fe 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
ae1e4822c4 Update translations 2023-05-22 14:08:46 +10:00
Ren Tatsumoto
8646cd3583 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
ca67f6e94d 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
db36720006 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
b9c9b0b0d7 Mention enter key
https://github.com/ankitects/anki/pull/2496/
2023-05-22 13:41:33 +10:00
Damien Elmes
782209e3a5 Move answer keys to right of dialog to reduce vertical space 2023-05-20 17:37:55 +10:00
Damien Elmes
dea1bc983a Fix Windows CI
The external file should be read at runtime, not compile time.
2023-05-20 11:20:16 +10:00
Damien Elmes
4dad0b9c41 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
a8a92a18ec 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
9acd90d363 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
cab8121a86 Update translations 2023-05-18 18:08:56 +10:00
Ren Tatsumoto
ff9997b058 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
9db5f577da 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
7829a245b0 Upgrade Svelte (#2506)
* Bump Svelte version

* Ignore Svelte a11y warnings
2023-05-18 17:04:58 +10:00
Damien Elmes
b906e63f8e Hack around color setting failure in Qt6.5
Closes #2505
2023-05-18 16:36:16 +10:00
Damien Elmes
c068b98452 Add the ability to search for custom data properties
Closes #2491
2023-05-18 15:54:01 +10:00
Damien Elmes
f962c19cfa 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
39a28d75f1 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
d5792db475 Add a .with_desktop_media_paths() helper 2023-05-18 11:02:02 +10:00
Damien Elmes
e204222016 Display a more informative message when attempting media op without folder 2023-05-18 10:48:25 +10:00
Damien Elmes
e576baac6d 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
35ea6b8282 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 98a161cec624bbb7e58f57c869741b349d96cc9f;
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
f920602e71 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
7402a6b3d0 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
fd0c4ab496 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
6614457759 Add fractional scaling workaround 2023-05-15 14:34:01 +10:00
Damien Elmes
48bf9babd0 Update translations 2023-05-15 13:51:10 +10:00
Damien Elmes
18c8c7ad02 Bump version 2023-05-15 13:50:55 +10:00
Damien Elmes
6f176f342c 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
63fb62d3e6 Rerun eslint rules when tsconfig changes 2023-05-11 15:13:49 +10:00
Damien Elmes
92192049c0 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
4b90fd94a8 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
9ec4bcbfd2 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
2431bfc3ea 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
635048414c Fix a panic when user sets a huge learning step 2023-05-11 09:10:22 +10:00
Damien Elmes
e6547bb9ab Automatically fetch win32 audio tools in .\run.bat 2023-05-11 09:10:22 +10:00
Hikaru Y
9a7a5a3574 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
f1f1015d5a Fix unreadable bootstrap buttons when hovering
Closes #2297
2023-05-09 17:04:12 +10:00