Commit Graph

5207 Commits

Author SHA1 Message Date
Andreas Reis
54f51da944 Allow <audio> to play without user interaction in accordance to autoplay setting
Since 2018, Chromium by default requires at least one user interaction with a page in order for sound to play. That's not what an Anki user expects.

So this commit undoes this by setting the policy accordingly if the deck's settings have autoplay set, so that files in <audio> tags (if they further have the autoplay attribute set / are jscripted accordingly) are treated the same as ones in [sound:…] elements. OFC, it's obviously not a good idea to mix both on one card.

(AnkiDroid's WebView has already been unconditionally ignoring the requirement since forever.)
2020-11-10 14:53:45 +01:00
Andreas Reis
e68a40f13e cleanup / renames
・ soundRegexps →  sound_regexps

・ htmlRegexps →  html_media_regexps

・ HTML_TAGS →  HTML_MEDIA_TAGS

・ escapeImages →  escape_media_filenames + alias

・ strip_html_preserving_image_filenames →  strip_html_preserving_media_filenames
2020-11-10 14:53:04 +01:00
Andreas Reis
6e9aaad11e Add audio & object tags to media check
Makes the media check recognize files in <audio> and <object> tags as used.

They've been observed/supported by the WebView (checked: Anki, AnkiDroid) since just about forever already and are extremely useful if one knows a thing about web dev.
2020-10-25 13:09:57 +01:00
Damien Elmes
1e37e6cabd formatting fix 2020-10-12 12:37:51 +10:00
Damien Elmes
f75e3e6486
Merge pull request #790 from hgiesel/fields
Add fields_did_rename_field and fields_did_remove_field hooks
2020-10-12 12:36:39 +10:00
Damien Elmes
1aa29f2e79
Merge pull request #789 from abdnh/editor-decode-urls
Decode pasted URLs for nicer display
2020-10-12 12:33:52 +10:00
Damien Elmes
34a1d793a4
Merge pull request #788 from pkubowicz/opus-audio
Add .opus as an audio extension
2020-10-12 12:32:56 +10:00
Damien Elmes
aad6785bab
Merge branch 'master' into opus-audio 2020-10-12 12:32:43 +10:00
Damien Elmes
153c8aed27 formatting fixes 2020-10-12 12:17:02 +10:00
Damien Elmes
a4a461c17b
Merge pull request #782 from johan456789/patch-1
fix outdated help site
2020-10-12 12:15:46 +10:00
Henrik Giesel
591d3738d1 Add fields_did_rename_field and fields_did_remove_field hooks 2020-10-11 19:16:30 +02:00
abdo
709e789ade Decode pasted URLs 2020-10-11 16:46:46 +03:00
Piotr Kubowicz
ed11f8e9d6 Add .opus as an audio extension
Wikimedia Commons has pronunciation recordings with .opus extension.
Anki is able to play such files, but until now adding them required
changing the extension to .ogg or some other supported one.

Also sort the audio extensions list.
2020-10-10 16:28:40 +02:00
Damien Elmes
99af63d81c bust cache 2020-10-10 19:39:21 +10:00
Damien Elmes
727ddd74b6 fixes for latest mypy 2020-10-10 19:02:59 +10:00
johan456789
06f1aeb052 fix help url paths 2020-10-10 00:38:07 +08:00
johan456789
91d3ded689 remove never used link 2020-10-10 00:07:34 +08:00
Damien Elmes
c96784c0eb fix new clippy lints 2020-10-09 21:35:53 +10:00
Damien Elmes
0d4e05e6a4
Merge pull request #783 from abdnh/escape-amp-in-menus
Fix help-wanted#20
2020-10-09 20:47:45 +10:00
Damien Elmes
09a6a8078e
Merge pull request #775 from contribs-colin-w4b-co-uk/readme-development
added "Windows user (using PyCharm)" section to README.development
2020-10-09 20:45:04 +10:00
lukkea
d367044da2 clarified that .idea folder should be added to global .gitignore, not the repo .gitignore 2020-10-09 11:37:04 +01:00
Damien Elmes
22d33a8000 we can optimize the dependencies separately (to an extent) 2020-10-09 20:02:15 +10:00
Damien Elmes
efc8e4fb28 use a semi-optimized build during development
stock dev mode is too slow, but release mode is about 3x slower
than this middle ground
2020-10-09 19:51:46 +10:00
lukkea
41d0b7ddca removed requirements.txt and adjusted "Windows users (using PyCharm)" to reflect that removal 2020-10-09 10:19:54 +01:00
abdo
7b392dd9d4 Escape ampersands in note type names too 2020-10-07 15:26:32 +03:00
johan456789
b8bf4fcd2a
Update CONTRIBUTORS 2020-10-07 20:02:03 +08:00
johan456789
e8e5314a97
fix outdated help site 2020-10-07 19:38:49 +08:00
abdo
994d167fdb Fix 'Filter' menu item in deck filters not working 2020-10-07 14:32:21 +03:00
abdo
176126417e Escape ampersands in filter menu
Fixes ankitects/help-wanted#20
2020-10-07 13:44:33 +03:00
Damien Elmes
301c9587d1
Merge pull request #778 from hgiesel/refocus
Always focus main web instead of bottom web in reviewer
2020-10-07 16:22:49 +10:00
Damien Elmes
7460dfc830 add Gustavo Costa
A reminder that anyone who's contributed is welcome to send
a PR adding themselves!
2020-10-06 14:36:11 +10:00
Damien Elmes
234e03d44d fix invisible scrollbar in nightmode
vars.scss no longer contains the Qt theme definitions, so the
easiest solution was to duplicate the colour in this case
2020-10-06 14:35:21 +10:00
Henrik Giesel
74ffc2a4cd Have a "default" highlight, but naturally follow focus if focus is in container 2020-10-05 22:54:23 +02:00
Henrik Giesel
0b434e484b Give the focus on .focus element a red tint 2020-10-05 22:39:16 +02:00
Henrik Giesel
a08d83deda Add focus class which mimics built-in focus 2020-10-05 22:18:46 +02:00
lukkea
71d7131af7 stripped out requirements.txt to only those not already included 2020-10-05 08:47:20 +01:00
Damien Elmes
90fa38495e reindex when checking database
Came across a user with a corrupt index:

sqlite> pragma integrity_check;
 integrity_check = wrong # of entries in index ix_revlog_cid
 integrity_check = wrong # of entries in index ix_cards_sched

This is not picked up by a quick check, and a vacuum does not
fix it, but a reindex does.

AnkiWeb currently performs a full check when a file is uploaded
to it, so this was leading to "corrupt" to show up when syncing
the collection, with a local DB check not reporting/fixing the issue.
2020-10-05 17:40:43 +10:00
Damien Elmes
ed3527ab52 vendor rsync binary 2020-10-05 14:09:59 +10:00
Damien Elmes
bf72773531 fix IndexError when switching notetypes
Closes #780
https://github.com/ankitects/anki/pull/780
2020-10-05 13:33:54 +10:00
Damien Elmes
8fa865e8f4
Merge pull request #781 from hgiesel/leftbtns
Refactor Buttons in editor and add editor_did_init_left_buttons gui_hook
2020-10-05 13:14:52 +10:00
Damien Elmes
d03cabf9a8
Merge pull request #779 from david-allison-1/fix-sign-up-link
Fix "Sign Up" link location
2020-10-05 12:34:11 +10:00
Damien Elmes
f569ba6e63
Merge pull request #777 from kelciour/mpv-anki-freeze-on-windows
Separate player for videos on Windows
2020-10-05 12:27:31 +10:00
Damien Elmes
bb8f1d7e9c
Merge pull request #776 from abdnh/basic-mode-links-as-plain-text
Paste links as plain text in basic mode
2020-10-05 12:12:11 +10:00
Henrik Giesel
e9ca17b1b3 Turn _class into rightside boolean flag 2020-10-04 23:03:37 +02:00
Henrik Giesel
e8c80174eb Refactor out theclass assignment 2020-10-04 22:51:34 +02:00
Henrik Giesel
4c255b0289 Add editor_did_init_left_buttons gui_hook 2020-10-04 22:50:02 +02:00
Henrik Giesel
bf29fb8e83 Make icon Optional explicitly in function signature 2020-10-04 22:42:28 +02:00
Henrik Giesel
30d1d57c78 Rewrite so all editor toolbar buttons use _addButton 2020-10-04 22:41:18 +02:00
David Allison
f4e9df8457 Fix "Sign Up" link location
String states "Sign Up", but currently points to the "Sign In" screen: https://ankiweb.net/account/login

aff28a38e5/rslib/ftl/sync.ftl (L38-L42)
2020-10-04 18:14:49 +01:00
Henrik Giesel
9018140eef Also focus main web instead of bottom web 2020-10-03 22:33:01 +02:00