aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language
Commit message (Collapse)AuthorAge
* fixed eslint, changed header to only use 2 spaces, added missing headers to testAustin Siew2023-03-22
|
* Updated LICENSE to full license, added Yomitan 2023 to all license headersAustin Siew2023-03-21
|
* Fix text selection not always working properly (#2246)toasted-nutbread2022-10-15
|
* TextSource* API updates (#2236)toasted-nutbread2022-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move TextSourceRange static functions to DocumentUtil getWritingMode is also simplified * Update Google Docs range to be empty to match other range sources * Rename imposterContainer to imposterElement * Add static creation functions * Add static creation function * Remove unused collapse function * Don't select imposter elements * Refactor setEndOffset * Adjust argument order for setEndOffset * Update TextSourceRange constructor * Remove unused isConnected * Cache rects * Fix test * Remove unused getRect * Revert "Fix test" * Remove cachedRect * Use the source element rect to handle scroll differences * Writing mode update * Remove _cachedRects update This shouldn't be necessary as the imposter is usually detached almost immediately after scanning, giving no time for the window to be resized or scrolled.
* DocumentUtil static (#2232)toasted-nutbread2022-09-24
| | | | | | | | | | | | | | | * Make all methods static The two non-static methods are kept for temporary compatibility * Use this instead of class name now that functions are static * Update test * Don't instantiate DocumentUtil * Remove temporary non-static methods * Remove unused global declaration
* Exclude documentElement from zoom calculation (#2227)toasted-nutbread2022-09-20
| | | | | | | | | | | | | | | * Exclude documentElement from zoom calculation * Add an option * Refactor zoom coordinate conversion functions * Convert zoom coordinates for text sources * Rename variable * Convert rect coordinate spaces * Handle shadow DOM
* Fix setEndOffset (#2214)toasted-nutbread2022-08-20
| | | | | * Add _layoutAwareScan option to TextSourceElement.setEndOffset for parity * Remove default param
* Do not change selection if user selected text manually (#2186)oakkitten2022-07-01
| | | | | | | | | | | | | | * Do not change selection if user selected text manually * Remove capture argument for selectionchange listener It is not applicable * Make a note of user selection when Yomichan is enabled User might have some text selected on a page prior to enabling Yomichan via the toolbar icon; let it stay intact. * Extract selection change by user listener into a method
* TextScanner refactor (#2174)toasted-nutbread2022-06-05
| | | | | * Refactor input conversion, add additional validation * Simplify input data structure
* Touch and pen input updates (#2172)toasted-nutbread2022-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove unnecessary return * Move touch start input filtering * Refactor * Add scanOnTouchPress * Add preventPenScrolling * Rename scanOnPenPress to scanOnPenMove * Rename scanOnPenRelease to scanOnPenReleaseHover * Simplify * Refactor _searchAtFromPen early exit * Merge _penPointerPressed and _penPointerReleased into a single variable * Add more options * Simplify pen pointer coordinates * Implement scanOnPenPress and scanOnPenRelease * Implement scanOnTouchRelease * Fix tests * Don't search on touch cancel * Cancel touch if the touch action is used for scrolling or other gestures * Fix incorrect scroll prevention options being used * Organize options * Fix typos
* Sort using number of definitions (#2166)toasted-nutbread2022-05-29
|
* Sort using frequency dictionary before using dictionary priority (#2165)toasted-nutbread2022-05-29
|
* ESlint JSdoc (#2148)toasted-nutbread2022-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Install eslint-plugin-jsdoc * Initial rules setup * Update lists * Use @returns rather than @return * Remove error throwing code which is never executed * Fix issues relating to @throws * General error fixes * Update Display type documentation * Various doc fixes * Fix invalid tuple syntax * Doc updates * Remove unused * Doc updates * Enable jsdoc/require-returns * Update rules * Update remaining rules
* Add mode documentation about the types used by Translator (#2147)toasted-nutbread2022-05-19
|
* Text scanner event capture (#2101)toasted-nutbread2022-04-02
| | | | | * Add capture parameter to event listeners * Enable capture
* Update copyright date (#2062)toasted-nutbread2022-02-02
| | | | | | | * Update eslint settings * Update 2021 files * Update other files
* Scanning wildcards (#2042)toasted-nutbread2021-12-18
| | | | | | | | | * Add scanning.matchTypePrefix option * Update TextScanner to use matchTypePrefix option * Add setting * Update warning
* matchType/deinflect distinction (#2040)toasted-nutbread2021-12-17
| | | | | | | * Pass a "deinflect" option to findTerms * Update Translator to use deinflect option * Fix test input options
* Dictionary database term source info (#2039)toasted-nutbread2021-12-17
| | | | | | | | | | | | | | | | | | | * Update DictionaryDatabase._findMultiBulk's createResult callback signature * Simplify _splitField use * Update sequence * Expose new fields 'matchType' and 'matchSource' as part of term data * Expose matchType and matchSource as part of TermSource * Update sourceTermExactMatchCount calculation * Update test data * Expose matchType and matchSource info in HTML attributes * Add primaryMatchTypes attribute
* Replace 'wildcard' parameter with 'matchType' (#2038)toasted-nutbread2021-12-17
|
* General refactoring (#2016)toasted-nutbread2021-11-21
| | | | | | | * Remove // Public comments * Fix errors * Remove source parameter from Popup*.setOptionsContext
* String frequency support (#1989)toasted-nutbread2021-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | * Restore support for string frequency values * Add support for {value, displayValue} frequencies * Update test data * Improve number parsing of string frequencies * Improve reading detection * Expose a displayValue property for frequency information * Update docs * Expose displayValue to Anki note data * Fix translator * Update display generation * Update test data * Update counts
* Search query offset value (#1968)toasted-nutbread2021-09-27
| | | | | | | | | | | * Add type property to TextSource* classes * Use type property rather than instanceof * Expose a sentence offset value * Use offset added to URL * Improve fallback sentence for Anki note context
* Katakana to hiragana conversion options (#1965)toasted-nutbread2021-09-27
| | | | | | | | | | | | | * Refactor convertKatakanaToHiragana * Add keepProlongedSoundMarks option * Test keepProlongedSoundMarks option * Refactor * Add keepProlongedSoundMarks option to hiragana handlebars helper * Update documentation
* Fix japanese codepoint range issues (#1960)toasted-nutbread2021-09-26
| | | | | | | | | * Add CJK_COMPATIBILITY_IDEOGRAPHS_RANGE * Rename CJK_UNIFIED_IDEOGRAPHS_RANGES => CJK_IDEOGRAPH_RANGES * Simplify isKana check * Update tests
* Revert term/reading string normalization due to undesirable changes (#1959)toasted-nutbread2021-09-26
|
* Enable frequency dictionaries to specify the frequency mode (#1944)toasted-nutbread2021-09-26
|
* Ensure frequency values are always numbers (#1943)toasted-nutbread2021-09-26
|
* Frequency dictionary sort (#1938)toasted-nutbread2021-09-26
| | | | | | | | | | | | | | | | | * Add sortDictionary/sortDictionaryOrder options * Update options * Add API.getTermFrequencies * Add settings * Implement frequency dictionary sorting * Update test * Update test data * Fix handling of undefined rank-based frequencies
* Fix redundant secondary term lookups (#1942)toasted-nutbread2021-09-09
|
* Normalize terms and readings during import (#1941)toasted-nutbread2021-09-09
|
* Dictionary import count details (#1935)toasted-nutbread2021-09-07
| | | | | | | | | | | * Store count information when importing a dictionary * Add importDate * Update property ordering * Update tests * Update importDate
* Fix incorrect index being used for headword removal (#1933)toasted-nutbread2021-09-05
|
* Database readwrite transaction updates (#1932)toasted-nutbread2021-09-05
| | | | | | | | | * Add _readWriteTransaction helper * Improve deleteDictionary order * Make onProgress event optional * Simplify progress rate parameter
* Dictionary media import improvements (#1926)toasted-nutbread2021-09-03
| | | | | | | | | | | | | | | | | | | * Add base64ToArrayBuffer to StringUtil * Remove unnecessary media-util.js import * Run async requirements in serial rather than parallel * Update API.getMedia handler to convert ArrayBuffer content to base64 * Rename getImageResolution to getImageDetails * Change parameter order of getImageDetails * Pre-process and store media as an ArrayBuffer * Remove MediaUtil.createBlobFromBase64Content * Fix Anki media injection
* Fix dictionary import total progress (#1921)toasted-nutbread2021-08-31
| | | | | * Fix incorrect total count for final step of dictionary import * Update tests to validate progress args
* Dictionary worker updates (#1914)toasted-nutbread2021-08-28
| | | | | | | * Add support for running getDictionaryCounts via DictionaryWorker * Run dictionary integrity checks on a separate thread * Remove api.getDictionaryCounts
* Dictionary database worker refactoring (#1913)toasted-nutbread2021-08-28
| | | | | | | | | | | | | * Rename DictionaryWorker => DictionaryWorkerHandler * Rename var * Rename file * Simplify * Rename DictionaryDatabaseModifier => DictionaryWorker * Rename dictionary-database-modifier.js => dictionary-worker.js
* Update dictionary importer progress event for step 6 to occur slightly ↵toasted-nutbread2021-08-14
| | | | earlier (#1897)
* Threaded dictionary delete (#1895)toasted-nutbread2021-08-14
| | | | | | | | | * Generalize dictionary worker * Add deleteDictionary functionality * Update DictionaryController to use DictionaryDatabaseModifier * Fix incorrect result handling
* Dictionary worker refactor (#1894)toasted-nutbread2021-08-14
| | | | | | | | | | | | | | | | | | | * Rename dictionary worker files * Rename classes * Rename file * Rename class * Generalize the _invoke method * Rename 'import' to 'importDictionary' * Improve DictionaryImporterMediaLoader usage * Refactor message handler * Generalize onProgress event
* Database improvements to data persistency (#1893)toasted-nutbread2021-08-13
| | | | | | | | | | | | | * Fix function check * Rename arguments of getAll, getAllKeys, and their private functions * Simplify bulkAdd * Simplify delete * Simplify bulkDelete * Remove persistData
* Fix data not being persisted after terminating Worker thread (#1877)toasted-nutbread2021-08-07
|
* Dictionary import progress improvements (#1868)toasted-nutbread2021-07-31
| | | | | | | * Update loop vars * Update loop * Improve progress reporting during the import process
* Dictionary importer refactoring (#1867)toasted-nutbread2021-07-31
| | | | | | | | | * Remove map of schemas * Don't reuse dictionary importer instances * Refactor * Update how progress callback is used
* Dictionary importer refactor (#1866)toasted-nutbread2021-07-31
| | | | | | | | | | | | | * Move function implementations * Use file() instead of files[] * Move functionality into local functions * Simplify * Pass dictionary title to conversion functions * Update how legacy tags are added
* DictionaryImporterThreaded (#1865)toasted-nutbread2021-07-31
| | | | | | | * Create new classes for importing dictionaries from a separate thread * Use threaded importer * Update worker tests
* DictionaryImporter improvements (#1862)toasted-nutbread2021-07-31
| | | | | * Improve error message * Simplify URL for JSON fetching
* DictionaryImporterMediaLoader (#1860)toasted-nutbread2021-07-31
| | | | | | | | | * Rename param for consistency * Move media loading functionality into DictionaryImporterMediaLoader * Create test class for media loading * Remove unnecessary Blob/Image/URL functionality
* Improve dictionary importer (#1859)toasted-nutbread2021-07-31
| | | | | | | * Optimize dictionary data parsing during import * Use ArrayBuffer instead of string * Add missing function for testing