Commit Graph

41 Commits

Author SHA1 Message Date
Damien Elmes
c4029e5680 shortcut keys to jump to first 9 templates 2017-08-12 17:29:47 +10:00
Damien Elmes
6bbd6d2dd5 limit length of clayout field summary 2017-08-12 14:42:19 +10:00
Damien Elmes
03b0ff4565 tidy up card name list 2017-08-11 21:44:05 +10:00
Damien Elmes
75f58b86d6 disable rather than hide drop down in clayout cloze case 2017-08-11 21:04:17 +10:00
Damien Elmes
ba16b8714b remove images and move away from qt resources
- the bulk of image use is in webviews, so we move almost all used
images to web/imgs, as it's easier to manage
- change AnkiWebView to always use the local media server as a base, as
much of the UI has come to depend on it
- remove images from a few areas, as they felt dated
- delete a bunch of unused images
- href=# links were being opened in a browser window, so the code now
ignores them - the HTML should really be updated to return false in the
onclick handler
- update a few icons
2017-08-11 20:59:43 +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
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
3c5abe4af8 summarize used fields in card type list 2017-08-09 11:11:39 +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
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
321c4d7ff8 no longer need to hack around webengine stealing focus 2017-08-02 15:38:35 +10:00
Damien Elmes
b81a64272e allow browser override font to be unset 2017-07-29 16:09:00 +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
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
08747747bf prevent preview stealing focus in clayout
setHtml() steals focus due to webengine bug - fixes
https://anki.tenderapp.com/discussions/beta-testing/206-anki-210-alpha-7#comment_41700440
2017-01-10 18:32:48 +10:00
Damien Elmes
a8e2f992c8 image support 2016-07-07 23:39:48 +10:00
Damien Elmes
d94c011c88 fix clayout preview, js errors
.exec_() and webengineview don't seem to play nicely together
2016-07-07 12:32:27 +10:00
Damien Elmes
a1caa93054 fix mem leaks in dialogs
- ensure we're cleaning them up after they're rejected
- run the garbage collector afterwards so the qwebengineprocess
  instances get cleaned up
2016-07-04 13:22:35 +10:00
Damien Elmes
de7e40537d port majority of code to qt5.5+
- a few issues to work out still, and editor changes not done yet
- for communication between webengine and python code, we set window
.location to 'http://anki/<something>' - the leading http is
necessary for qt to call the link handler, which was introduced
in qt5.5
- the designer files now use a promoted qobject to create instances
of AnkiWebView
- we use the css zoom property to alter webengine font size based on
system dpi
- prefs and addons folder stored in new location (at least for now)
2016-05-31 18:51:40 +10:00
Damien Elmes
15b349e3a8 start port to python 3
unit tests pass and main screens of GUI load
2016-05-12 14:45:35 +10:00
Damien Elmes
6f95527758 use the larger arrow only on windows, and in other screens 2015-09-28 23:09:30 +10:00
Damien Elmes
ece78a7d11 allow all ankiwebview instances to take focus
the canFocus/canCopy separate variables was silly, as we ended up
with text that could be copied from the context menu but not with
a shortcut key. also we default to allowing focus now, since that's
the more sensible default. fixes copy issues with card info dialog and
some addons
2014-09-15 15:04:14 +09:00
Soren I. Bjornstad
9bb217f198 reduce tab width in template editor
The previous one was ridiculously wide; reduced to 30 pixels.
2014-08-10 14:36:13 -05:00
Soren I. Bjornstad
96818a07c7 don't allow pasting rich text into template editor 2014-08-05 10:42:36 -05:00
Houssam Salem
a12e6f6b65 Issue #998: Allow copy/paste and context menu in all card windows. 2014-02-15 17:26:03 +11:00
Damien Elmes
fb8cb34532 fix clayout switching back to original tab when flipping 2013-11-18 10:29:40 +09:00
Damien Elmes
d6f9fb4ab0 fix invalid translation 2013-10-20 10:02:29 +09:00
Damien Elmes
51121f6e86 escape image links in clayout and preview as well (#903) 2013-06-10 15:28:34 +09:00
Damien Elmes
dbd60dba4b fix error when opening card layout 2013-06-07 09:51:26 +09:00
Damien Elmes
6eada1e7c4 don't hide hr in preview when not type answer card 2013-05-23 11:11:25 +09:00
Damien Elmes
1b12ff6fe5 add real example to card layout, and move hr like during review 2013-05-20 18:21:14 +09:00
Damien Elmes
ac7bd4f736 fix i18n issue 2013-05-13 13:58:41 +09:00
Damien Elmes
8fc4dcd50d fix bugs introduced in previous #472 fix 2013-04-11 15:45:20 +09:00
Damien Elmes
5e8f45f7e5 don't play audio twice when changing templates (#472)
- setting current tab index triggered the function, so we don't need to call
  it manually
- no need to set index after adding card either, as it defaults to the most
  recently added tab
2013-04-11 15:07:50 +09:00
Damien Elmes
c437a38446 move card type deletion back to X on card tabs 2013-04-11 14:02:01 +09:00
Damien Elmes
8a330820ed fix link click triggering two page opens (#592) 2013-01-29 09:17:48 +09:00
ospalh
588feaa35b Add id to the text input field when editing the template.
Like this styling can be applied to id (or rather, the effect of styling to it can be seen in the layout editor.)
Also removed what looks like an extra '<center></center>'. That is added three lines later.
2013-01-18 16:46:25 +01:00
Damien Elmes
d11a1e0d54 allow browser font customization on a per-template basis 2012-12-22 10:10:52 +09:00
Damien Elmes
b2457811a2 optimize imports 2012-12-22 09:17:10 +09:00
Damien Elmes
d477df8c28 merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00