Commit graph

154 commits

Author SHA1 Message Date
Damien Elmes
eda32b4fcc model byName() should be case sensitive 2012-11-07 04:19:23 +09:00
Damien Elmes
3ffe47f5d6 improve handling of divergent models when importing
- instead of maintaining a list of model versions on the model which could get
  lost in a sync, we simply increment mid by one until we find a compatible
  schema or empty slot
- same approach for guids, so that reimports of divergent material won't cause
  extra duplicates
2012-11-02 06:34:28 +09:00
Damien Elmes
bd1c6d4395 more robust anki1 upgrading & anki2 importing
- base the 2.0 model id on the 1.2 one so we don't get new models each time we
  reimport the file
- when determining if we can reuse an existing note, it must have the same
  model id, and the model must have the same schema
- make sure we check templates when determining schema
- if schema has diverged, note needs new guid
2012-10-27 20:55:08 +09:00
Damien Elmes
2ee3ec8b7a delete notes that are missing their model 2012-09-09 06:06:55 +09:00
Damien Elmes
9d153313e5 make sure to update sort field when fields moved 2012-07-19 15:16:08 +09:00
Damien Elmes
57a9668350 fix cloze->basic model changing 2012-07-05 05:39:25 +09:00
Damien Elmes
4b01c3c82c allow } inside cloze deletions 2012-06-13 00:46:59 +09:00
Damien Elmes
7c67e292db fix empty cloze check 2012-05-26 17:09:56 +09:00
Damien Elmes
3382af2877 allow empty clozes
instead of considering a cloze note with no clozes marked as invalid, treat it
as the first card and show a warning during review
2012-05-25 09:12:19 +09:00
Damien Elmes
b7d9935b99 add bq/bafmt on upgrade 2012-05-25 08:40:08 +09:00
Damien Elmes
225196f7d1 run hook on deck/model creation 2012-05-24 18:20:16 +09:00
Damien Elmes
bc2112a127 fix availOrds() when conditional expressions have extra text 2012-05-23 08:03:03 +09:00
Damien Elmes
233bf555b4 custom browser q/a columns 2012-05-22 15:37:15 +09:00
Damien Elmes
8f89ea57f5 FrontSide on upgrade, allNames() in models 2012-05-21 14:32:43 +09:00
Damien Elmes
bc220e6f35 per-deck default model 2012-05-21 11:25:48 +09:00
Damien Elmes
1a80ffa8a2 shared css 2012-05-06 20:04:28 +09:00
Damien Elmes
aedf88ee6d don't allow {{c0:: 2012-05-06 18:08:15 +09:00
ospalh
311897a393 match the whole {{xx:yy]] field so we can delete it 2012-05-04 12:13:47 +02:00
Damien Elmes
3173073cff make sure to escape fields when renaming
thanks to ospalh for the heads up
2012-05-01 15:33:54 +09:00
Damien Elmes
461e240d53 allow python-bundled json 2012-04-28 17:41:56 +09:00
Damien Elmes
12a80ef9c2 handle cloze note types in changeModel() 2012-04-25 13:25:19 +09:00
Damien Elmes
62b44df78e when renaming a field, support cloze: as well 2012-04-22 08:01:17 +09:00
Damien Elmes
9fab2834da cloze generation needs to use provided fields, not field 0 2012-04-21 07:25:35 +09:00
Damien Elmes
7c51a7bb16 update sort field when field moved 2012-04-21 06:40:20 +09:00
Damien Elmes
c2df347909 catch attempt to delete last template 2012-04-20 22:37:31 +09:00
Damien Elmes
a3407020cb split empty card removal into separate report 2012-04-19 11:14:57 +09:00
Damien Elmes
5cbe93b63d more cloze work
- upgrade old decks
- specify the field in the cloze, so the user can have an id in the first
  field
