Commit Graph

731 Commits

Author SHA1 Message Date
Damien Elmes
c8e8225395 remove unused bodyClass arg 2017-08-10 18:10:50 +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
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
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
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
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
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
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
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
Damien Elmes
d656bff059 add contributor 2017-08-04 17:38:39 +10:00
Damien Elmes
37d3996be0 move height resizing to webview; remove onLoaded from toolbar/reviewer 2017-08-02 16:22:54 +10:00
Damien Elmes
538678a7a9 remove old comment 2017-08-02 16:18:09 +10:00
Damien Elmes
7d14a96889 automatically defer eval() calls until DOM loaded 2017-08-02 16:17:08 +10:00
Damien Elmes
321c4d7ff8 no longer need to hack around webengine stealing focus 2017-08-02 15:38:35 +10:00
Damien Elmes
9958dd57a4 remove superfluous lambda arg 2017-08-02 11:34:49 +10:00
Damien Elmes
61654ff70a skip useless focus preservation when navigating via preview screen 2017-08-01 17:46:08 +10:00
Damien Elmes
9ec9274011 fix fields being overwritten when dropping
remove the unneeded setFocus() call which was causing the blur event
to fire with the wrong data
2017-08-01 17:40:51 +10:00
Damien Elmes
66500f5262 move webview js into separate file 2017-08-01 17:04:55 +10:00
Damien Elmes
cd76281695 avoid errors caused by calling setHtml() before previous page loaded 2017-08-01 14:30:04 +10:00
Damien Elmes
0543a4533b add devMode flag to utils
also remove the extra toolbar call in loadProfile(), as we require a
restart to update the translations anyway
2017-08-01 14:28:13 +10:00
Damien Elmes
a5997e400b fix focus setting in resume screen 2017-08-01 13:57:15 +10:00
Damien Elmes
412d37fc13 another workaround for the KDE accelerator issue 2017-07-31 15:48:34 +10:00
Damien Elmes
b81a64272e allow browser override font to be unset 2017-07-29 16:09:00 +10:00
Damien Elmes
7405c1e7f1 don't force browser column font unless overriden 2017-07-29 16:00:02 +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
8cd20f3352 turn latex svg into a note type option
needed until the other clients support svgs
2017-07-28 18:38:31 +10:00
Damien Elmes
608a5662a9 fix ampersands appearing in deck names
https://bugs.kde.org/show_bug.cgi?id=345023
2017-07-28 17:40:26 +10:00