aboutsummaryrefslogtreecommitdiff
path: root/ext/js/dom
Commit message (Collapse)AuthorAge
* Simplify dom text scanner (#453)toasted-nutbread2023-12-29
| | | | | * Remove "enum" from name, update comment * Simplify
* Narrow down enum types (#431)Cashew2023-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * narrow down enum types * add enum types * change from default to case * add enum types * remove comments * remove comments * fix * Move getErrorLevelValue to Logger * Add enum type for LogErrorLevelValue * add eslint switch-exhaustiveness-check rule * Revert "add eslint switch-exhaustiveness-check" This reverts commit 49f9caabf0af900bc5ba2b80f5baff72c27e02cd. * move from labelled loop to helper functions * move helper functions downward
* Declare static fields using modern JavaScript syntax (#400)toasted-nutbread2023-12-20
|
* Fix case where element style is undefined (#399)toasted-nutbread2023-12-20
|
* Template type improvements (#380)toasted-nutbread2023-12-19
| | | | | | | * Default templates to unknown * Default typescript templates to unknown * More template type updates
* Make JSON.parse usage safer (#373)toasted-nutbread2023-12-19
| | | | | | | | | | | | | | | * Make JSON.parse usage safer * Fix any type * Add readResponseJson * Use readResponseJson * Additional updates * Rename files * Add types
* Remove dynamic-loader scripts, simplify script loading (#383)toasted-nutbread2023-12-19
|
* capture all terminators and quotes in the sentence (#360)Cashew2023-12-19
| | | | | | | | | | | | | * capture all terminators and quotes in the sentence * fix negative position, add documents and tests * fix comments giving wrong semantics * add test case coverage * remove cursor namespace for possible performance penalties * while loop optimization
* Update eslint spacing rules (#366)toasted-nutbread2023-12-17
| | | | | | | | | * Add space-infix-ops rule * Add no-multi-spaces --------- Co-authored-by: Darius Jahandarie <djahandarie@gmail.com>
* Safer query selector (#364)toasted-nutbread2023-12-17
| | | | | | | | | | | | | | | | | | | | | * Add querySelectorNotNull helper function * Use querySelectorNotNull * Updates * Update settings * Remove unused * Update * Update function calls * More updates * Update types * Remove obsolete code
* Fix usage of any (*) type in DocumentUtil (#361)toasted-nutbread2023-12-16
|
* Change no-console to error, only for ext files (#352)toasted-nutbread2023-12-11
|
* Update how ts comments are handledtoasted-nutbread2023-12-04
|
* Revert "Use import map"toasted-nutbread2023-11-27
|
* Update timer types and suchtoasted-nutbread2023-11-27
|
* Use import maptoasted-nutbread2023-11-27
|
* Update typestoasted-nutbread2023-11-27
|
* Remove unneeded referencestoasted-nutbread2023-11-27
|
* Add JSDoc type annotations to project (rebased)toasted-nutbread2023-11-27
|
* Modernize codebaseDarius Jahandarie2023-11-04
| | | | | | - Use ES modules - Remove vendored libs and build them from npm using esbuild - Switch from JSZip to zip.js
* Satisfy jsdoc/check-line-alignment lintDarius Jahandarie2023-10-01
|
* 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
|
* Cleanup and refactoring (#2239)toasted-nutbread2022-09-27
| | | | | | | | | | | * Remove unused ignoreSelectors * Remove unused isMouseButtonPressed * Update getWritingMode to use the immediate element if possible * Move static functions to DocumentUtil * Fix documentation
* More API documentation (#2238)toasted-nutbread2022-09-26
| | | | | | | | | * Document TextSourceRange * Document TextSourceElement * Document DocumentUtil * Document DocumentFocusController
* 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 extensibility (#2234)toasted-nutbread2022-09-24
| | | | | * Update DocumentUtil.getRangeFromPoint to be extensible * Add documentation
* 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
* TextSourceElement surrogate pair support (#2217)toasted-nutbread2022-08-20
| | | | | | | * Update StringUtil * Refactor * Handle UTF-16 surrogate pairs
* New StringUtil (#2216)toasted-nutbread2022-08-20
| | | | | | | * Create new StringUtil * Use StringUtil in DOMTextScanner * Fix order
* Fix setEndOffset (#2214)toasted-nutbread2022-08-20
| | | | | * Add _layoutAwareScan option to TextSourceElement.setEndOffset for parity * Remove default param
* Update DOMTextScanner to support UTF-16 surrogate pairs (#2213)toasted-nutbread2022-08-20
|
* CSS zoom handling (#2178)toasted-nutbread2022-08-20
| | | | | * Refactor * Handle CSS zoom when scanning
* Fix TextSourceElement.getRects (#2177)toasted-nutbread2022-08-20
|
* Add support for Anki API key (#2169)toasted-nutbread2022-05-30
| | | | | | | | | | | | | * Update material.css to support password fields * Support password * Add "apiKey" setting * Use apiKey * Update options if API key changes * Update tests
* Use \f rather than \x0C for whitespace form feed (#2158)toasted-nutbread2022-05-22
|
* 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
* DOMTextScanner updates (#2146)toasted-nutbread2022-05-18
| | | | | | | | | | | * JSDoc updates * Move function * Simplify * Refactor return type * Refactor getElementSeekInfo return type
* CssStyleApplier updates (#2145)toasted-nutbread2022-05-18
| | | | | | | | | * Update internal structure of _styleData * Rename parameter * Rename * Add docs
* Popup positioning improvements (#2135)toasted-nutbread2022-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename elementRect to sourceRect * Add getRects function to TextSourceElement and TextSourceRange * Add jsdocs * Remove unnecessary valid parameter * Remove default parameter * Make optionsContext optional * Remove unnecessary checks * Update sourceRect to use left/right rather than x/y * Update the return type of Popup*.getFrameRect * Rename some unrelated rect vars for disambiguation * Disambiguate between Popup.Rect and Popup.ValidRect * Move sourceRect destructuring * Pass multiple source rects * Simplify * Change Rect to use right/bottom rather than width/height * Update how popup offset is applied * Simplify frame offset * Remove _applyFrameOffset * Use right/bottom rather than width/height * Simplify some positioning settings * Update parameter names for clarity * Fix typos * Refactor data type for _getPosition* functions * Support using multiple source rects * Combine _getPosition functions * Refactor * Expose after dataset value * Consistently use this's property * Add jsdoc
* Regex optimizations (#2132)toasted-nutbread2022-05-14
| | | | | | | * Remove regex construction for SimpleDOMParser.getElementsByClassName * Remove regex construction for CssStyleApplier._getRulesForClass * Rename, add jsdoc for clarity
* Update copyright date (#2062)toasted-nutbread2022-02-02
| | | | | | | * Update eslint settings * Update 2021 files * Update other files
* Fix non-text <input> elements being included in scanning content (#2034)toasted-nutbread2021-12-14
|
* Fix typo in comments (#2032)toasted-nutbread2021-12-14
|
* DOMRect update (#1973)toasted-nutbread2021-09-30
| | | | | | | | | * Compare using left/top rather than x/y * Simplify * Update Popup*.getFrameRect to return a custom structure * Don't use x/y on DOMRect
* Hotkey dictionary navigation fix (#1970)toasted-nutbread2021-09-30
| | | | | | | * Add getRect function to ScrollElement * Update _focusEntry to take a definition index * Update behaviour of (next|previous)EntryDifferentDictionary
* 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
* Fix hotkey input field conflict (#1963)toasted-nutbread2021-09-26
| | | | | | | | | | | | | | | | | * Move comment * Add DocumentUtil.isInputElement * Use DocumentUtil.isInputElement * Fix simple hotkeys (shift or no modifier) preventing text field input * Improve input detection * Validate key is an input character before blocking hotkey * Simplify * Fix incorrect property
* Update CssStyleApplier.prepare to passively fail if it can't read the file ↵toasted-nutbread2021-08-11
| | | | (#1891)