Commit Graph

704 Commits

Author SHA1 Message Date
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
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
Damien Elmes
5ef1692c78 fix duplicate constructor call in editcurrent 2017-07-27 16:25:15 +10:00
Damien Elmes
fa3461e20b mathjax support 2017-07-27 14:18:10 +10:00
Damien Elmes
3d9d792dd4 bundle web folder 2017-07-27 12:28:44 +10:00
Damien Elmes
e7abd9f4ed fix crash when syncing media on windows
update() was being called when processing events, leading to
recursion until the stack was exhausted

https://anki.tenderapp.com/discussions/beta-testing/639-anki-210-beta4-crashing-during-syncing
2017-07-26 15:21:27 +10:00
Damien Elmes
94b1768ba8 use ctrl+delete for delete shortcut in both reviewer and browser 2017-07-26 10:52:04 +10:00
Damien Elmes
630cddc786 fix superscript shortcut
https://anki.tenderapp.com/discussions/beta-testing/627-anki-210-beta-1#comment_43048185
2017-07-22 10:54:45 +10:00
Damien Elmes
17bb179d06 experimental prewrap support
- add option to wrap html in implicit pre-wrap environment during
editing and review - defaults to off
- update paste filter to convert divs/Ps to newlines and non-breaking
spaces to normal ones
- catch enter key and write \n instead of creating a new div

also:

- remove extra caretToEnd() call that is no longer required
- add dd/dt/dl to allowed tags
2017-07-20 12:16:47 +10:00
Damien Elmes
f7b3457ff0 fix drawLinks reference 2017-07-17 14:54:12 +10:00
Damien Elmes
dffab1376f Merge branch 'master' of github.com:dae/anki 2017-07-17 13:16:06 +10:00
Damien Elmes
d99dcaafdc don't open separate browser window on iframe load
https://anki.tenderapp.com/discussions/beta-testing/627-anki-210-beta-1#comment_43008395
2017-07-17 12:40:38 +10:00
Dmitry Mikheev
5bfd93842c Let users extend their bottom buttons functions
Like this:
```
aqt.deckbrowser.DeckBrowser.drawLinks.extend([
            ["", "rebuildAll", _("Rebuild All")],
            ["", "emptyAll", _("Empty All")],
])
```
2017-07-15 18:39:01 +05:00
Damien Elmes
7ecd889d8f preserve newlines and indents when pasting text
https://anki.tenderapp.com/discussions/ankidesktop/24123-paragraphsnew-lines-not-preserved-when-copypasting-into-anki
2017-07-12 10:57:01 +10:00
Damien Elmes
14597bd888 if a non-media link pasted, paste the url text directly 2017-07-11 14:58:22 +10:00
Damien Elmes
7d71170a33 catch windows firewall issue 2017-07-09 13:26:50 +10:00
Damien Elmes
15ca733f14 fix base folder location on windows 2017-07-09 13:22:01 +10:00
Damien Elmes
2d25069936 run garbage collector after webengine window
we GC on autosave, but doing an explicit GC prevents excess memory
consumption when rapidly opening and closing windows using
webengine
2017-07-08 12:28:11 +10:00
Damien Elmes
c392418ba7 bump version 2017-07-05 10:54:27 +10:00
Damien Elmes
2b8987f654 fix browse add-ons command failing to load on linux 2017-06-27 12:04:42 +10:00
Damien Elmes
1fe86e1bde about tweaks
- fix sort order
- treat as a collection window so it's only opened once, and is
closed on quit
- use our standard font
2017-06-26 13:05:11 +10:00
Damien Elmes
90f7038109 fix exit code 120 when quitting in python 3.6 2017-06-26 13:03:05 +10:00
Damien Elmes
ea5f2bb0ef don't need to set bgcol when the window is transparent 2017-06-24 19:15:14 +10:00
Damien Elmes
7bd33242cf disable pinch to zoom gesture 2017-06-23 14:34:56 +10:00
Damien Elmes
e635157ee4 move stats and sync buttons to the center 2017-06-23 14:03:18 +10:00
Damien Elmes
a3bdd04d42 set bgcol in ankiwebview 2017-06-23 13:07:59 +10:00
Damien Elmes
7af591cfd7 add cancel button to recording window 2017-06-23 13:04:32 +10:00
Damien Elmes
1b41e68f05 remove gradients from toolbars in favour of system colour 2017-06-22 18:06:40 +10:00