Commit graph

138 commits

Author SHA1 Message Date
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
Damien Elmes
15e4b64162 new approach to hideQ
Instead of a separate option to hide question, embed the question into the
answer format by default. Users who don't want to see the question can remove
the question fields, and users who want a separator between the question and
answer (or not) can control it in HTML now.

Also, remove obsolete field CSS, and don't accidentally chomp a character on
upgrade.
2011-11-18 05:15:15 +09:00
Damien Elmes
770f402905 don't allow template removal to orphan facts 2011-11-17 23:09:18 +09:00
Damien Elmes
a51307701d del -> rem for consistency 2011-11-17 22:55:03 +09:00
Damien Elmes
01b297babc fix model gencards 2011-11-08 22:32:02 +09:00
Damien Elmes
795cdd7d3f remove the concept of non-active templates
The old template handling was too complicated, and generated frequent
questions on the forums. By dropping non-active templates we can do away with
the generate cards function, and advanced users can simulate the old behaviour
by using conditional field templates.
2011-11-08 18:06:19 +09:00
Damien Elmes
f8eefe5ee1 model deleting should use the string id 2011-11-07 18:38:48 +09:00
Damien Elmes
aef7626557 add fieldNames(); fix scmhash() 2011-11-07 14:27:15 +09:00
Damien Elmes
cbdb283b20 refactor model copying 2011-10-31 11:34:03 +09:00
Damien Elmes
ed7367d67f fix reporting of latex errors; catch some bad commands 2011-10-29 15:12:57 +09:00
Damien Elmes
3068e79b42 Merge branch 'new' 2011-10-22 18:39:08 +09:00
Damien Elmes
b31bd5c091 vacuum after import; make sure models.current() always returns 2011-10-22 07:39:13 +09:00
Damien Elmes
852189808f catch attempts to save a fact that deletes a cloze card 2011-10-22 03:10:34 +09:00
Damien Elmes
a4e8eb8b74 cache required fields, drop emptyAns
For importing and the deck creation wizard, we need to be able to generate
thousands of cards efficiently. So instead of requiring the creation of a fact
and rendering it, we cache the required fields and cloze references in the
model.

Also, emptyAns is dropped, as people can achieve the same behaviour by adding
the required answer fields as conditional to the question.

Todo: refactor genCards() to work in bulk, handle cloze edits intelligently
(prompt to delete invalid references, create new cards as necessary)
2011-10-22 02:28:57 +09:00
Damien Elmes
83f8ef45ff anki2 importing and reorganize import code 2011-10-21 07:36:44 +09:00
Damien Elmes
2b34d8a948 more group/sched refactoring
- keep track of rep/time counts per group, instead of just at the top level
- sort by due after retrieving learn cards
- ensure activeGroups is sorted alphabetically
- ensure new cards come in alphabetical group order
- ensure queues are refilled when empty
2011-09-23 08:19:22 +09:00
Damien Elmes
ee767ff132 refactor to allow group deletions without schema mod
because group deletions are likely to be a semi-common operation (esp. for new users trying out shared material), deleting groups will no longer cause a full sync. in order to avoid syncing issues, we now allow cards/facts/etc to point to an invalid group, and in that case, we just treat them like they're in the default group
2011-09-15 01:37:30 +09:00