Commit Graph

82 Commits

Author SHA1 Message Date
toasted-nutbread
480869c3d1
Exclude documentElement from zoom calculation (#2227)
* Exclude documentElement from zoom calculation

* Add an option

* Refactor zoom coordinate conversion functions

* Convert zoom coordinates for text sources

* Rename variable

* Convert rect coordinate spaces

* Handle shadow DOM
2022-09-20 21:06:39 -04:00
toasted-nutbread
e7944d29b0
TextSourceElement surrogate pair support (#2217)
* Update StringUtil

* Refactor

* Handle UTF-16 surrogate pairs
2022-08-20 14:32:34 -04:00
toasted-nutbread
4194252fe3
New StringUtil (#2216)
* Create new StringUtil

* Use StringUtil in DOMTextScanner

* Fix order
2022-08-20 13:11:38 -04:00
toasted-nutbread
d3807d88ec
ArrayBufferUtil (#2215)
* Rename StringUtil to ArrayBufferUtil

* Update docs

* Rename file string-util.js to array-buffer-util.js
2022-08-20 12:53:22 -04:00
toasted-nutbread
ada4df1971
Fix invalid default values for popupTheme and popupOuterTheme (#2180)
* Fix invalid default values for popupTheme and popupOuterTheme

* Options update
2022-08-20 11:29:31 -04:00
toasted-nutbread
310303ca1a
Audio download timeout (#2187)
* Add support for an idle timeout when downloading audio

* Update eslint rules

* Pass idleTimeout to the downloader from DisplayAnki

* Add anki.downloadTimeout setting

* Update tests

* Assign _audioDownloadIdleTimeout using settings

* Show info about cancelled downloads

* Handle Firefox bug

* Improve audio errors

* Refactor

* Move functions to RequestBuilder
2022-08-20 11:17:24 -04:00
toasted-nutbread
c966d9b1eb
Touch and pen input updates (#2172)
* Remove unnecessary return

* Move touch start input filtering

* Refactor

* Add scanOnTouchPress

* Add preventPenScrolling

* Rename scanOnPenPress to scanOnPenMove

* Rename scanOnPenRelease to scanOnPenReleaseHover

* Simplify

* Refactor _searchAtFromPen early exit

* Merge _penPointerPressed and _penPointerReleased into a single variable

* Add more options

* Simplify pen pointer coordinates

* Implement scanOnPenPress and scanOnPenRelease

* Implement scanOnTouchRelease

* Fix tests

* Don't search on touch cancel

* Cancel touch if the touch action is used for scrolling or other gestures

* Fix incorrect scroll prevention options being used

* Organize options

* Fix typos
2022-06-03 17:11:32 -04:00
toasted-nutbread
19bba07a8b
Add support for Anki API key (#2169)
* Update material.css to support password fields

* Support password

* Add "apiKey" setting

* Use apiKey

* Update options if API key changes

* Update tests
2022-05-30 12:03:24 -04:00
toasted-nutbread
331a2e6294
Add support for guiEditNote to view notes (#2143)
* Add AnkiConnect.guiEditNote

* Update _onApiNoteView to first try guiEditNote

* Add setting

* Update noteView API

* Use setting

* Return which mode was used

* Update DisplayGenerator

* Handle errors in DisplayAnki

* Update docs

* Add isErrorUnsupportedAction function

* Add an allowFallback option to noteView

* Disambiguate

* Simplify now that preferredMode isn't used

* Update settings info

* Implement test buttons

* Update styles

* Update status visibility

* Wrap layout

* Update description

* Update date
2022-05-29 21:24:41 -04:00
toasted-nutbread
31e20c889e
ESlint JSdoc (#2148)
* Install eslint-plugin-jsdoc

* Initial rules setup

* Update lists

* Use @returns rather than @return

* Remove error throwing code which is never executed

* Fix issues relating to @throws

* General error fixes

* Update Display type documentation

* Various doc fixes

* Fix invalid tuple syntax

* Doc updates

* Remove unused

* Doc updates

* Enable jsdoc/require-returns

* Update rules

* Update remaining rules
2022-05-20 10:28:38 -04:00
toasted-nutbread
e5b53bb238
Hide popup on cursor exit (#2109)
* Update phrasing

* Add new options

* Add settings

* Implement
2022-04-03 22:52:53 -04:00
toasted-nutbread
f61690ea2c
Theme updates (#2105)
* Change siteColor to siteTheme

* Fix potential null exception

* Simplify

* Update display theme assignment

* Add a data-browser-theme attribute

* Add "browser" option for theme

* Create ThemeController

* Add theme-controller.js to relevant pages

* Use ThemeController

* Simplify

* Fix 'light' being used instead of 'default'

* Update the settings values to more accurately reflect their usage

* Change default site theme in display.js

* Remove async

* Restore async for consistency
2022-04-03 16:20:55 -04:00
toasted-nutbread
89a939eb39
Update anki card frequency (#2065)
* Prefer to use displayValue for Anki card frequency values

* Update test data
2022-02-05 21:35:03 -05:00
toasted-nutbread
89ac85afd0
Update copyright date (#2062)
* Update eslint settings

* Update 2021 files

* Update other files
2022-02-02 20:43:10 -05:00
toasted-nutbread
258f1b629a
Update sentence termination characters (#2059)
* Add vertical punctuation to terminationCharacters

* Upgrade settings

* Update tests
2022-02-02 20:09:13 -05:00
toasted-nutbread
0e52a1f509
Scanning wildcards (#2042)
* Add scanning.matchTypePrefix option

* Update TextScanner to use matchTypePrefix option

* Add setting

* Update warning
2021-12-18 12:38:39 -05:00
toasted-nutbread
36967b1839
General refactoring (#2016)
* Remove // Public comments

* Fix errors

* Remove source parameter from Popup*.setOptionsContext
2021-11-21 12:34:57 -05:00
toasted-nutbread
75aabd983d
String frequency support (#1989)
* Restore support for string frequency values

* Add support for {value, displayValue} frequencies

* Update test data

* Improve number parsing of string frequencies

* Improve reading detection

* Expose a displayValue property for frequency information

* Update docs

* Expose displayValue to Anki note data

* Fix translator

* Update display generation

* Update test data

* Update counts
2021-10-14 21:26:53 -04:00
toasted-nutbread
9899727d7d
Frequency dictionary sort (#1938)
* Add sortDictionary/sortDictionaryOrder options

* Update options

* Add API.getTermFrequencies

* Add settings

* Implement frequency dictionary sorting

* Update test

* Update test data

* Fix handling of undefined rank-based frequencies
2021-09-26 11:08:16 -04:00
toasted-nutbread
97a80276f6
Database readwrite transaction updates (#1932)
* Add _readWriteTransaction helper

* Improve deleteDictionary order

* Make onProgress event optional

* Simplify progress rate parameter
2021-09-05 20:00:08 -04:00
toasted-nutbread
0331374241
Dictionary media import improvements (#1926)
* Add base64ToArrayBuffer to StringUtil

* Remove unnecessary media-util.js import

* Run async requirements in serial rather than parallel

* Update API.getMedia handler to convert ArrayBuffer content to base64

* Rename getImageResolution to getImageDetails

* Change parameter order of getImageDetails

* Pre-process and store media as an ArrayBuffer

* Remove MediaUtil.createBlobFromBase64Content

* Fix Anki media injection
2021-09-03 22:33:58 -04:00
toasted-nutbread
cd78d56fee
Database improvements to data persistency (#1893)
* Fix function check

* Rename arguments of getAll, getAllKeys, and their private functions

* Simplify bulkAdd

* Simplify delete

* Simplify bulkDelete

* Remove persistData
2021-08-13 18:35:31 -04:00
toasted-nutbread
2d5e6f8394
Fix data not being persisted after terminating Worker thread (#1877) 2021-08-07 15:25:00 -04:00
toasted-nutbread
5d4141a429
Google Docs accessibility (#1875)
* Add accessibility option for forcing Google Docs HTML-based rendering

* Update settings

* Send a documentStart message at document start

* Add accessibility script for Google Docs

* Set up accessibility

* Update tests
2021-08-07 12:40:51 -04:00
toasted-nutbread
454ffaad96
StringUtil (#1861)
* Add StringUtil class

* Use StringUtil
2021-07-31 13:04:16 -04:00
toasted-nutbread
a0fa67d57c
Update JsonSchema (#1856)
* Fix issues with validating properties

* Simplify multiple destructuring

* Add an optiona progress callback

* Add functions

* Add more functions
2021-07-28 20:31:36 -04:00
toasted-nutbread
b0596c8a3c
Rename pitchAccent in source code (#1852)
* Rename pitchAccentPosition to pitchAccentDownstepPosition

* Rename function

* Rename

* Rename

* pitches => pronunciations
2021-07-26 19:45:30 -04:00
toasted-nutbread
2ee3e3a7a1
Update pronunciation anki templates (#1842)
* Update anki pronunciation templates

* Expose nasalPositions/devoicePositions

* Update templates to support nasal/devoice positions

* Update test data
2021-07-18 16:01:42 -04:00
toasted-nutbread
fafa746a63
Sandbox script folders (#1837)
* Move scripts

* Update paths

* Fix ordering

* Simplify eslint rules
2021-07-17 17:10:25 -04:00
toasted-nutbread
d058237ba7
Duplicate scope check all models (#1810)
* Add duplicateScopeCheckAllModels option to createNote

* Add duplicateScopeCheckAllModels option

* Add setting
2021-07-13 20:29:53 -04:00
toasted-nutbread
7a1570885e
Simplify get media structure (#1817)
* Remove format argument of getMedia

* Implement escaping
2021-07-09 20:14:05 -04:00
toasted-nutbread
8c68fa4d94
Anki text furigana parsing and {sentence-furigana} marker (#1814)
* Add support for textFurigana media

* Add readingMode parameter

* Implement readingMode

* Add {sentence-furigana} marker

* Fallback to sentence if furigana isn't available

* Update test data
2021-07-09 17:48:27 -04:00
toasted-nutbread
315dc425e4
Anki card selected text (#1809)
* Add support for injecting the text selection into Anki cards

* Add selection-text

* Upgrade to add {selection-text}

* Update descriptions

* Update test data
2021-07-07 20:00:30 -04:00
toasted-nutbread
9935e154f1
Update options-util tests and comment (#1806) 2021-07-06 22:59:24 -04:00
toasted-nutbread
1088c17503
Add support for injecting dictionary media into Anki cards (#1805) 2021-07-06 22:00:18 -04:00
toasted-nutbread
e88d63fc6d
Template renderer media updates (#1802)
* Add TemplateRendererMediaProvider to abstract media-related functionality

* Update representation of injected media

* Update templates

* Update upgrade file

* Update tests

* Update test data

* Force media to be an object

* Update test data
2021-07-06 19:43:53 -04:00
toasted-nutbread
e155132085
OptionsUtil and tests updates (#1801)
* Update OptionsUtil.update to support an optional targetVersion param

* Update Anki template updates to have an explicit target version
2021-07-05 23:24:06 -04:00
toasted-nutbread
da13a2ebff
DisplayAnki note requirements (#1799)
* Update how errors are collected from _formatField

* Expose requirements
2021-07-05 15:08:11 -04:00
toasted-nutbread
f7d177e6d0
Refactor createNote (#1789)
* Update createNote to return a wrapper object

* Update how createNote creates errors
2021-07-03 11:30:48 -04:00
toasted-nutbread
ca97e38bd2
Anki support for structured-content (#1786)
* Update how glossary text is formatted

* Update structured content and image generation

* Pass root data to _createStructuredContentGenerator

* Implement media URLs

* Update documentation

* Update options util

* Apply styles to content

* Improve HTML normalization

* Update DatabaseVM.fetch function

* Update test

* Update test data
2021-07-02 22:46:38 -04:00
toasted-nutbread
f9167c8fdd
Template rendering updates (#1762)
* Remove unused function

* Update template rendering return value
2021-06-26 17:05:55 -04:00
toasted-nutbread
6e0a367afc
Translator data format updates (#1754)
* Add {dictionaryIndex, dictionaryPriority} to definitions

* Add score to definitions

* Add id to definition

* Use definition id instead of ids array

* Remove ids array

* Update docs

* Update test data
2021-06-26 11:57:09 -04:00
toasted-nutbread
d87515ec12
Translator id updates (#1730)
* Allow unsequenced definitions to be added to multiple groups

* Update translator data to store multiple IDs

* Update Anki note data

* Update test data

* Update docs
2021-06-05 22:27:58 -04:00
toasted-nutbread
cca01e85a3
Improve multiple audio sources (#1718)
* Add url/voice options to audio sources

* Add help for TTS

* Remove old settings

* Update tests

* Update use of audio source URL

* Improve labels for sources with the same type
2021-05-30 12:41:19 -04:00
toasted-nutbread
52aa92208c
Fix set/deleteProperty not allowing array splicing (#1713)
* Fix set/deleteProperty not allowing array splicing

* Update tests
2021-05-26 21:08:24 -04:00
toasted-nutbread
0232325f96
Refactor json audio source (#1711)
* Move sources to the end of audio options object

* Add custom-json audio source type

* Add support for downloading custom-json

* Remove customSourceType
2021-05-26 20:38:15 -04:00
toasted-nutbread
900bceda47
Fix json schema array properties (#1709)
* Fix proxy array properties being handled incorrectly

* Add tests to check array properties
2021-05-24 18:53:42 -04:00
toasted-nutbread
54e102f343
Json schema ref support (#1708)
* Add basic support for JSON schema $ref

* Add tests
2021-05-23 15:49:25 -04:00
toasted-nutbread
d182e55527
Rename internal JSON schema functions to match new return type (#1699) 2021-05-22 18:01:16 -04:00
toasted-nutbread
d7cf019b4a
Json schema improvements (#1698)
* Simplify schema multi-push/pop

* Reverse order of schema path

* Reverse order of value path

* Simplify schema path structure

* Rename for better clarity
2021-05-22 17:56:44 -04:00