Commit Graph

17 Commits

Author SHA1 Message Date
toasted-nutbread
f76c7d74d0
Cleanup and refactoring (#2239)
* Remove unused ignoreSelectors

* Remove unused isMouseButtonPressed

* Update getWritingMode to use the immediate element if possible

* Move static functions to DocumentUtil

* Fix documentation
2022-09-27 20:17:59 -04:00
toasted-nutbread
be7855bad2
More API documentation (#2238)
* Document TextSourceRange

* Document TextSourceElement

* Document DocumentUtil

* Document DocumentFocusController
2022-09-26 19:37:14 -04:00
toasted-nutbread
75d3059451
TextSource* API updates (#2236)
* 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.
2022-09-25 09:37:33 -04:00
toasted-nutbread
da52caa152
DocumentUtil extensibility (#2234)
* Update DocumentUtil.getRangeFromPoint to be extensible

* Add documentation
2022-09-24 17:17:10 -04:00
toasted-nutbread
1e91bf151f
DocumentUtil static (#2232)
* 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
2022-09-24 16:05:19 -04:00
toasted-nutbread
480869c3d1
Exclude documentElement from zoom calculation (#2227)
* 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
2022-09-20 21:06:39 -04:00
toasted-nutbread
0b1ad40347
CSS zoom handling (#2178)
* Refactor

* Handle CSS zoom when scanning
2022-08-20 11:20:23 -04:00
toasted-nutbread
31e20c889e
ESlint JSdoc (#2148)
* 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
2022-05-20 10:28:38 -04:00
toasted-nutbread
89ac85afd0
Update copyright date (#2062)
* Update eslint settings

* Update 2021 files

* Update other files
2022-02-02 20:43:10 -05:00
toasted-nutbread
ecbbfa39a2
Fix non-text <input> elements being included in scanning content (#2034) 2021-12-14 14:55:24 -05:00
toasted-nutbread
19eb990aeb
DOMRect update (#1973)
* Compare using left/top rather than x/y

* Simplify

* Update Popup*.getFrameRect to return a custom structure

* Don't use x/y on DOMRect
2021-09-30 21:05:34 -04:00
toasted-nutbread
c364714c81
Fix hotkey input field conflict (#1963)
* 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
2021-09-26 18:14:00 -04:00
toasted-nutbread
66d048832f
Sentence termination character mode (#1682)
* Change enableTerminationCharacters to terminationCharacterMode

* Update settings

* Update sentence extraction

* Update tests

* Add tests
2021-05-16 15:24:38 -04:00
toasted-nutbread
b1f96a7ca7
Fix previousStyles being recreated for every transparent element (#1512) 2021-03-10 20:26:53 -05:00
toasted-nutbread
fce2c51709
Add support for scanning the selected value of <select> elements (#1461) 2021-02-28 13:26:23 -05:00
toasted-nutbread
28585e6ec6
Fix user select all handling (#1436)
* Update how style restoration is performed

* Refactor

* Add workaround for Firefox issue with user-select: all

* Add infinite loop prevention
2021-02-23 17:43:52 -05:00
toasted-nutbread
6a271e067f
Move mixed/js (#1383)
* Move mixed/js/core.js to js/core.js

* Move mixed/js/yomichan.js to js/yomichan.js

* Move mixed/js/timer.js to js/debug/timer.js

* Move mixed/js/hotkey-handler.js to js/input/hotkey-handler.js

* Move mixed/js/hotkey-help-controller.js to js/input/hotkey-help-controller.js

* Move mixed/js/hotkey-util.js to js/input/hotkey-util.js

* Move mixed/js/audio-system.js to js/input/audio-system.js

* Move mixed/js/media-loader.js to js/input/media-loader.js

* Move mixed/js/text-to-speech-audio.js to js/input/text-to-speech-audio.js

* Move mixed/js/comm.js to js/comm/cross-frame-api.js

* Move mixed/js/api.js to js/comm/api.js

* Move mixed/js/frame-client.js to js/comm/frame-client.js

* Move mixed/js/frame-endpoint.js to js/comm/frame-endpoint.js

* Move mixed/js/display.js to js/display/display.js

* Move mixed/js/display-audio.js to js/display/display-audio.js

* Move mixed/js/display-generator.js to js/display/display-generator.js

* Move mixed/js/display-history.js to js/display/display-history.js

* Move mixed/js/display-notification.js to js/display/display-notification.js

* Move mixed/js/display-profile-selection.js to js/display/display-profile-selection.js

* Move mixed/js/japanese.js to js/language/japanese-util.js

* Move mixed/js/dictionary-data-util.js to js/language/dictionary-data-util.js

* Move mixed/js/document-focus-controller.js to js/dom/document-focus-controller.js

* Move mixed/js/document-util.js to js/dom/document-util.js

* Move mixed/js/dom-data-binder.js to js/dom/dom-data-binder.js

* Move mixed/js/html-template-collection.js to js/dom/html-template-collection.js

* Move mixed/js/panel-element.js to js/dom/panel-element.js

* Move mixed/js/popup-menu.js to js/dom/popup-menu.js

* Move mixed/js/selector-observer.js to js/dom/selector-observer.js

* Move mixed/js/scroll.js to js/dom/window-scroll.js

* Move mixed/js/text-scanner.js to js/language/text-scanner.js

* Move mixed/js/cache-map.js to js/general/cache-map.js

* Move mixed/js/object-property-accessor.js to js/general/object-property-accessor.js

* Move mixed/js/task-accumulator.js to js/general/task-accumulator.js

* Move mixed/js/environment.js to js/background/environment.js

* Move mixed/js/dynamic-loader.js to js/scripting/dynamic-loader.js

* Move mixed/js/dynamic-loader-sentinel.js to js/scripting/dynamic-loader-sentinel.js
2021-02-13 22:52:28 -05:00