Commit Graph

88 Commits

Author SHA1 Message Date
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
toasted-nutbread
6da02c6eee
document.js refactor (#719)
* Refactor document.js into a class

* Move public functions first

* Rename private functions

* Rename

* Rename argument

* Use instance of DocumentUtil

* Update tests

* Refactor

* Rename (test-)document.js to (test-)document-util.js
2020-08-09 13:27:21 -04:00
toasted-nutbread
d856e4caac
CacheMap (#715)
* Create CacheMap class

* Add test
2020-08-09 13:15:56 -04:00
toasted-nutbread
04d47bf8a9
Build system changes (#721)
* Refactor manifest.json

* Change end-of-line convention for built plain-text files

* Ignore builds directory

* Mark the "dev" directory as using the node environment

* Create build script

* Register build scripts

* Remove old build script

* Fix 64x64 icon

* Add test to ensure manifest data is updated properly
2020-08-09 13:09:06 -04:00
toasted-nutbread
b1b33f8beb
Fix fetch requests (#708)
* Revert audio fetching functionality to use XMLHttpRequest

* Replace requestJson

* Replace requestJson

* Replace requestJson

* Replace requestJson and requestText

* Fix tests

* Include support for vulgar word searches

* Remove request.js
2020-08-02 13:30:55 -04:00
toasted-nutbread
d7aaab685e
Dev dependencies updates (#679)
* Update eslint to 7.5.0

* Update eslint-plugin-no-unsanitized to 3.1.2

* Update fake-indexeddb to 3.1.1

* Rename DictionaryImporter.import to .importDictionary

Conflicts with o-unsanitized/method
2020-07-19 22:05:37 -04:00
toasted-nutbread
a16a8f53e6
Rename GenericDatabase to Database (#634) 2020-06-28 17:29:16 -04:00
toasted-nutbread
441c23bf3b
Rename Database to DictionaryDatabase (#633) 2020-06-28 17:24:06 -04:00
toasted-nutbread
cdf191336a
Clone function (#624)
* Add clone function

* Replace utilIsolate with clone

* Replace JsonSchema.isolate with clone function

* Include core.js for tests which use json-schema.js

* Update visisted set
2020-06-28 12:38:34 -04:00
toasted-nutbread
5bf805755a
Yomichan object separation (#627)
* Move "yomichan" object setup to a separate file

* Update script imports

* Align message handlers

* Rename Yomichan.prepare to Yomichan.ready

* Add new prepare function

* Improve isExtensionUrl
2020-06-28 11:26:43 -04:00
toasted-nutbread
244ab31bb2
Generic database (#600)
* Update test

* Rename db to _db

* Create GenericDatabase class

* Catch prepare error

* Allow database to be purged even if it was not open

* Remove unused functions

* Change static functions to non-static

* Delete and count using the media object store

* Update tests
2020-06-21 16:12:56 -04:00
toasted-nutbread
e23504613f
Use DOMTextScanner (#536)
* Use DOMTextScanner instead of TextSourceRange.seek*

* Move getNodesInRange to dom.js

* Move anyNodeMatchesSelector to dom.js

* Remove unused functions

* Update tests

* Add layoutAwareScan option

* Use layoutAwareScan for source and sentence scanning

* Remove unused IGNORE_TEXT_PATTERN
2020-06-21 16:07:51 -04:00
toasted-nutbread
8a7ff6a18c
Replace XMLHttpRequest (#562)
* Replace XMLHttpRequest with fetch

* Implement fetch placeholder for tests
2020-06-13 10:23:04 -04:00
toasted-nutbread
f85508a25e
Simplify shadow test and add an open shadow DOM test (#533) 2020-05-10 14:09:04 -04:00
toasted-nutbread
f361139d74
Japanese util refactor (#510)
* Convert mixed japanese.js to utility class

* Copy functions from bg/js/japanese.js into mixed/js/japanese.js

* Remove bg/js/japanese.js

* Make wanakana dependency optional

* Update tests
2020-05-06 19:37:36 -04:00
toasted-nutbread
d6ae322961
Text scanning update (#507)
* Fix unity test missing a parameter

* Update docSentenceExtract to not rescan content
2020-05-06 19:34:32 -04:00
toasted-nutbread
f7df6254d6
Dom text scanner fixes (#505)
* Fix test case

* Add test-dom-text-scanner

* Ensure that DOMTextScanner._node never becomes null

* Add remainder
2020-05-06 19:33:17 -04:00
toasted-nutbread
021ccb5ac3
Move util database modification functions (#499)
* Update onProgress callback to handle multiple arguments

* Add apiImportDictionaryArchive

* Add apiDeleteDictionary

* Make onProgress the last argument for consistency

* Remove deprecated util functions

* Fix issue with missing progress args

* Remove function calls which modify the database from Translator

* Update tests

* Fix errors not being serialized correctly in _createActionListenerPort
2020-05-06 19:28:26 -04:00
toasted-nutbread
d4ae9aa501
DOMTextScanner (#458)
* Create new class for scanning text in a document

* Update test styles

* Add tests
2020-05-02 13:05:43 -04:00
toasted-nutbread
401fe9f8d0
Object property accessor API update (#485)
* Simplify function names

* Add delete and swap functions

* Remove custom setter

Not currently part of the expected use cases.

* Add documentation

* Update tests

* Add delete test functions

* Update tests to use fresh objects

* Add swap test functions

* Add empty tests

* Disable delete on arrays
2020-05-02 12:57:42 -04:00
toasted-nutbread
5b96559df8
Error logging refactoring (#454)
* Create new logging methods on yomichan object

* Use new yomichan.logError instead of global logError

* Remove old logError

* Handle unhandledrejection events

* Add addEventListener stub

* Update log function

* Update error conversion to support more types

* Add log event

* Add API log function

* Log errors to the backend

* Make error/warning logs update the badge

* Clear log error indicator on extension button click

* Log correct URL on the background page

* Fix incorrect error conversion

* Remove unhandledrejection handling

Firefox doesn't support it properly.

* Remove unused argument type from log function

* Improve function name

* Change console.warn to yomichan.logWarning

* Move log forwarding initialization into main scripts
2020-04-26 16:55:25 -04:00
toasted-nutbread
a761e42084 Update tests 2020-04-22 21:37:28 -04:00
toasted-nutbread
99c1a6a6bc Change some test variables using 'source' instead of 'content' 2020-04-19 10:57:33 -04:00
toasted-nutbread
5f49f0fed2 Add tests 2020-04-18 21:33:14 -04:00
siikamiika
c992e7f920 add manual performance tests 2020-04-18 23:28:00 +03:00
siikamiika
fbaf50def1 support iframes inside open shadow dom 2020-04-18 23:28:00 +03:00
toasted-nutbread
9297eb45ae
Merge pull request #450 from toasted-nutbread/frequency-readings
Add support for filtering frequency metadata based on readings
2020-04-18 14:14:30 -04:00
siikamiika
8c16a6e580
Merge pull request #456 from siikamiika/parse-text-refactor
Parse text refactor
2020-04-17 01:32:01 +03:00
toasted-nutbread
bf971be15b
Merge pull request #444 from toasted-nutbread/unused-globals
Check for unused globals as part of CI
2020-04-13 18:55:19 -04:00
siikamiika
6cc87ec975 remove "fragment" from jp.convertReading variables 2020-04-13 22:59:56 +03:00
siikamiika
f93dc85710 assume and propagate strings for text parsing 2020-04-13 22:55:33 +03:00
toasted-nutbread
649adb13d8
Merge pull request #440 from toasted-nutbread/collapse-emphatic-sequences
Add support for collapsing emphatic character sequences
2020-04-12 11:42:46 -04:00
toasted-nutbread
ceb12ac415 Add support for filtering frequency metadata based on readings 2020-04-11 23:20:36 -04:00
toasted-nutbread
92f2466cff Add tests, remove logs 2020-04-11 16:53:29 -04:00
toasted-nutbread
e7abeb02a6 Add simple check to see if globals are unused 2020-04-10 18:45:16 -04:00
4e5029f7ec Update license author field to broader to explicitly reflect that
Yomichan is an ongoing community project. It really does take a village,
and everyone who contributes code owns a part of it :)
2020-04-10 11:10:21 -07:00
toasted-nutbread
fb87b1ad69 Add tests 2020-04-10 12:31:06 -04:00
siikamiika
668be6224b add fake chrome.runtime.onMessage.removeListener 2020-04-05 19:57:37 +03:00
toasted-nutbread
3684a479c5
Merge pull request #424 from toasted-nutbread/dictionary-importer
Dictionary importer
2020-04-05 12:52:07 -04:00
toasted-nutbread
058f626efd
Merge pull request #423 from toasted-nutbread/text-source-map
Text source map
2020-04-05 12:51:56 -04:00
toasted-nutbread
f439d12718
Merge pull request #385 from toasted-nutbread/pitch-accents
Pitch accents
2020-04-05 12:51:27 -04:00
toasted-nutbread
a4c7d243f4 Add allowfullscreen="true" 2020-04-04 20:21:39 -04:00
toasted-nutbread
ae246093a9 Create some tests for fullscreen elements, <iframe>s, and shadow DOMs 2020-04-04 16:56:06 -04:00
toasted-nutbread
9052ab8ebd Move dictionary import functionality into a new class 2020-03-30 20:51:20 -04:00
toasted-nutbread
7225201fb6 Add tests 2020-03-28 18:25:56 -04:00
toasted-nutbread
ae84d13757 Create simplified source map class 2020-03-28 18:17:00 -04:00
toasted-nutbread
0d80fcdf86 Move Japanese utility functions out of display-generator.js 2020-03-28 10:47:02 -04:00
toasted-nutbread
93f7278586 Update dictionary schema to support pitch accent data 2020-03-28 10:25:11 -04:00
toasted-nutbread
780d23b749 Add more tests for convertReading 2020-03-21 14:12:22 -04:00
toasted-nutbread
77a2cc60e9 Move basic string/character testing functions into a mixed/js/japanese.js 2020-03-21 13:18:34 -04:00