Commit Graph

795 Commits

Author SHA1 Message Date
toasted-nutbread
de299c64ae
Display updates (#1057)
* Fix history assignment on the search page

* Use clear instead of assigned

* Simplify definitions assignment

* Organize

* Fix query not being cleared

* Fix media loading

* Fix potential issue with options not being assigned

* Catch error when frameId is null, causing infinite loop

* Fix frontend construction parameters
2020-11-24 11:54:08 -05:00
toasted-nutbread
068b1eef71
Text scanner improvements (#1056)
* Only ignore nodes on non-web pages

* Fix issue where options might not be assigned on nested frontends

* Refactor default TextScanner options

* Add option to enable search only on click

* Simplify restore state assignment

* Update options context passing

* Fix empty title

* Use TextScanner to scan content inside of Display

* Rename ignoreNodes to excludeSelector(s)

* Fix options update incorrectly triggering a re-search

* Fix copy throwing an error on the search page

* Replace _onSearchQueryUpdated with _search

* Use include selector instead of exclude selector
2020-11-23 20:31:48 -05:00
toasted-nutbread
01ff7436ee
Popup setup refactoring (#1054)
* Pass childrenSupported as a parameter to Frontend/Popup constructors

* Remove setChildrenSupported

* Use event listener instead of function override

* Update options order

* Expand options and use object for clarity

* Fix childrenSupported not being fully propagated
2020-11-23 15:23:47 -05:00
toasted-nutbread
2971f262f9
Merge float into display (#1053)
* Update audio play delay

* Move frame endpoint to Display

* Move _invokeOwner and close implementation

* Move browser info assignment

* Move window message handler setup

* Move copy implementation

* Move document title function

* Move extension unload handler

* Move close handler

* Move history event handlers

* Remove DisplayFloat

* Remove unused

* Organize

* Move event listeners into prepare
2020-11-22 15:29:51 -05:00
toasted-nutbread
7234cce4ae
Refactor nested popup/frontend setup (#1052) 2020-11-22 11:19:21 -05:00
toasted-nutbread
73cb2c763c
Update indentation (#1047) 2020-11-20 22:57:14 -05:00
toasted-nutbread
181ade93d6
Display scroll fixes (#1046)
* Update focus when internal focus is changed

* Update scroll layout
2020-11-20 22:42:49 -05:00
toasted-nutbread
e9075e24e1
Update progress indicator styles (#1042) 2020-11-18 20:06:02 -05:00
toasted-nutbread
ea7b8621c3
Update layout to have better sizing properties (#1040) 2020-11-16 20:41:12 -05:00
toasted-nutbread
37ea7e2c9a
Add support for dark theme scrollbar colors (#1038) 2020-11-15 14:39:37 -05:00
toasted-nutbread
2e3169f68c
Popup navigation style updates (#1035)
* Add close function to Display

* Add new sidebar with navigation and close buttons

* Set up new navigation functionality

* Remove old navigation
2020-11-15 14:12:48 -05:00
toasted-nutbread
c387898902
Display fixes (#1033)
* Fix an entry not always being focused

* Fix typo

* Fix copy action not working on Firefox
2020-11-14 21:47:43 -05:00
toasted-nutbread
4b1c7b1e26
Display layout updates (#1032)
* Fix display scroll not always using the right position

* Update display layout and scroll method

* Fix border size
2020-11-14 18:12:06 -05:00
toasted-nutbread
50a1fbfb9f
Display updates (#1029)
* Simplify expression creation

* Add attribute indicating whether the reading is the same or not

* Update kanji debug info

* Remove some unnecessary null checks

* Simplify iterable check

* Update float and search HTML to be more consistent
2020-11-14 13:42:50 -05:00
toasted-nutbread
d62d353958
Fix options not being propagated fully after being updated (#1025) 2020-11-13 19:51:51 -05:00
toasted-nutbread
f2ad94e54f
Text scanning options propagation (#1020)
* Update Display.setOptionsContext to update options

* Update how options context is updated in Popup

* Omit optionsContext for some _showPopupContent calls

* Remove extension unload

* Disable modifier keys in frontend's options context

* Update how text scanner passes modifiers to options context

* Update how options context is passed to display

* Update how display uses options context
2020-11-12 20:32:46 -05:00
toasted-nutbread
eb8069a494
Options context updates (#1017)
* Update event order

* Update inputs

* Add type and cause to input info

* Update input info args

* Simplify arguments

* Update argument name

* Change order
2020-11-08 22:55:43 -05:00
toasted-nutbread
3a23f081d1
Frontend options override refactor (#1016)
* Update how options context overriding works

* Make function private
2020-11-08 22:49:40 -05:00
toasted-nutbread
8edb478d0a
Update keyboard/mouse modifiers to return an array rather than a set (#1015) 2020-11-08 22:19:54 -05:00
toasted-nutbread
6081e3bef0
Make query parser mode select in the base HTML (#1009) 2020-11-08 13:25:07 -05:00
toasted-nutbread
8dc961a61f
Merge QueryPaserGenerator into QueryParser (#1008) 2020-11-08 12:50:16 -05:00
toasted-nutbread
8cf10d685d
Search and display style updates (#1005)
* Use same selectors

* Use consistent stylesheet declaration

* Fix query parser not being cleared

* Set property upon load

* Don't focus for Enter key press

* Update search page styles

* Update indent and nodes

* Support dark style

* Add missing var
2020-11-08 12:34:23 -05:00
toasted-nutbread
6f980d8f2b
Text source range refactor (#949)
* Rename functions for better clarity

* Remove unused properties

* Add getNodesInRange function

* Improve ignore nodes check

* Use private fields
2020-10-20 20:54:26 -04:00
toasted-nutbread
ecbac2c5ea
Popup preview improvements (#947)
* Move CSS

* Update indent

* Refactor HTML/CSS

* Add support for editing the source text

* Add WanaKana binding for input

* Rename file
2020-10-20 19:08:17 -04:00
toasted-nutbread
cb1902eadd
Template handler update (#896)
* Rename TemplateHandler to HtmlTemplateCollection

* Rename _templateHandler to _templates

* Allow creation from both string and element

* Simplify setup of templates, don't throw errors on invalid ID
2020-10-07 20:47:44 -04:00
toasted-nutbread
bbb534eff5
Split source.js into two files (#894) 2020-10-07 18:31:28 -04:00
toasted-nutbread
2f96218e33
Fix search page being focused when changing settings (#892) 2020-10-06 21:21:54 -04:00
toasted-nutbread
73dd578821
Add middle mouse prevention option (#868)
* Add preventMiddleMouse option to TextScanner

* Add preventMiddleMouse options

* Add options

* Apply preventMiddleMouse options
2020-09-26 19:24:21 -04:00
toasted-nutbread
9c7b9d6660
Fix page type never being detected as search page correctly (#867) 2020-09-26 18:47:58 -04:00
toasted-nutbread
f18c28e519
Fix displayDetails not being properly null checked (#865) 2020-09-26 13:48:06 -04:00
toasted-nutbread
0b51488f1f
Audio system refactor (#858)
* Refactor AudioUriBuilder

* Add downloadAudio function

* Refactor AudioSystem

* Update API usage

* Rename file

* Update scripts

* Add prepare calls
2020-09-26 13:41:26 -04:00
toasted-nutbread
2f4adbab2c
Handlebars sandbox (#612)
* Set up template renderer proxy

* Use proxy

* Remove unused handlebars script tags

* Update manifest
2020-09-18 21:16:39 -04:00
toasted-nutbread
ad8e9fe8e2
Add missing null check (#836) 2020-09-17 20:22:29 -04:00
toasted-nutbread
5b49cf4398
Pointer events support (#819)
* Add option pointerEventsEnabled

* Add _pointerEventsEnabled option to TextScanner

* Add additional options

* Mouse pointer events

* Touch pointer events

* Pen pointer events
2020-09-13 11:33:10 -04:00
toasted-nutbread
568775c6dc
Text scanner cause update (#813)
* Rename _searchAtFromMouse to _searchAtFromMouseMove

* Rename cause 'mouse' to 'mouseMove' for clarity
2020-09-11 22:46:41 -04:00
toasted-nutbread
a531618c48
Use Anki classes directly in Display (#804)
* Add _getTemplates function

* Add template renderer to display pages

* Add AnkiNoteBuilder to Display

* Update AnkiTemplatesController to directly use TemplateRenderer

* Remove old APIs
2020-09-10 18:03:46 -04:00
toasted-nutbread
52b0feb255
Move TextToSpeechAudio to a separate file (#800) 2020-09-10 12:06:56 -04:00
toasted-nutbread
0d00f7e1cf
Scanning input generalization (#789)
* Add inputs to options.scanning

* Update CSS for mouse buttons

* Update list counters

* Set up HTML/CSS

* Add input controller

* Use new inputs

* Include mouse buttons

* Update how button inputs are detected

* Add index/empty fields to the input details object

* Update none check for scanning modifier

* Remove old settings

* Remove unused global
2020-09-09 16:59:03 -04:00
toasted-nutbread
e3a7678769
Anki screenshot refactor (#791)
* Use more consistent style for injectScreenshot

* Move screenshot generation into AnkiNoteBuilder/Backend

* Get optionsContext before await
2020-09-09 12:54:59 -04:00
toasted-nutbread
b687870a55
Delay hide option (#774)
* Add hideDelay option

* Add _clearSelection

* Use hideDelay

* Prevent repeated delayed selection clears

* Fix popup hide timer being cleared when the cursor is moved into the frame
2020-09-08 19:40:15 -04:00
toasted-nutbread
46af4c9da4
Text scanner fixes and refactoring (#788)
* Fix incorrect argument being passed

* Clear causeCurrent

* Change cause string to a more general input object
2020-09-08 19:23:32 -04:00
toasted-nutbread
c1b16cebe7
Refactor how TextScanner's public search() function is used (#787) 2020-09-08 18:52:23 -04:00
toasted-nutbread
44f38c4dea
Popup window (#773)
* Add option usePopupWindow

* Add PopupWindow class

* Add support for creating PopupWindow
2020-09-05 22:03:35 -04:00
toasted-nutbread
2f8408ffcc
Text scanner refactor (#771)
* Create searchAt wrappers

* Add optional support for searching on the click event

* Update QueryParser to use TextScanner's searchOnClick functionality

* Move/rename searchAt

* Move pendingLookup checks

* Add 'searched' event to TextScanner

* Use common searched event for Frontend and QueryParser

* Move functions, make private
2020-09-05 21:43:19 -04:00
toasted-nutbread
95bfe2d901
Popup proxy improvements (#764)
* Fix incorrect function invocations

* Ignore setVisibleOverride when it returns null

* Omit redundant async

* Change default return value
2020-09-04 17:58:43 -04:00
toasted-nutbread
4cd1676ddc
Handle error if _waitForFrontendReady fails when creating a popup proxy (#760) 2020-09-04 17:55:25 -04:00
toasted-nutbread
773e28aa3c
Fix screenshot popup hide (#753)
* Refactor Popup.setVisibleOverride

* Use event to observe visibility changes

* Add setAllVisibleOverride/clearAllVisibleOverride

* Add setAllVisibleOverride/clearAllVisibleOverride cross frame handlers

* Update how visibility is changed

* Wait for next frame to ensure visibility has been updated
2020-08-23 15:18:41 -04:00
toasted-nutbread
1ab853a4d5
Display owner frame (#751)
* Move ownerFrameId definition to Display

* Rename _invoke to _invokeOwner
2020-08-23 11:15:23 -04:00
toasted-nutbread
f0c974d319
Move generateId to core.js (#748) 2020-08-22 15:49:24 -04:00
toasted-nutbread
9fa0f2a56a
Move findTerms and findKanji functions into TextScanner (#747) 2020-08-22 14:40:44 -04:00