mirror of
https://github.com/ankitects/anki.git
synced 2026-09-10 06:20:47 -04:00
## Linked issue (required) Fixes #5516 ## Summary / motivation (required) Make the existing FSRS parameter unlock timing API available before the parameter editor is mounted, and retain the host's chosen timeout when FSRS is disabled and enabled again. Register the API and store its timeout in the component's module script; keep click tracking local to each editor instance. ## Steps to reproduce (required, use N/A if not applicable) 1. Open the deck-options page with FSRS disabled. 2. In that page's JavaScript console, run `anki.setParameterUnlockClickTimeoutMs(1000)`. 3. Before this fix, the call throws `TypeError: anki.setParameterUnlockClickTimeoutMs is not a function`. ## How to test (required) ### Checklist (minimum) - [x] I ran `just check` locally. - [x] I added a browser regression for the changed behavior. ### Details - The regression failed on the original implementation at the pre-mount setter call and passes with the fix. - It checks configuration before the first mount, retention across remounts, updates while absent and present, the three-click gate, the default timeout, and reset after page reload. Playwright's clock controls the click intervals. - `just test-ts`: 61 tests passed. - `just test-e2e`: 27 tests passed, using the repository's disposable Anki harness. - `just check`: passed, including 572 Rust tests and the Python, formatting, lint, and type checks. - The Qt checks emitted an audio-thread warning (`mw` was `None` in `qt/aqt/sound.py`); all 93 Qt tests passed and `just check` exited successfully. ## Before / after behavior (optional) Before: the API exists only after the editor mounts, and mounting a new editor resets the timeout to 500 ms. After: the API exists when the deck-options JavaScript loads, and the selected timeout lasts for the page's lifetime. ## Risk / compatibility / migration (optional) Existing API names, the 500 ms default, and the three-click requirement are preserved. Click counts and pending timers remain local to each editor. No stored data or scheduling behavior changes. ## UI evidence (required for visual changes; otherwise N/A) N/A. ## Scope - [x] This PR is focused on one change. Developed with assistance from Codex.
338 lines
14 KiB
Plaintext
338 lines
14 KiB
Plaintext
If you have made changes to Anki's AGPL code, you are welcome to distribute
|
|
the changed code under the AGPL license.
|
|
|
|
If you would like to contribute your code back to the official release, we ask
|
|
that you license your contributions under the BSD 3 clause license. Portions
|
|
of the code are also used in AnkiWeb and AnkiMobile, and accepting
|
|
contributions under an AGPL license would mean we could no longer use the code
|
|
we have written in those projects.
|
|
|
|
In your first pull request, please add your name below. By adding your name to
|
|
this file, you assert that any code you contribute to the Anki project is
|
|
licensed under the BSD 3 clause license. If any pull request you make contains
|
|
code that you don't own the copyright to, you agree to make that clear when
|
|
submitting the request.
|
|
|
|
When submitting a pull request, GitHub Actions will check that the Git email you
|
|
are submitting from matches the one you used to edit this file. A common issue
|
|
is adding yourself to this file using the username on your computer, but then
|
|
using GitHub to rebase or edit a pull request online. This will result in your
|
|
Git email becoming something like user@noreply.github.com. To prevent the
|
|
automatic check from failing, you can edit this file again using GitHub's online
|
|
editor, making a trivial edit like adding a space after your name, and then pull
|
|
requests will work regardless of whether you create them using your computer or
|
|
GitHub's online interface.
|
|
|
|
For users who previously confirmed the license of their contributions on the
|
|
support site, it would be great if you could add your name below as well.
|
|
|
|
********************
|
|
|
|
AMBOSS MD Inc. <https://www.amboss.com/>
|
|
Aristotelis P. <https://glutanimate.com/contact>
|
|
Erez Volk <erez.volk@gmail.com>
|
|
zjosua <zjosua@hotmail.com>
|
|
Yngve Hoiseth <yngve@hoiseth.net>
|
|
Arthur Milchior <arthur@milchior.fr>
|
|
Ijgnd
|
|
Yoonchae Lee <bluegreenmagick@gmail.com>
|
|
Evandro Coan <github.com/evandrocoan>
|
|
Alan Du <alanhdu@gmail.com>
|
|
Yuchen Lei <lyc@xuming.studio>
|
|
Henry Tang <hktang@ualberta.ca>
|
|
Simone Gaiarin <simgunz@gmail.com>
|
|
Rai (Michal Pokorny) <agentydragon@gmail.com>
|
|
Zeno Gantner <zeno.gantner@gmail.com>
|
|
Henrik Giesel <hengiesel@gmail.com>
|
|
Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com>
|
|
Sander Santema <github.com/sandersantema/>
|
|
Thomas Brownback <https://github.com/brownbat/>
|
|
Andrew Gaul <andrew@gaul.org>
|
|
kenden
|
|
Emil Hamrin <github.com/e-hamrin>
|
|
Nickolay Yudin <kelciour@gmail.com>
|
|
neitrinoweb <github.com/neitrinoweb/>
|
|
Andreas Reis <github.com/nwwt>
|
|
Matt Krump <github.com/mkrump>
|
|
Alexander Presnyakov <flagist0@gmail.com>
|
|
Abdo <github.com/abdnh>
|
|
aplaice <plaice.adam+github@gmail.com>
|
|
phwoo <github.com/phwoo>
|
|
Soren Bjornstad <anki@sorenbjornstad.com>
|
|
Aleksa Sarai <cyphar@cyphar.com>
|
|
Jakub Kaczmarzyk <jakub.kaczmarzyk@gmail.com>
|
|
Akshara Balachandra <akshara.bala.18@gmail.com>
|
|
lukkea <github.com/lukkea/>
|
|
David Allison <davidallisongithub@gmail.com>
|
|
David Allison <62114487+david-allison@users.noreply.github.com>
|
|
Tsung-Han Yu <johan456789@gmail.com>
|
|
Piotr Kubowicz <piotr.kubowicz@gmail.com>
|
|
RumovZ <gp5glkw78@relay.firefox.com>
|
|
Cecini <github.com/cecini>
|
|
Krish Shah <github.com/k12ish>
|
|
ianki <iankigit@gmail.com>
|
|
rye761 <ryebread761@gmail.com>
|
|
Guillem Palau Salvà <guillempalausalva@gmail.com>
|
|
Meredith Derecho <meredithderecho@gmail.com>
|
|
Daniel Wallgren <github.com/wallgrenen>
|
|
Kerrick Staley <kerrick@kerrickstaley.com>
|
|
Maksim Abramchuk <maximabramchuck@gmail.com>
|
|
Benjamin Kulnik <benjamin.kulnik@student.tuwien.ac.at>
|
|
Shaun Ren <shaun.ren@linux.com>
|
|
Ryan Greenblatt <greenblattryan@gmail.com>
|
|
Matthias Metelka <github.com/kleinerpirat>
|
|
qubist-pixel-ux <github.com/qubist-pixel-ux>
|
|
cherryblossom <github.com/cherryblossom000>
|
|
Hikaru Yoshiga <github.com/hikaru-y/>
|
|
Thore Tyborski <github.com/ThoreBor>
|
|
Alexander Giorev <alex.giorev@gmail.com>
|
|
Ren Tatsumoto <tatsu@autistici.org>
|
|
lolilolicon <lolilolicon@gmail.com>
|
|
Gesa Stupperich <gesa.stupperich@gmail.com>
|
|
git9527 <github.com/git9527>
|
|
Vova Selin <vselin12@gmail.com>
|
|
qxo <49526356@qq.com>
|
|
Spooghetti420 <github.com/spooghetti420>
|
|
Danish Prakash <github.com/danishprakash>
|
|
Araceli Yanez <github.com/aracelix>
|
|
Sam Bradshaw <samjr.bradshaw@gmail.com>
|
|
gnnoh <gerongfenh@gmail.com>
|
|
Sachin Govind <sachin.govind.too@gmail.com>
|
|
Bruce Harris <github.com/bruceharris>
|
|
Patric Cunha <patricc@agap2.pt>
|
|
Brayan Oliveira <69634269+BrayanDSO@users.noreply.github.com>
|
|
Luka Warren <github.com/lukawarren>
|
|
wisherhxl <wisherhxl@gmail.com>
|
|
dobefore <1432338032@qq.com>
|
|
Bart Louwers <bart.git@emeel.net>
|
|
Sam Penny <github.com/sam1penny>
|
|
Yutsuten <mateus.etto@gmail.com>
|
|
Zoom <zoomrmc+git@gmail.com>
|
|
TRIAEIOU <github.com/TRIAEIOU>
|
|
Stefan Kangas <stefankangas@gmail.com>
|
|
Fabricio Duarte <fabricio.duarte.jr@gmail.com>
|
|
Mani <github.com/krmanik>
|
|
Kaben Nanlohy <kaben.nanlohy@gmail.com>
|
|
Tobias Predel <tobias.predel@gmail.com>
|
|
Daniel Tang <danielzgtg.opensource@gmail.com>
|
|
Jack Pearson <github.com/jrpear>
|
|
yellowjello <github.com/yellowjello>
|
|
Ingemar Berg <github.com/ingemarberg>
|
|
Ben Kerman <ben@kermanic.org>
|
|
Euan Kemp <euank@euank.com>
|
|
Kieran Black <kieranlblack@gmail.com>
|
|
XeR <github.com/XeR>
|
|
mgrottenthaler <github.com/mgrottenthaler>
|
|
Austin Siew <github.com/Aquafina-water-bottle>
|
|
Joel Koen <mail@joelkoen.com>
|
|
Christopher Woggon <christopher.woggon@gmail.com>
|
|
Kavel Rao <github.com/kavelrao>
|
|
Ben Yip <github.com/bennyyip>
|
|
mmjang <752515918@qq.com>
|
|
shunlog <github.com/shunlog>
|
|
3ter <github.com/3ter>
|
|
Derek Dang <github.com/derekdang/>
|
|
Luc Mcgrady <github.com/Luc-Mcgrady>
|
|
Kehinde Adeleke <adelekekehinde06@gmail.com>
|
|
Marko Juhanne <github.com/mjuhanne>
|
|
Gabriel Heinatz <anorot@gmail.com>
|
|
Monty Evans <montyevans@gmail.com>
|
|
Nil Admirari <https://github.com/nihil-admirari>
|
|
Michael Winkworth <github.com/SteelColossus>
|
|
Mateusz Wojewoda <kawa1.11@o2.pl>
|
|
Jarrett Ye <jarrett.ye@outlook.com>
|
|
Sam Waechter <github.com/swektr>
|
|
Michael Eliachevitch <m.eliachevitch@posteo.de>
|
|
Carlo Quick <https://github.com/CarloQuick>
|
|
Dominique Martinet <asmadeus@codewreck.org>
|
|
chandraiyengar <github.com/chandraiyengar>
|
|
user1823 <92206575+user1823@users.noreply.github.com>
|
|
Gustaf Carefall <https://github.com/Gustaf-C>
|
|
virinci <github.com/virinci>
|
|
snowtimeglass <snowtimeglass@gmail.com>
|
|
brishtibheja <136738526+brishtibheja@users.noreply.github.com>
|
|
Ben Olson <github.com/grepgrok>
|
|
Akash Reddy <akashreddy2003@gmail.com>
|
|
Lucio Sauer <watermanpaint@posteo.net>
|
|
Gustavo Sales <gustavosmendes14@gmail.com>
|
|
Shawn M Moore <https://github.com/sartak>
|
|
Marko Sisovic <msisovic13@gmail.com>
|
|
Viktor Ricci <ricci@primateer.de>
|
|
Harvey Randall <harveyrandall2001@gmail.com>
|
|
Pedro Lameiras <pedrolameiras@tecnico.ulisboa.pt>
|
|
Kai Knoblich <kai@FreeBSD.org>
|
|
Lucas Scharenbroch <lucasscharenbroch@gmail.com>
|
|
Antonio Cavallo <a.cavallo@cavallinux.eu>
|
|
Han Yeong-woo <han@yeongwoo.dev>
|
|
Jean Khawand <jk@jeankhawand.com>
|
|
Pedro Schreiber <schreiber.mmb@gmail.com>
|
|
Foxy_null <https://github.com/Foxy-null>
|
|
Arbyste <arbyste@outlook.com>
|
|
Vasll <github.com/vasll>
|
|
laalsaas <laalsaas@systemli.org>
|
|
ijqq <ijqq@protonmail.ch>
|
|
AntoineQ1 <https://github.com/AntoineQ1>
|
|
jthulhu <https://github.com/jthulhu>
|
|
Escape0707 <tothesong@gmail.com>
|
|
Loudwig <https://github.com/Loudwig>
|
|
Wu Yi-Wei <https://github.com/Ianwu0812>
|
|
RRomeroJr <117.rromero@gmail.com>
|
|
Xidorn Quan <me@upsuper.org>
|
|
Alexander Bocken <alexander@bocken.org>
|
|
James Elmore <email@jameselmore.org>
|
|
Ian Samir Yep Manzano <https://github.com/isym444>
|
|
David Culley <6276049+davidculley@users.noreply.github.com>
|
|
Rastislav Kish <rastislav.kish@protonmail.com>
|
|
jake <jake@sharnoth.com>
|
|
Expertium <https://github.com/Expertium>
|
|
Christian Donat <https://github.com/cdonat2>
|
|
Asuka Minato <i@asukaminato.eu.org>
|
|
Dillon Baldwin <https://github.com/DillBal>
|
|
Voczi <https://github.com/voczi>
|
|
Ben Nguyen <105088397+bpnguyen107@users.noreply.github.com>
|
|
Themis Demetriades <themis100@outlook.com>
|
|
Luke Bartholomew <lukesbart@icloud.com>
|
|
Gregory Abrasaldo <degeemon@gmail.com>
|
|
Taylor Obyen <162023405+taylorobyen@users.noreply.github.com>
|
|
Kris Cherven <krischerven@gmail.com>
|
|
twwn <github.com/twwn>
|
|
Cy Pokhrel <cy@cy7.sh>
|
|
Park Hyunwoo <phu54321@naver.com>
|
|
Tomas Fabrizio Orsi <torsi@fi.uba.ar>
|
|
Dongjin Ouyang <1113117424@qq.com>
|
|
Sawan Sunar <sawansunar24072002@gmail.com>
|
|
hideo aoyama <https://github.com/boukendesho>
|
|
Ross Brown <rbrownwsws@googlemail.com>
|
|
🦙 <gh@siid.sh>
|
|
Lukas Sommer <sommerluk@gmail.com>
|
|
Luca Auer <lolle2000.la@gmail.com>
|
|
Niclas Heinz <nheinz@hpost.net>
|
|
Omar Kohl <omarkohl@posteo.net>
|
|
David Elizalde <david.elizalde.r.a@gmail.com>
|
|
beyondcompute <beyondcompute@gmail.com>
|
|
Yuki <https://github.com/YukiNagat0>
|
|
wackbyte <wackbyte@protonmail.com>
|
|
GithubAnon0000 <GithubAnon0000@users.noreply.github.com>
|
|
Mike Hardy <github@mikehardy.net>
|
|
Danika_Dakika <https://github.com/Danika-Dakika>
|
|
Mumtaz Hajjo Alrifai <mumtazrifai@protonmail.com>
|
|
Thomas Graves <fate@hey.com>
|
|
Jakub Fidler <jakub.fidler@protonmail.com>
|
|
Valerie Enfys <val@unidentified.systems>
|
|
Julien Chol <https://github.com/chel-ou>
|
|
ikkz <ylei.mk@gmail.com>
|
|
derivativeoflog7 <https://github.com/derivativeoflog7>
|
|
rreemmii-dev <https://github.com/rreemmii-dev>
|
|
babofitos <https://github.com/babofitos>
|
|
Jonathan Schoreels <https://github.com/JSchoreels>
|
|
JL710
|
|
Matt Brubeck <mbrubeck@limpet.net>
|
|
Yaoliang Chen <yaoliang.ch@gmail.com>
|
|
KolbyML <https://github.com/KolbyML>
|
|
Adnane Taghi <dev@soleuniverse.me>
|
|
Spiritual Father <https://github.com/spiritualfather>
|
|
Emmanuel Ferdman <https://github.com/emmanuel-ferdman>
|
|
Sunong2008 <https://github.com/Sunrongguo2008>
|
|
Marvin Kopf <marvinkopf@outlook.com>
|
|
Kevin Nakamura <grinkers@grinkers.net>
|
|
Bradley Szoke <bradleyszoke@gmail.com>
|
|
jcznk <https://github.com/jcznk>
|
|
Thomas Rixen <thomas.rixen@student.uclouvain.be>
|
|
Siyuan Mattuwu Yan <syan4@ualberta.ca>
|
|
Lee Doughty <32392044+leedoughty@users.noreply.github.com>
|
|
memchr <memchr@proton.me>
|
|
Max Romanowski <maxr777@proton.me>
|
|
Aldlss <ayaldlss@gmail.com>
|
|
Hanna Nilsén <hanni614@student.liu.se>
|
|
Elias Johansson Lara <elias.johanssonlara@gmail.com>
|
|
Toby Penner <tobypenner01@gmail.com>
|
|
Danilo Spillebeen <spillebeendanilo@gmail.com>
|
|
Matbe766 <matildabergstrom01@gmail.com>
|
|
Amanda Sternberg <mandis.sternberg@gmail.com>
|
|
arold0 <arold0@icloud.com>
|
|
nav1s <nav1s@proton.me>
|
|
Ranjit Odedra <ranjitodedra.dev@gmail.com>
|
|
Eltaurus <https://github.com/Eltaurus-Lt>
|
|
jariji
|
|
Francisco Esteva <fr.esteva@duocuc.cl>
|
|
Daniela Silva Rocha <daniela.silvarocha@outlook.com>
|
|
MoamenAbdelsattar <68331166+MoamenAbdelsattar@users.noreply.github.com>
|
|
Junia Mannervik <junia.mannervik@gmail.com>
|
|
Emma Plante <emmaplante04@gmail.com>
|
|
SelfishPig <https://github.com/SelfishPig>
|
|
Miguel Gazquez <miguel.gazquez82@gmail.com>
|
|
defkorean <https://github.com/defkorean>
|
|
Michael Lappas <https://github.com/michaellappas>
|
|
Brett Schwartz <brettschwartz871@gmail.com>
|
|
Lovro Boban <lovro.boban@hotmail.com>
|
|
Yuuki Gabriele Patriarca <yuukigpatriarca@gmail.com>
|
|
SecretX <https://github.com/SecretX33>
|
|
Tim Arnold <tim-arnold@outlook.de>
|
|
CYPHER0041 <48846390+CYPHER0041@users.noreply.github.com>
|
|
Oli <https://github.com/oliolioli>
|
|
DaedalusIndigo <260538003+DaedalusIndigo@users.noreply.github.com>
|
|
Daniel Pechersky <danny.pechersky@gmail.com>
|
|
fernandolins <1887601+fernandolins@users.noreply.github.com>
|
|
Helmut Carter <https://github.com/helmutcarter>
|
|
barisayyildiz <99ayyldzbaris99@gmail.com>
|
|
Christos Longros <chris.longros@gmail.com>
|
|
Maskady <florent.tout@gmail.com>
|
|
Jeremy Fleischman <jeremyfleischman@gmail.com>
|
|
Marcus Lo <https://github.com/marcusl07>
|
|
Jeremy Fleischman <me@jfly.fyi>
|
|
Tim Gatzke <post@tim-gatzke.de>
|
|
Chirag Jagga <chiragjagga26@gmail.com>
|
|
Tim Gatzke <post@tim-gatzke.de>
|
|
David Sauerwein <david@sauerwein.xyz>
|
|
roostwp07 <https://github.com/roostwp07>
|
|
Konstantin Tutsch <mail@konstantintutsch.com>
|
|
RedPine404 <https://github.com/RedPine404>
|
|
krMaynard <55507135+krMaynard@users.noreply.github.com>
|
|
Niko Savola <nikomsavola@gmail.com>
|
|
iDavi <odavi20527@gmail.com>
|
|
Ian E <ian@ankihub.net>
|
|
Qaisar Sulaiman <qaisarsulaiman101@gmail.com>
|
|
Ashish Yadav <48384865+criticalAY@users.noreply.github.com>
|
|
Timothy Lee <timothyl@berkeley.edu>
|
|
DespicableGoose <68354378+DespicableGoose@users.noreply.github.com>
|
|
Han Lua <72375847+xiaohan484@users.noreply.github.com>
|
|
Andreas U. Schmidhauser <github.com/schmidhauser>
|
|
Peter Szilvasi <peti.szilvasi95@gmail.com>
|
|
JaksonSouza <jaksonsouza.dev@gmail.com>
|
|
danny900714 <https://github.com/danny900714>
|
|
Carlos Mendez <carlos12mcg@gmail.com>
|
|
zaveshaa <zaveshaa@gmail.com>
|
|
zaveshaa <127344512+zaveshaa@users.noreply.github.com>
|
|
James Liu <https://github.com/jamesliuai>
|
|
Caleb Meadows
|
|
********************
|
|
|
|
The text of the 3 clause BSD license follows:
|
|
|
|
Contributions copyright the above contributors, 2010-Present.
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
1. Redistributions of source code must retain the above copyright notice, this
|
|
list of conditions and the following disclaimer.
|
|
|
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
this list of conditions and the following disclaimer in the documentation
|
|
and/or other materials provided with the distribution.
|
|
|
|
3. Neither the name of the copyright holder nor the names of its contributors
|
|
may be used to endorse or promote products derived from this software without
|
|
specific prior written permission.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|