Commit Graph

38 Commits

Author SHA1 Message Date
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
7fa4782954
Return an error code when promise main() functions fail (#1002) 2020-11-07 11:34:14 -05: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
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
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
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
8a7ff6a18c
Replace XMLHttpRequest (#562)
* Replace XMLHttpRequest with fetch

* Implement fetch placeholder for tests
2020-06-13 10:23:04 -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
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
5f49f0fed2 Add tests 2020-04-18 21:33:14 -04:00
toasted-nutbread
ceb12ac415 Add support for filtering frequency metadata based on readings 2020-04-11 23:20:36 -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
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
9052ab8ebd Move dictionary import functionality into a new class 2020-03-30 20:51:20 -04:00
toasted-nutbread
93f7278586 Update dictionary schema to support pitch accent data 2020-03-28 10:25:11 -04:00
toasted-nutbread
421b60db0f
Merge pull request #387 from toasted-nutbread/yomichan-vm
Abstract Yomichan extension script execution
2020-03-04 21:24:39 -05:00
toasted-nutbread
7a51a0fbde Abstract Yomichan extension script execution 2020-03-02 22:20:47 -05:00
siikamiika
bd48d2f919 fix Yomichan core message issues 2020-03-02 10:35:46 +02:00
toasted-nutbread
39f9bb1050 Remove hasOwn which is no longer necessary 2020-02-25 22:30:00 -05:00
toasted-nutbread
d87050bbbb Add missing copyright headers 2020-02-23 13:05:48 -05:00
toasted-nutbread
0f9f2e446d Clear timer variable 2020-02-23 11:44:24 -05:00
toasted-nutbread
6513a15b3b Fix shadowing 2020-02-22 14:54:57 -05:00
toasted-nutbread
418e7f9968 Update titles type 2020-02-22 14:43:06 -05:00
toasted-nutbread
12e0923b63 Add some basic invalid dictionaries to test 2020-02-22 13:38:03 -05:00
toasted-nutbread
7b1a1480dc Add a timeout to clearDatabase
This will trigger in case something goes wrong and a database isn't closed.
2020-02-22 13:10:30 -05:00
toasted-nutbread
a54f44122a Update location of test dictionary data 2020-02-22 12:58:33 -05:00
toasted-nutbread
4daf3435c2 Update database test 2020-02-22 12:47:09 -05:00
toasted-nutbread
1e573f36c4 Test some errors 2020-02-19 20:00:44 -05:00
toasted-nutbread
a8b1e40a1e Close to prevent hangs 2020-02-19 19:59:24 -05:00
toasted-nutbread
7901a46721 Validate results of importDictionary 2020-02-19 18:46:27 -05:00
toasted-nutbread
2829c88e7d Add script to test database.js 2020-02-18 22:19:55 -05:00