2012-04-19 08:32:19 +09:00
Damien Elmes
41fa9a9896 cloze refactor wip 2012-04-19 07:14:03 +09:00
Damien Elmes
71645aacb5 fix field deletion issues thanks to illforyou 2012-04-08 20:18:46 +09:00
Damien Elmes
51b70a5787 genCards() on model change 2012-03-20 02:46:45 +09:00
Damien Elmes
9e35e4acf2 template and cloze changes
While writing the documentation I realized that the default templates were
somewhat overwhelming. So I've moved the default settings into the card css,
and moved the css into a separate attribute which gets combined with the
question and answer templates.

Also:
- Detect cloze references directly rather than the conditional wrapper
- Add the cloze css to the template
2011-12-17 19:42:30 +09:00
Damien Elmes
619a58216a don't require fields in cloze del model; remove extra brackets in cloze hints 2011-12-17 15:02:15 +09:00
Damien Elmes
3957f07afb add media[] for future use 2011-12-16 10:04:19 +09:00
Damien Elmes
0b96e8a1a9 per-fact empty card deletion, and delete hook 2011-12-11 23:48:24 +09:00
Damien Elmes
8be0e6cccd make sure we add + delete cards after template changes 2011-12-11 23:35:59 +09:00
Damien Elmes
0a279f6a26 remove clozectx, add styling to stdmodels 2011-12-11 02:33:27 +09:00
Damien Elmes
4428c04774 new order is now a deck property 2011-12-10 22:45:44 +09:00
Damien Elmes
451962d4a8 drop the special config for top level decks
New/rev card mixing, collapse time and the timeboxing limit are now a
collection property. I appreciate how it could be useful to have those
settings per top-level deck in some cases, but having some settings inherited
from the top level deck makes for a confusing UI.
2011-12-09 07:55:40 +09:00
Damien Elmes
c0edcae238 fix some sync bugs
- don't send server graves graves back on the next sync
- make sure we update usns of models/tags/decks as well on upload
- don't die when updating decks after current deck deleted
- report counts when sanity check fails
2011-12-06 01:35:54 +09:00
Damien Elmes
9d5357f7a6 after a save, revert to unmodified state; sync tweaks 2011-12-04 14:56:12 +09:00
Damien Elmes
a1693a3691 field operations should mod the schema immediately 2011-11-30 10:57:42 +09:00
Damien Elmes
9dbb0b90d5 fix updateFieldCache() call 2011-11-28 21:30:47 +09:00
Damien Elmes
1235f8362a type answer is now a template replacement 2011-11-28 15:15:38 +09:00
Damien Elmes
ddd890ee75 more fixes for schema being accidentally modified on model add 2011-11-27 13:50:49 +09:00
Damien Elmes
b5c0b1f2c7 drop required/unique field properties
Instead of having required and unique flags for every field, enforce both
requirements on the first field, and neither on the rest. This mirrors the
subject/body format people are used to in note-taking apps. The subject
defines the object being learnt, and the remaining fields represent properties
of that object.

In the past, duplicate checking served two purposes: it quickly notified the
user that they're entering the same fact twice, and it notified the user if
they'd accidentally mistyped a secondary field. The former behaviour is
important for avoiding wasted effort, and so it should be done in real time.
The latter behaviour is not essential however - a typo is not wasted effort,
and it could be fixed in a periodic 'find duplicates' function. Given that
some users ended up with sluggish decks due to the overhead a large number of
facts * a large number of unique fields caused, this seems like a change for
the better.

This also means Anki will let you add notes as long as as the first field has
been filled out. Again, this is not a big deal: Anki is still checking to make
sure one or more cards will be generated, and the user can easily add any
missing fields later.

As a bonus, this change simplifies field configuration somewhat. As the card
layout and field dialogs are a popular point of confusion, the more they can
be simplified, the better.
2011-11-24 22:16:03 +09:00
Damien Elmes
fae153c2af don't mod schema when adding new models 2011-11-24 16:33:40 +09:00
Damien Elmes
f7790275ce groups -> decks 2011-11-23 19:28:09 +09:00
Damien Elmes
279a942642 deck -> collection 2011-11-23 17:47:44 +09:00
Damien Elmes
6e4e8249fb facts -> notes 2011-11-23 12:37:21 +09:00
Damien Elmes
7a5cee1d20 remove remaining CSS; more template properties into div 2011-11-18 08:25:56 +09:00