Commit Graph

137 Commits

Author SHA1 Message Date
toasted-nutbread
8e304b83c6
Translator regex replacements (#1199)
* Add support for regex replacements during the translation process

* Allow assignment of textReplacements

* Rename

* Set up test data

* Write expected data

* Set up options

* Prevent infinite loop if regex matches empty string

* Implement setting controller

* Add support for testing pattern replacements
2021-01-03 12:12:55 -05:00
toasted-nutbread
a02891e52c
Update copyright year (#1194)
* Update copyright year

* Remove redundant Author info
2021-01-01 14:50:41 -05:00
toasted-nutbread
4650f0b542
Translator frequency data improvements (#1184)
* Specify if a frequency has a specific reading

* Make frequency data creation more standardized

* Update test data
2020-12-30 15:12:08 -05:00
toasted-nutbread
c03340c4aa
Change popupCurrentIndicatorMode default to triangle (#1161) 2020-12-22 18:22:14 -05:00
toasted-nutbread
a354becd51
Furigana distribution improvements (#1157)
* Improve furigana when reading kana is not an exact match

* Simplify group structure

* Return consistent type

* Add more tests

* Remove redundant isAmbiguous assignment

* Simplify group usage

* Add helper function

* Optimize returned arrays

* Use variable

* Remove s(p)lice calls

* Reduce number of convertKatakanaToHiragana calls

* Optimize text length access

* Optimize reading substring

* Move segmentize to a separate function

* Use var

* Use _createFuriganaSegment

* Optimize distributeFuriganaInflected
2020-12-22 11:02:19 -05:00
toasted-nutbread
abc017545c
Update the popup preview to always be visible on the settings v2 page (#1151) 2020-12-20 22:16:38 -05:00
toasted-nutbread
443d6d1956
Popup action bar options (#1140)
* Add options for action bar visibility and location

* Add settings

* Update styles

* Expose properties

* Update styles

* Update tests
2020-12-19 20:07:55 -05:00
toasted-nutbread
af9b4d2b93
Update termTags for termGrouped mode to include all definition tags (#1138)
* Update termTags for termGrouped mode to include all definition tags

* Update tests
2020-12-19 16:47:32 -05:00
toasted-nutbread
1b1b24ab35
Entry indicator update (#1134)
* Move entry current indicator rules

* Simplify rules

* Add popupCurrentIndicatorMode option

* Add option to settings page

* Expose popupCurrentIndicatorMode

* Restore asterisk current indicator

* Implement dot

* Update action button vars

* Fix tests

* Add none option

* Add triangle option
2020-12-19 15:42:44 -05:00
toasted-nutbread
05d4049f16
DOMParser replacement (#561)
* Add script to build library files

* Add built parse5 library

* Add new SimpleDOMParser which uses parse5

* Update license info

* Update MV3 build to use the new SimpleDOMParser

* Update file exclusions

* Hide/clarify license info for MV2 builds
2020-12-18 17:06:30 -05:00
toasted-nutbread
51223abfa6
Set up initial manifest v3 support (#605) 2020-12-18 15:54:05 -05:00
toasted-nutbread
c728448a4d
Maximum clipboard search length (#1118)
* Add maximumClipboardSearchLength an option

* Add setting

* Add limits

* Update tests
2020-12-18 11:24:43 -05:00
toasted-nutbread
ddb71af6bd
Add zuru deinflections (#1091)
* Update deinflector rule types

* Add deinflection rules for zuru verbs

* Add tests
2020-12-12 10:17:25 -05:00
toasted-nutbread
2484ba68d1
Add classic suru deinflection negative tests (#1090)
* Add negative tests for classic suru verbs

* Add missing test for non-negative classic: causative, potential or passive
2020-12-08 22:59:40 -05:00
toasted-nutbread
df9436bc3e
Add classic suru deinflections (#1089)
* Add classic suru deinflections

* Add tests
2020-12-08 22:39:06 -05:00
toasted-nutbread
2be81cbb77
Update/test deinflector (#1087)
* Update formatting

* Add missing rule for progressive/perfect

* Add adnomial -ki rule

* Update rules for irregular verbs

* Organize rules by rulesOut

For the most part, the order is:
  adj-i => v1 => v5 => vs => vk => other

* Add tests
2020-12-08 20:29:42 -05:00
toasted-nutbread
2910685a96
Database test updates (#1086)
* Remove unused

* Create DatabaseVM

* Update sequences in test dictionary

* Update documentation

* Add second valid testing dictionary

* Set up translator tests

* Write expected data
2020-12-08 20:27:36 -05:00
toasted-nutbread
35fbc76df4
Settings v2 testing setup (#1084)
* Add option for using settings v2

* Add options/info about settings v2

* Use settings v2 URL when applicable

* Update tests
2020-12-06 21:17:05 -05:00
toasted-nutbread
ae9a20e0de
Json schema improvements (#1078)
* Test multipleOf

* Refactor defaulting

* Use default if invalid for non-object/array properties

* Add tests
2020-11-30 18:56:28 -05:00
toasted-nutbread
34451ebf71
JapaneseUtil normalization (#1076)
* Use JapaneseUtil as a class which is manually instantiated

* Use alias function for toKana
2020-11-29 13:09:02 -05:00
toasted-nutbread
008ffdb6bf
Frequencies marker (#1074)
* Update japanese.js tests

* Simplify fallback/early exit

* Add overloads to furigana and furiganaPlain handlebars helper functions

* Expose unique expression/reading arrays (and subsequently counts)

* Add {frequencies} marker
2020-11-28 14:30:50 -05:00
toasted-nutbread
92e9f69c80
Popup style updates (#1066)
* Replace compactGlossaries option with new glossaryLayoutMode option

* Update attributes

* Update attributes

* Update color definitions

* Fix default theme scrollbar
2020-11-25 23:22:05 -05:00
toasted-nutbread
ec021964b7
Compact tags refactor (#1021)
* Update translator to flag redundant tags instead of remove

* Update how compact tags are shown in the popup

* Pass compactTags option to note builder

* Update options templates

* Add options upgrade

* Add options upgrade test
2020-11-12 20:34:11 -05:00
toasted-nutbread
219dfb4917
Add a core deepEqual function (#1018)
* Add a core deepEqual function

* Add tests
2020-11-09 21:47:25 -05:00
toasted-nutbread
16321a1f8c
Add duplicate check option (#1012)
* Add anki.checkForDuplicates option

* Use checkForDuplicates for button display

* Add property to card creation
2020-11-08 16:25:07 -05:00
toasted-nutbread
7fa4782954
Return an error code when promise main() functions fail (#1002) 2020-11-07 11:34:14 -05:00
toasted-nutbread
0b003ef2c3
Add showPopupPreview to options test (#1001) 2020-11-07 11:31:38 -05:00
toasted-nutbread
5b9d709d40
Conjugation marker (#988)
* Add {conjugation} marker

* Add info

* Add upgrade

* Update test
2020-11-04 20:39:23 -05:00
toasted-nutbread
9e57509e25
Json schema default value improvement (#964)
* Ensure value has property before using its value

* Add tests
2020-10-27 19:40:19 -04:00
toasted-nutbread
dfdefc15d3
Options fixes (#962)
* Fix default options not having the correct versions

* Move schema validation

* Remove legacy version number

* Add tests for OptionsUtil.getDefault()

* Remove unused getValidValueOrDefault
2020-10-27 19:26:30 -04:00
toasted-nutbread
bbb534eff5
Split source.js into two files (#894) 2020-10-07 18:31:28 -04:00
toasted-nutbread
6b6ee76550
Move searchTerms/searchKanji to front of object definitions (#873) 2020-09-27 11:53:07 -04:00
toasted-nutbread
cdd649ea3d
Add scan on touch move and prevent touch scroll options (#871)
* Add scanOnTouchMove/preventTouchScrolling scanning input options

* Add settings controls

* Support scanOnTouchMove in TextScanner

* Support preventTouchScrolling in TextScanner
2020-09-27 11:46:37 -04:00
toasted-nutbread
73dd578821
Add middle mouse prevention option (#868)
* Add preventMiddleMouse option to TextScanner

* Add preventMiddleMouse options

* Add options

* Apply preventMiddleMouse options
2020-09-26 19:24:21 -04:00
toasted-nutbread
c1b5976394
Scanning mouse button fixes (#866)
* Move mouse0 blocking during mousemove into options

* Update primary button detection
2020-09-26 17:51:52 -04:00
toasted-nutbread
7d78e8737f
Cache map improvements (#856)
* Update CacheMap API; get=>getOrCreate; add get; add set; add has

* Update tests

* Add more tests
2020-09-22 20:09:12 -04:00
toasted-nutbread
943ec41336
Add tests for options updating (#852) 2020-09-20 11:33:12 -04:00
toasted-nutbread
51d4e5b0ff
Dev/test script organization (#846)
* Move lint scripts

* Move dictionary-validate.js

* Move schema-validate.js

* Move createTestDictionaryArchive, remove yomichan-test.js

* Rename yomichan-util.js to util.js

* Move test/yomichan-vm.js to dev/vm.js

* Move getArgs into util.js (and fix name)

* Create test-all.js

* Update test-code script
2020-09-19 19:04:28 -04:00
toasted-nutbread
8cd5a2f75f
Profile conditions cleanup (#768)
* Remove conditions.js

* Rename profile-conditions2.js to profile-conditions.js
2020-09-04 17:53:29 -04:00
toasted-nutbread
89a83a9ed3
Add tests for data: and blob: iframe URLs (#757) 2020-08-24 20:17:10 -04:00
toasted-nutbread
a96e1c20a7
Dynamic property (#749)
* Add DynamicProperty class

* Add tests for DynamicProperty
2020-08-22 17:50:56 -04:00
toasted-nutbread
1f564b94cb
XMLDocument handling (#738)
* Add tests for SVGs

* Add more null checks for Frontend._popup

* Use null popup when on an XMLDocument
2020-08-22 13:03:35 -04:00
toasted-nutbread
a9b16bd937
Fix profile conditions unit test using old JsonSchema (#735) 2020-08-15 17:26:13 -04:00
toasted-nutbread
d582c7a0f8
JSON schema refactor (#731)
* Remove JsonSchema.clone

* Move createProxy function

* Group public properties first

* Create private version of getPropertySchema

* Mark functions as private

* Use non-static getValidValueOrDefault

* Mark private

* Make public validate function not take an info parameter

* Remove JsonSchema

* Add isValid function

* Use isValid for some tests

* Fix incorrect type
2020-08-15 17:23:09 -04:00
toasted-nutbread
d8649f40d5
JSON-schema-based profile conditions (#730)
* Add ProfileConditions class

* Add URL to VM

* Add new ProfileConditions tests
2020-08-15 17:22:23 -04:00
toasted-nutbread
587822c16e
More JSON schema improvements (#729)
* Add support for constant values

* Add contains check for arrays

* Add tests

* Simplify getValidValueOrDefault testing
2020-08-11 19:21:26 -04:00
toasted-nutbread
2a86d66092
DOM + DocumentUtil merge (#727)
* Add DOM functions to DocumentUtil

* Use DocumentUtil instead of DOM

* Remove DOM

* Move document-util.js into mixed
2020-08-09 21:07:11 -04:00
toasted-nutbread
9f8f83508e
Merge dictionary.js functions into Translator class (#726)
* Move dictFieldSplit

* Copy dictionary.js definitions into translator.js

* Convert to member functions

* Refactor names

* Remove dictionary.js

* Rename
2020-08-09 21:04:09 -04:00
toasted-nutbread
7b1838a282
Create dev utility class for some shared functionality (#724) 2020-08-09 21:00:37 -04:00
toasted-nutbread
486d44f719
Json schema improvements (#722)
* Add support for regex pattern testing

* Add tests

* Separate JsonSchemaProxyHandler statics into JsonSchemaValidator

* Use this instead of JsonSchemaValidator

* Make JsonSchemaValidator non-static

* Use cache map for regex
2020-08-09 14:18:59 -04:00