Commit Graph

264 Commits

Author SHA1 Message Date
toasted-nutbread
992c8bcf75
test-workers (#1863)
* Add getImportedScripts utility function to test-sw.js

* Move functionality to testServiceWorker

* Rename file

* Add loadEslint utility function

* Add filterScriptPaths utility
2021-07-31 14:36:14 -04:00
toasted-nutbread
00c5ae7983
DictionaryImporterMediaLoader (#1860)
* Rename param for consistency

* Move media loading functionality into DictionaryImporterMediaLoader

* Create test class for media loading

* Remove unnecessary Blob/Image/URL functionality
2021-07-31 12:30:31 -04:00
toasted-nutbread
2d57d69b9e
Improve dictionary importer (#1859)
* Optimize dictionary data parsing during import

* Use ArrayBuffer instead of string

* Add missing function for testing
2021-07-31 10:53:35 -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
3f73889874
Update de/serializeError functions to only serialize data if present (#1849) 2021-07-25 12:54:26 -04:00
toasted-nutbread
73f06a3fa0
Fix definition image aspect ratio issue (#1847)
* Fix incorrect aspect ratio

* Update test data
2021-07-22 18:11:46 -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
40cdb4feb5
Update valid-dictionary1 data (#1841)
* Add example definitions for pronunciation metadata

* Update counts

* Update tests
2021-07-18 15:52:40 -04:00
toasted-nutbread
637d4a2087
Pronunciation template helper (#1840)
* Rename field

* Set up pronunication components

* Fix documentation

* Rename function

* Update test dependencies

* Fix constructor

* Log errors

* Add pronunciation helper

* Add styleApplier argument to _getHtml/_normalizeHtml

* Use getAttribute for 'class' to support namespaced elements (e.g. svg)

* Update format name

* Add optional tag

* Update docs
2021-07-18 13:43:11 -04:00
toasted-nutbread
10a9da4d31
Anki template renderer abstraction (#1839)
* Add AnkiTemplateRenderer abstraction

* Move Anki-specific template functionality into AnkiTemplateRenderer

* Add documentation comments
2021-07-18 11:20:03 -04:00
toasted-nutbread
e1230c7934
CSS JSON styles generalization (#1838)
* Rename files

* Generalize custom CSS generation and testing

* Add CSS JSON file for display pronunciation
2021-07-17 22:39:25 -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
3e938f1a1f
Display pronunciation refactor (#1835)
* Simplify svg and container styles

* Rename pitch-accent-details to pitch-accent-graph-container

* Rename pitch-accent-graph* to pronunciation-graph*

* Remove unused template

* Omit quotes

* Rename pitch-accent-character to pronunciation-mora

* Simplify names

* Replace pronunciation-mora-inner with pronunciation-character

* Improve grouping of nasal characters

* Simplify character replacement

* Replace pseudo-elements with real elements

* Use an element rather than a fragment

* Rename functions

* Add wrapper

* Rename pitch-accent-characters to pronunciation-text-container

* Update test data

* Update downstep notation generation

* Rename pitch-accent-position to pronunciation-downstep-notation-container

* Space

* Wrap pronunciations in a container node

* Update preview

* Embed pitch accent styles directly
2021-07-17 14:44:36 -04:00
toasted-nutbread
41fc76d6fd
Devoice and nasal pronunciation info (#1832)
* Update schema to support information about nasal and devoiced mora

* Expose nasalPositions and devoicePositions in dictionary entry data

* Expose nasalPositions, devoicePositions in grouped pitch info

* Update display generator

* Update test dictionary data

* Update test data
2021-07-15 22:39:33 -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
0d16709547
JapaneseUtil updates (#1813)
* Rename test file

* Use shorthand

* Add support checking functions

* Remove convertReading from JapaneseUtil
2021-07-09 17:31:16 -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
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
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
0c00c56e39
Add a script to patch bugs in dependencies (#1783) 2021-07-02 16:59:36 -04:00
toasted-nutbread
af706dea7e
Add prepare functionality to the TemplateRendererProxy shim (#1775) 2021-06-27 20:30:37 -04:00
toasted-nutbread
002da9fba8
Structured content style json (#1771)
* Install css

* Remove unnecessary rule

* Create CSS overrides file

* Create script to generate CSS JSON file

* Generate JSON

* Add test
2021-06-27 17:57:00 -04:00
toasted-nutbread
6b8cd5e623
Template patcher updates (#1766)
* Don't append anything if the additions is empty

* Simplify update list
2021-06-26 23:55:06 -04:00
toasted-nutbread
73caeac0fb
Test updates (#1763)
* Allow passing of globals to custom VMs

* Add _serializeError

* Expose document to VM
2021-06-26 17:05:59 -04:00
toasted-nutbread
845070b817
Translator sorting updates (#1755)
* Update when definition sorting takes place

* Update test data

* Change order of sorting
2021-06-26 12:37:38 -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
5756885fa9
Structured content updates (#1753)
* Update schema

* Update content generation

* Update styles

* Update test data

* Update style names
2021-06-25 17:24:29 -04:00
toasted-nutbread
7ae964c830
Structured content updates (#1733)
* Add support for imageRendering

* Make crisp-edges appearance on Firefox more similar to Chrome

* Refactor

* Add background option

* Move data-image-rendering attribute

* Restructure

* Organize

* Add support for appearance

* Update test dictionary

* Update tests
2021-06-06 14:47:48 -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
003cf791b1
Update build script (#1722)
* Add support for making non-buildable variants

* Add support for running a command to assign a value

* Update chrome-dev inheritance

* Add base variant

* Update manifest to auto-fill the version based on most recent git tag

* Add support for changing the default manifest

* Change the default manifest

* Move some manifest utility functions into manifest-util.js

* Move more manifest functionality into ManifestUtil

* Revert "Update manifest to auto-fill the version based on most recent git tag"

This reverts commit 2a66e40ff24f9dc545783503bcf3404f21148356.
2021-05-31 13:24:40 -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
41c0132c59
Improve support for sandboxed iframes (#1704)
* Add more tests

* Improve handling of errors from setupFrame

* Passively handle errors when contentDocument is null
2021-05-23 12:29:54 -04:00
toasted-nutbread
ce340d7a19
Update document tests (#1703)
* Update iframe content

* Add srcdoc test
2021-05-23 10:54:28 -04:00
toasted-nutbread
d16739a83a
Json schema validation improvements (#1697)
* Create new JsonSchema class

* Add proxy handler

* Update tests

* Update validation scripts

* Update backend

* Update audio downloader

* Update options util

* Update dictionary importer

* Update json schema file reference

* Remove old json-schema.js

* Rename new json-schema.js

* Update file names

* Rename class
2021-05-22 15:45:20 -04:00
toasted-nutbread
cb0e8ef235
Remove log, clone test value before use (#1695) 2021-05-22 15:19:52 -04:00
toasted-nutbread
1096bbfa33
Update schema tests (#1693)
* Update helper functions

* Rename file

* Update deleteProperty

* Add some basic proxy tests
2021-05-22 14:01:32 -04:00
toasted-nutbread
be23acf499
Structured content image size units (#1692)
* Add support for sizeUnits on image content

* Update test data
2021-05-20 19:33:08 -04:00
toasted-nutbread
eddd028864
Add support for definitions with structured content (#1689)
* Add structured content to schema

* Add support for generating custom content

* Update importer

* Update test data

* Add verticalAlign property
2021-05-19 18:24:50 -04:00
toasted-nutbread
ae89a8f2ad
Update test valid dictionaries (#1688)
* Update test data for valid-dictionary1

* Use valid-dictionary1 instead of valid-dictionary2

* Update test data

* Remove test of valid-dictionary2

* Remove valid-dictionary2 data
2021-05-18 19:50:11 -04:00
toasted-nutbread
76276e78da
Expose search query to anki template renderer (#1686)
* Expose query and fullQuery to Anki context

* Add {search-query} marker

* Update test data

* Update tests

* Wrap search query in multiLine
2021-05-17 20:18:37 -04:00
toasted-nutbread
66d048832f
Sentence termination character mode (#1682)
* Change enableTerminationCharacters to terminationCharacterMode

* Update settings

* Update sentence extraction

* Update tests

* Add tests
2021-05-16 15:24:38 -04:00