Damien Elmes
c6b74646b9
handle 'jpg' and leading space in inlined images
2018-08-20 13:02:30 +10:00
Damien Elmes
99fb8b6403
favour urls over images in local file case
...
fixes copying&pasting from finder pasting icons instead of actual image
https://anki.tenderapp.com/discussions/ankidesktop/29082-found-several-issues-in-anki-21
2018-08-08 12:46:51 +10:00
Damien Elmes
afdcc8871e
fix images not pasting as links
2018-08-08 12:45:59 +10:00
Damien Elmes
59d376fb98
rewrite data uris from html pastes as well
2018-08-08 11:38:45 +10:00
Damien Elmes
7b2c0533c1
shortcut to mhchem
2018-08-06 13:17:57 +10:00
Damien Elmes
1c538fb943
add webm
2018-07-30 12:06:38 +10:00
Damien Elmes
46c8eb00ca
sync field contents before applying cloze deletion
...
based on a patch by dlon:
https://github.com/dae/anki/pull/236
2018-05-28 13:40:35 +10:00
Damien Elmes
9cdcc99aa7
fix previously pasted image appearing in place of drop/text paste
...
mime.imageData() was returning stale data, and may have been causing
crashes as well
2018-05-10 16:44:55 +10:00
Damien Elmes
77b5db4d96
support pasting of images from inlined base64 text
...
chrome exports image data as text when using 'copy image location'
2018-05-01 13:16:46 +10:00
Damien Elmes
ca14f9e4d9
favour images over urls when pasting
...
fixes dragging of images from safari+google images, and pasting of
'copy image' from chrome
2018-05-01 12:47:41 +10:00
Damien Elmes
d7db4b7427
catch attempts to save field contents to wrong note
2018-04-30 15:15:20 +10:00
Damien Elmes
f8bfcc01d6
sox was dropped years ago
2018-04-19 17:15:49 +10:00
Damien Elmes
b991883a6c
Revert "work around issues writing to Windows clipboard"
...
This reverts commit b6d68c284e .
seemed to be causing crashes, and the underlying race condition wasn't solved
2018-04-06 16:46:09 +10:00
Damien Elmes
75d1cb1f2a
filter middle click pastes
2018-03-02 11:16:02 +10:00
Damien Elmes
b6d68c284e
work around issues writing to Windows clipboard
...
https://anki.tenderapp.com/discussions/beta-testing/1014-cannot-copy-from-fields-in-anki-210beta36
2018-03-01 15:53:25 +10:00
Damien Elmes
d8de5fbb9b
check shift key when paste starts; avoid progress dlg for local file
...
https://anki.tenderapp.com/discussions/ankidesktop/26661-conot-paste-image-and-text-together-from-word-into-anki
2018-02-05 13:40:56 +10:00
Damien Elmes
3e9be0155e
preserve newlines when pasting plain text
2018-01-26 19:18:24 +10:00
Damien Elmes
f668c6fc79
remove missed format literals
2018-01-24 21:07:06 +10:00
Damien Elmes
d513c93b89
more raw string literals
2017-12-13 14:34:54 +10:00
Damien Elmes
093cce7cce
add a flag to keep editor buttons enabled when no field selected
2017-12-08 21:06:16 +10:00
Damien Elmes
4f154f75bd
ignore editor shortcuts when no field focused
2017-12-04 12:53:28 +10:00
Damien Elmes
87145f6636
make sure to preserve focus when reloading on editFocusLost
2017-12-04 12:03:01 +10:00
Damien Elmes
a97f1d87ff
detect image extension, catch errors, add timeout
2017-11-17 17:30:01 +10:00
Damien Elmes
e673e642ac
don't check extension when localizing image sources
...
fixes https://anki.tenderapp.com/discussions/beta-testing/916-pictures-not-showing-on-iphoneipad-ios11-when-not-connected-to-internet
2017-11-17 16:20:33 +10:00
Damien Elmes
cf3da168a8
don't error if pasted image in temp folder
...
https://anki.tenderapp.com/discussions/ankidesktop/25805-anki-21-error-reporting
2017-11-13 11:05:46 +10:00
Damien Elmes
49fb1f072d
fix broken image links when pasting between fields
...
https://anki.tenderapp.com/discussions/beta-testing/853-anki-210-beta-21#comment_43959510
2017-11-11 11:51:30 +10:00
Damien Elmes
93ecd17703
separate basic and extended paste modes
...
- basic mode is the default, and includes only HTML elements that can be
added/edited easily with the default editor
- extended mode is enabled by holding down shift and includes a bunch of
other HTML elements
2017-10-25 20:20:28 +10:00
Damien Elmes
d1421edb4f
use requests library for media downloads
...
fixes SSL errors when pasting media from https website
2017-10-25 19:42:20 +10:00
Damien Elmes
86c50f067c
drop experimental prewrap mode
...
- pasting in prewrap mode had been broken for a while and nobody noticed
- needs changes to export code and cloze handling code to deal with the
newlines
- newline rewriting in filterNode() is likely fragile
- may revisit post 2.1
2017-10-25 19:18:00 +10:00
Damien Elmes
ae63dfb520
fix detection of media links in paste
...
'.aspx' was matching the 'spx' filter
2017-10-18 21:58:36 +10:00
krassowski
11a01a3ea0
Setup shortcuts after setting-up web.
2017-10-11 18:51:26 +00:00
Damien Elmes
9a641432aa
make sure we clear the queue when previewing attached
2017-10-02 17:21:34 +10:00
Damien Elmes
1c4bec73d7
add missing shortcuts back to advanced menu
2017-09-19 17:07:28 +10:00
Damien Elmes
d91faa67b4
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
a7ed7fa4e3
fix cutting and copying between fields
...
the shortcut keys are handled by webengine on platforms other than
osx, so rather than messing with an event filter we catch the cut and
copy events in js and send a signal back
2017-09-02 13:48:03 +10:00
Damien Elmes
be14703e7f
strip trailing <br> tag when saving field
2017-09-02 13:26:57 +10:00
Damien Elmes
f9f8b117d9
fix formatting preservation when pasting between fields
...
- make sure js is passed the internal flag
- make sure we flag text after the asynchronous clipboard change
- be explicit about clipboard data update
2017-08-31 18:10:37 +10:00
Damien Elmes
02a3e14c13
setupEditorShortcuts is a hook, not a filter
...
add-ons can modify cuts in place
2017-08-26 18:47:45 +10:00
Damien Elmes
5b0d740948
Merge branch 'master' into editor-addbutton-convenience-function
2017-08-24 18:26:51 +10:00
Damien Elmes
ec27ca52b2
Merge pull request #200 from glutanimate/editor-button-labels
...
Reintroduce button labels for the Editor
2017-08-24 18:20:55 +10:00
Glutanimate
e0038f8003
No need to assign QShortcut to variable
2017-08-24 00:17:28 +02:00
Glutanimate
2d0e74ee5f
Convenience function to assign function a button, bridge cmd & shortcut
...
This is meant to more closely replicate Anki 2.0.x`s _addButton method
than the current one does. Its primary purpose is to reduce the
boilerplate code needed for add-on authors to implement a new button
alongside its hotkey.
2017-08-23 23:55:24 +02:00
Glutanimate
d7bf865524
Reintroduce button labels for the Editor
...
Anki 2.0.x provided add-on authors with the ability to define
labels that could be used instead of icons. This commit reintroduces
that ability and makes the use of an icon optional.
2017-08-23 23:48:08 +02:00
Glutanimate
16221cc47a
Pass on Editor instance when running "setupEditorShortcuts" filter
2017-08-23 23:37:11 +02:00
Damien Elmes
13b331fb0a
fix translations and shortcuts on editor buttons
2017-08-17 13:51:54 +10:00
Damien Elmes
8ab5a3a176
use callback when closing windows
...
remove the old forceClose hack in favour of a callback when closing, so
all windows have a chance to save properly before the collection is
unloaded
also:
- fix a warning shown when opening about screen
- require a call to editor.cleanup() when closing a window, to make sure
any pending js callbacks don't try to fire on a deleted object
- make sure we gc webview when closing editcurrent
- main.py still needs refactoring to make use of the change
2017-08-16 12:48:15 +10:00
Damien Elmes
b28ca8c0d1
make saveNow() consistently fire callback after returning to event loop
...
avoid gotchas with callback firing in the middle of a close event, etc
2017-08-16 11:49:33 +10:00
Damien Elmes
30e6a34d25
only focus webview after fields have been set
...
on some platforms the old approach was causing a focus+blur event to
fire with the old note contents
fixes
https://anki.tenderapp.com/discussions/beta-testing/681-red-cloze
and probably fixes
https://anki.tenderapp.com/discussions/beta-testing/683-back-input-returns
2017-08-15 11:38:32 +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
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