Commit Graph

1338 Commits

Author SHA1 Message Date
Damien Elmes
6c765d7302 remove toolbar in browser in favour of menu items 2017-08-11 14:40:51 +10:00
Damien Elmes
1c88315e86 bump version 2017-08-10 21:51:46 +10:00
Damien Elmes
55b782581d global reviewer override, fix fading in previewer/clayout
you can use the debug console to define custom html/css/js to be added
to the bottom of the reviewer on all note types, so to increase the fade
time on the question you'd use

mw.col.conf["reviewExtra"]="<script>qFade=500;</script>"
mw.col.setMod()

also make sure the fading for question/answer is used correctly in
previewer, and use answer fading in clayout to speed it up
2017-08-10 21:39:04 +10:00
Damien Elmes
85d4511766 hide sound tags in preview screen 2017-08-10 21:11:38 +10:00
Damien Elmes
94cf132918 make sure exporting ignores subfolders 2017-08-10 21:06:41 +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
9af28b7159 proper fix for preview window's 'please select 1 card' message
setting self.card to None caused the following:

https://anki.tenderapp.com/discussions/beta-testing/661-anki-210-beta-7#comment_43180378
2017-08-10 19:32:19 +10:00
Damien Elmes
06fcccaf44 remove border on bottom toolbar; fix hacky spacing of top elements 2017-08-10 19:17:28 +10:00
Damien Elmes
f3f90842dc move the inline css and some more js into separate files
- stdHtml() css= arg now takes a list of files like js=
- the files are loaded in the head of the document so that styling
that comes later in the document can easily override it

fixes:
https://anki.tenderapp.com/discussions/beta-testing/661-anki-210-beta-7/page/1#comment_43164447
https://anki.tenderapp.com/discussions/beta-testing/661-anki-210-beta-7#comment_43177130
2017-08-10 19:02:32 +10:00
Damien Elmes
c8e8225395 remove unused bodyClass arg 2017-08-10 18:10:50 +10:00
Damien Elmes
82aeb57318 Revert "experiment with displaying FrontSide under answer"
This reverts commit a1b0ddb00c.
2017-08-10 15:04:24 +10:00
Damien Elmes
c668efa4b4 work around adjustHeightToFit() crashing on Linux 2017-08-10 15:03:05 +10:00
Damien Elmes
a57b913450 opt in to qt's full hidpi support
doesn't seem to affect the webviews on Linux, so we need to keep the old
zoom code around for now
2017-08-10 15:02:46 +10:00
Damien Elmes
4dae8ef661 make sure we adjust browser toolbar height 2017-08-10 14:36:55 +10:00
Damien Elmes
3c5abe4af8 summarize used fields in card type list 2017-08-09 11:11:39 +10:00
Damien Elmes
2219736adc if focusTo provided, ensure webview is focused
fixes https://anki.tenderapp.com/discussions/beta-testing/661-anki-210-beta-7#comment_43155562
2017-08-08 20:25:42 +10:00
Damien Elmes
17693f1b63 bump version 2017-08-08 20:05:20 +10:00
Damien Elmes
016338fa07 delete preview timer ref 2017-08-08 20:02:37 +10:00
Damien Elmes
d55318d83f clayout refactor
- tabs became difficult to read when users had a lot of templates, so we
use a combobox instead
- move the More button to the top and integrate adding/removing
templates
- start with no focus to avoid accidental modifications
- display confirmation before adding template
- remove 'edit to customize' text that some users had trouble editing
2017-08-08 19:45:31 +10:00
Damien Elmes
23f8e15816 give the preview window the same treatment
different approach to timer handling so that it's more responsive when
the user clicks a navigation button
2017-08-08 16:28:53 +10:00
Damien Elmes
4d064e1cba wait for keystrokes and don't reload entire page 2017-08-08 16:07:18 +10:00
Damien Elmes
2c54139d3c move main clayout area out of tab widget
it was wasteful to use separate webviews for each tab; still to come is
avoiding setHtml() for each edit, and either moving to a tab bar or
combo box
2017-08-08 15:31:36 +10:00
Damien Elmes
c74cbf6108 fix media server port allocation
the old code was allowing the main thread to read .port before it had
been updated, and was binding to sockets that were already in use on
Windows. instead, we use a system-assigned free port and block the main
thread until it's been allocated
2017-08-08 14:56:34 +10:00
Damien Elmes
bee6931dc9 fix issues with media server not going away
- use a non-daemonized python thread
- shut the server down on exit, including from profile manager
- use a timeout on requests, or the connection that webengine holds open
will block the thread and prevent it from exiting when anki closes
2017-08-08 12:55:30 +10:00
Damien Elmes
cfb50fa03c add hook for overriding state shortcuts 2017-08-08 10:09:12 +10:00
Damien Elmes
7ad8d761d1 put search prompt in dropdown history so down key does right thing
https://anki.tenderapp.com/discussions/beta-testing/661-anki-210-beta-7#comment_43157037
2017-08-08 10:05:10 +10:00
Damien Elmes
d5aede7252 bump version 2017-08-07 18:39:29 +10:00
Damien Elmes
a1b0ddb00c experiment with displaying FrontSide under answer
- avoids having to move eyes to answer section
- the fade out/fade in step feels more natural when the
question section moves

