"Close and lose current input ?" for sticky fields

AnkiWeb addon 1284221829

Warns if closing the Add Card window with changed sticky-field content; incorporated into Anki 2.1.16 and disabled for 2.1.16 and above.
AI-generated summary; may contain mistakes.

card-creationbugfix-workaroundobsolete

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
4 (πŸ‘ 4 Β· πŸ‘Ž 0)
Updated
2019-10-15
Anki versions
<=2.1.15
Description language
en

Maintenance

abandoned

  • Last update or commit was 2251 days before the snapshot (2020-08-02).

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.02.1.152019-10-15
History across monthly snapshots

Loading…

Similar addons

Customize Keyboard Shortcuts

Lets users customize keyboard shortcuts for Anki's main page, editor, review window, and deck browser through the add-on's Config screen.

shortcuts

Rating 263 πŸ‘ 210 Β· πŸ‘Ž 53 ⭐ 73 Anki 23.10~ Updated 2023-11-01

README

"Close and lose current input ?" for sticky fields

This addon has been incorporated in anki 2.1.16. It is thus disabled for version 2.1.16 and above.

Rationale

If you try to close the "add card" window, and you have some content, anki warns you and check whether you really want to cloze the window.

Except that it does not takes into accont content in the sticky fields. Probably because, in this case, the content may comes from the last note, and it's not a problem if you lose it.

I want anki to takes sticky fields into account; if the content changed since the last note, then I want to be warned. Otherwise, no trouble, just close the window.

This is exactly what this add-on does; it warns if there is changed content if the sticky field.

Warning

This add-on is incompatible with add-on 46741504: Allows empty first field during adding and import.

Internal

This add-on change the methods:

  • aqt.addacrds.AddCards.__init__ and calls the previous method
  • aqt.addacrds.AddCards.addNote and calls the previous method
  • aqt.addacrds.AddCards.ifCanClose
  • aqt.editor.Editor.fieldsAreBlank

Version 2.0

None

TODO

Create an add-on mixing this one and 46741504

Links, licence and credits

Key Value
Copyright Arthur Milchior arthur@milchior.fr
Based on Anki code by Damien Elmes anki@ichi2.net
License GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
Source in https://github.com/Arthur-Milchior/anki-Close-and-lose-current-input-for-sticky-fields
Addon number 1284221829