Commit Graph

16 Commits

Author SHA1 Message Date
Damien Elmes
5e5d35e9c1 change purple flag to orange 2018-11-01 14:58:41 +10:00
Damien Elmes
d02901fb7a delay setting q/a if previous operation is still running
fixes incorrect formatting when undoing previous review then immediately
hitting enter
2017-10-24 17:09:22 +10:00
Damien Elmes
4990b2f8eb mathjax tweaks
- drop support for $$ in favour of separate opening and closing tags
- add shortcuts to add mathjax
- don't highlight any clozes in blue if field contains mathjax chars
2017-09-08 19:20:37 +10:00
Damien Elmes
a96ddfc3fd allow templates and add-ons to hook into reviewer updated/shown
eg

from anki.hooks import addHook

def prepare(q):
    return q + """
<script>
onUpdateHook.push(function () {
    window.scrollTo(0, 2000);
})
</script>"""

addHook('prepareQuestion', prepare)
2017-08-28 14:54:22 +10:00
Damien Elmes
db5d23d9dc catch exceptions when setting HTML
thanks to Alicia for the original solution:
dee4c98e9b
2017-08-17 20:02:28 +10:00
Damien Elmes
4467b7c991 restore marking support
maybe multiple mark types would make sense in the future, but for now
let's stick to what will work in the older clients
2017-08-16 20:30:29 +10:00
Damien Elmes
71101d041a ditch marked tag in favour of card flags
Users can now mark individual cards with one of four different coloured
flags, instead of relying on a tag that applied to the whole note.

- replaced marking functionality in reviewer and browser with new
flag options
- added flag:x search
- marked and leech tags now show in normal tag list in filter screen,
instead of being treated specially
- the other clients will need updating to set and shown the flags, but
flags set in the beta should be preserved by the other clients
2017-08-12 16:08:10 +10:00
Damien Elmes
a882937dd3 fix cloze in mathjax workaround 2017-08-11 21:09:47 +10:00
Damien Elmes
c3415028b0 mathjax and fade improvements
- remove the unnecessary processing delays mathjax defaults to
- use a separate fade time for question and answer
2017-08-10 20:45:42 +10:00
Damien Elmes
4d064e1cba wait for keystrokes and don't reload entire page 2017-08-08 16:07:18 +10:00
Damien Elmes
4c286fa3f7 hack around clozes breaking mathjax 2017-08-06 14:48:30 +10:00
Damien Elmes
68d55239b4 rework fade in code
there were a number of issues with preloading:
- it could result in duplicate IDs in the document
- embedded styles failed to apply, because a preloaded item was
overriding them
- the type answer code needed rewriting to support it

so we're back to something closer to the old approach - a single node
that we fade out, update, and then fade in again. this means there's a
longer delay when revealing mathjax, but should minimize the breakage of
existing notes
2017-08-06 12:01:30 +10:00
Damien Elmes
d6c8c6e272 focus type answer area after it's appeared 2017-07-31 16:34:30 +10:00
Damien Elmes
49e2d82aae fade next card in
- to minimize pop-in of images and mathjax, fade the previous card
out and fade the next card in
- render the answer at the same time as the question so it can be
shown immediately
- move reviewer css to separate file
- remove image preloading code that should no longer be necessary
2017-07-29 14:24:45 +10:00
Damien Elmes
44d0766cc5 fix some js lint 2017-07-28 16:48:49 +10:00
Damien Elmes
7ad6966943 split js code out into separate files, mathjax improvements
- js code that was previously bundled in .py files is now in the
web folder
- add helpers to create links to bundled files, and update
stdHtml() to accept a list of javascript files to include
instead of text
- render MathJax in card layout and preview screens - these should be
updated in the future to update the document dynamically like the
reviewer does
- start media server earlier so it can be used to serve content for
the toolbar, etc
- work around a bug in WebEngine on Windows that could cause the
media server to hang
2017-07-28 16:35:45 +10:00