Commit Graph

249 Commits

Author SHA1 Message Date
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
toasted-nutbread
de6db32aa6
Improve source term exact match count (#1674)
* Update sourceTermExactMatchCount to be based on headword count

* Update tests
2021-05-14 19:26:27 -04:00
toasted-nutbread
289bdc1622
Improve term grouping (#1653)
* Rename _addUniqueStrings to _addUniqueSimple

* Update definition merging to not depend the sequence number

* Improve naming

* Update AnkiNoteDataCreator

* Update docs

* Remove fields that no longer exist

* Update test data
2021-05-08 13:16:56 -04:00
toasted-nutbread
c514bbc4fb
Flags profile conditions (#1647)
* Generalize modifier keys

* Optimize bindings

* Add support for flags

* Add clipboard flag

* Update tests

* Add tests
2021-05-01 15:54:31 -04:00
soriac
ba3f7b3e96
Show any custom tags on words that have anki cards created (#1628)
* Proof-of-concept for showing card tags (#1626)

* Resolved most PR comments:
- Added a snackbar notification when clicking tag button
- Replaced magnifying glass icon with new tag icon
- Button now contains a span w/icon, to use text color
- Removed unnecessary attributes from button
- Backend now returns full noteInfos object
- Frontend now handles filtering tags

* Add options to show/hide tag button & filter tags

* Do not show tags button if, after filtering, we have zero tags.

* Change tags option to enums, optimize tags intersection check & fix code style.

* Update options-util.js to include new tag options.

* Fix wording on new tag setting.

* Add CSS to remove hidden buttons from the display layout.

* getAnkiNoteInfo extra parameter for additional info.

* Add new tag option to tests.

* Remove unnecessary changes related to anki tags option.

* Code style fixes.
2021-04-30 17:57:53 -04:00
toasted-nutbread
512391346b
Translator alphanumeric improvement (#1635)
* Simplify alphanumeric check

* Update option name for clarity
2021-04-28 21:17:05 -04:00
toasted-nutbread
03dd1dc6ff
Remove redundant dictionary entry sequence (#1618)
* Remove sequence/sequenceDictionary from dictionary entry objects

* Expose isPrimary on definitions

* Update sequence

* Update test data
2021-04-18 18:11:09 -04:00
toasted-nutbread
f9774b4ce9
Improve dictionary sequence info (#1617)
* Ensure negative sequence is always -1

* Expose sequence on definition objects

* Update how sequence is exposed for definitions

* Update test data

* Update TS docs
2021-04-18 18:08:02 -04:00
toasted-nutbread
609d4fe334
Replace furigana with reading (#1614)
* Use "reading" instead of "furigana" for reading distribution

* Update tests
2021-04-13 20:32:24 -04:00
toasted-nutbread
e14b52ef84
Update dictionary entry terminology (#1592)
* Update terminology

* Update terminology in display.js

* Update terminology in display-audio.js

* Update terminology in text-scanner.js

* Update terminology in backend.js

* Update terminology in mecab.js

* Update terminology in audio-downloader.js

* Update terminology in translator-vm.js

* Update terminology in dictionary-data-util.js

* Update terminology in dictionary-database.js

* Update terminology in japanese-util.js

* Change/upgrade {expression} to {term}

* Update terminology in test-japanese.js

* Update terminology in test-database.js

* Update terminology in anki-templates-controller.js

* Update terminology in anki-note-builder.js

* Update terminology in backend.js

* Update terminology in text-scanner.js

* Update terminology in display.js

* Update terminology in display.js
2021-04-04 16:22:35 -04:00
toasted-nutbread
b8bedd5185
Improve term dictionary entry sequence (#1591)
* Improve sequence for merged entries and add sequenceDictionary

* Update docs

* Expose sequence in definitions

* Expose sequence in root definition

* Update test data
2021-04-03 15:41:44 -04:00
toasted-nutbread
a9fe2d03b2
Update dictionary settings structure (#1587)
* Update dictionary settings structure to use an array instead of an object

* Update ensureDictionarySettings implementation

* Remove some usage of ObjectPropertyAccessor
2021-04-03 13:02:49 -04:00
toasted-nutbread
dabda86259
Optimize template renderer (#1585)
* Add renderMulti

* Batch template rendering

* Update tests
2021-04-02 19:09:21 -04:00
toasted-nutbread
28fa3fa795
Move test VM crypto definition (#1584) 2021-04-02 12:43:37 -04:00
toasted-nutbread
8179846e38
Refactor template rendering (#1583)
* Update _errorToJson to _serializeError

* Remove async

* Refactor render

* Simplify _getModifiedData

* Rename data => commonData

* Rename templates => template for consistency

* Improve errors check

* Update tests
2021-04-02 12:42:06 -04:00
toasted-nutbread
bcbd413e57
Definition collapsing when overflowing (#1575)
* Add double-down-chevron.svg

* Add options

* Update dictionary importers

* Update settings

* Add support for collapsible definitions

* Improve case when there is a very small amount of overflow

* Fix incorrect enabled state of newly imported dictionaries
2021-03-31 18:17:28 -04:00