feedback welcome
2017-08-07 18:38:35 +10:00
Damien Elmes
dc81af96ac fix autoplay on the answer side 2017-08-07 16:15:15 +10:00
Damien Elmes
538119201c ensure deferred js is executed on the correct page
setHtml() and deferred js now share a single queue, to ensure that js
calls are delivered to the correct page

also remove the onLoadFinished hook, which is no longer used
2017-08-07 16:01:35 +10:00
Damien Elmes
9c63714e80 delay setHtml() until previous page has fully loaded
based on 0241eb70dc
2017-08-07 15:15:31 +10:00
Damien Elmes
b0213b9fd7 ignore webchannel events received after webview deleted
thanks to David for the report
2017-08-07 14:51:42 +10:00
Damien Elmes
27f992c6b4 Merge pull request #193 from techdavid/fix-paste-url-with-hash
Fix error when dropping/pasting media file with a hash in its name
2017-08-07 12:19:30 +10:00
Damien Elmes
3bd6e18279 Merge pull request #192 from techdavid/fix-many-shortcut-key
Prevent "Shorcut key: " appearing multiple times in tooltips
2017-08-07 12:15:16 +10:00
David Bailey
d4cf870ff7 Fix error when dropping/pasting media file with a hash in its name 2017-08-06 18:03:00 +01:00
David Bailey
4c43fcfe4e Prevent "Shorcut key: " appearing multiple times in tooltips 2017-08-06 16:03:11 +01:00
Damien Elmes
e40445a9c4 bump version 2017-08-06 15:30:41 +10:00
Damien Elmes
a11035b2fa Revert "fix TypeError: channel.execCallbacks[message.id] is not a function"
This reverts commit 331239de05.

This commit caused the blur event from the editor to fire after the saveNow()
callback had run, which broke the reviewer when returning from editcurrent.
Reverting for now, as the actual error is harmless AFAICT.
2017-08-06 15:12:28 +10:00
Damien Elmes
4c286fa3f7 hack around clozes breaking mathjax 2017-08-06 14:48:30 +10:00
Damien Elmes
21b770cb10 explictly exit
let's see if this helps with https://anki.tenderapp.com/discussions/beta-testing/631-anki-210-beta-4/page/2#comment_43137707
2017-08-06 14:10:51 +10:00
Damien Elmes
51a0e5fa4b fix field content showing under editor buttons 2017-08-06 13:55:09 +10:00
Damien Elmes
331239de05 fix TypeError: channel.execCallbacks[message.id] is not a function
we need to avoid calling setHtml() until the bridge command has
had a chance to pass its return code back down the channel
2017-08-06 13:46:18 +10:00
Damien Elmes
718b4b35d1 don't translate js console msgs 2017-08-06 13:10:51 +10:00
Damien Elmes
072489f436 fix unicode error when generating latex 2017-08-06 13:03:32 +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
797a7ea229 refactor editor focus handling
this fixes a bug where navigating to the next/previous card using
shortcut keys resulted in the first field being clobbered

- get rid of the stealFocus option in favour of explicitly passing
focusTo to setNote()
- setFields() is no longer responsible for setting focus
- add focusTo var to the browser so that the row changed hook can
restore focus when navigating to next/previous card
- fix the row changed hook being called twice
- the blur event now includes the field number instead of relying on the
 editor to have the correct currentField
- the current field is set to null on blur
- use deferred js and a callback rather than keeping track of when we
were loaded
- add shift+tab shortcut to go to previous field
2017-08-05 15:16:20 +10:00
Damien Elmes
96938e583a update browser toolbar to use delayed js 2017-08-05 13:47:48 +10:00
Damien Elmes
72868507c7 bundle mhchem 2017-08-05 12:47:07 +10:00
Damien Elmes
a56bddeb8d fix gifs failing to load
specifying max-height on img elements wasn't working when the parent
was an absolutely positioned element
2017-08-04 18:39:16 +10:00
Damien Elmes
d9b5d11312 fix conflicting add tags/jump to tags shortcuts 2017-08-04 17:39:40 +10:00