Commit Graph

326 Commits

Author SHA1 Message Date
toasted-nutbread
fced59a213
Fix source name not being used (#2036) 2021-12-14 22:03:34 -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
0356241362
Fix typo in comments (#2032) 2021-12-14 14:54:36 -05:00
toasted-nutbread
f2102ade4c
Add AccessibilityController class, which dynamically registers (#2024)
and unregisters the google-docs.js content script
2021-11-23 22:23:14 -05:00
toasted-nutbread
d454b52a18
Google Docs accessibility refactor (#2023)
* Skip urlRegex if it's used as a filter

* Add getRequiredContentScriptRegistrationPermissions function

* Add a reentrant check to google-docs.js

* Remove script node

* Move forceGoogleDocsHtmlRendering check into google-docs.js

* Replace document-start.js usage with google-docs.js

* Remove documentStart handling

* Add missing parameter descriptions
2021-11-23 22:08:30 -05:00
toasted-nutbread
ecc994a8bb
ScriptManager updates (#2022)
* Fix spacing

* Add more parameters to injectStylesheet

* Add more parameters to injectScript

* Update ScriptManager to support content script registration

* Add webNavigation as an optional permission
2021-11-23 16:16:13 -05:00
toasted-nutbread
cedf6b25c4
ScriptManager (#2021)
* Create ScriptManager class

* Use ScriptManager in Backend
2021-11-22 19:29:20 -05:00
toasted-nutbread
005f9658d9
Action handler name disambiguation (#2018)
* Disambiguate PopupFactory action handlers

* Update HotkeyHandler action names

* Disambiguate Frontend action handlers

* Disambiguate Display action handlers

* Disambiguate PopupPreviewFrame action handlers

* Disambiguate Yomichan action handlers

* Disambiguate Frontend action handlers

* Disambiguate Display action handlers

* Disambiguate SearchDisplayController action handlers
2021-11-21 15:54:58 -05:00
toasted-nutbread
06e70c1cd8
FrameOffsetForwarder fixes (#2017)
* Fix handling of null iframe rect

* Handle errors inside of getOffset
2021-11-21 15:08:39 -05:00
toasted-nutbread
36967b1839
General refactoring (#2016)
* Remove // Public comments

* Fix errors

* Remove source parameter from Popup*.setOptionsContext
2021-11-21 12:34:57 -05:00
toasted-nutbread
3c798ae36d
Refactor isExtensionUrl (#2015)
* Update isExtensionUrl to work even if the extension is unloaded

* Simplify
2021-11-21 12:27:29 -05:00
toasted-nutbread
70ac6c51f9
Don't clear the selection before the text scanner has been enabled (#2006) 2021-11-13 11:11:33 -05:00
toasted-nutbread
657292733d
Fix search page not being cleared properly (#2005) 2021-11-13 09:29:58 -05:00
toasted-nutbread
2dc8394c72
JSDoc update (#1996)
* Update core.js docs to include types.

* Update docs
2021-10-31 21:45:57 -04:00
toasted-nutbread
f978819a33
Don't stop audio playback when hiding a popup (#1995) 2021-10-21 19:56:43 -04:00
toasted-nutbread
9ae38bd8e9
Display menu button (#1992)
* Implement new menu which includes a debug log option

* Update wording
2021-10-17 09:55:13 -04:00
toasted-nutbread
ca4ed0300b
Display button updates (#1991)
* Update display buttons

* Remove use of _addMultipleEventListeners
2021-10-17 00:15:43 -04:00
toasted-nutbread
75aabd983d
String frequency support (#1989)
* 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
2021-10-14 21:26:53 -04:00
toasted-nutbread
11f7591a7f
Fix query being set to null when an empty search page is opened (#1988) 2021-10-14 21:16:40 -04:00
Shadowlauch
b3d38fce47
fix DOMRect for vertical position calculation (#1986) 2021-10-14 19:29:52 -04:00
toasted-nutbread
0a8992d215
Search query back button (#1981)
* Always allow history to go back/forward when using browser history

* Add a back button which is visible when using the query parser
2021-10-09 17:06:51 -04:00
toasted-nutbread
e3986196e1
Disable background clipboard monitor, mecab, and anki if disabled (#1977) 2021-10-03 16:46:22 -04:00
toasted-nutbread
be8ef53e90
Display refactoring (#1978)
* Refactor _setContentTermsOrKanji

* Update query assignment

* Simplify

* Remove redundant _updateQueryParser

* Reorder query assignment

* Remove isTerms, replace with isKanji

* Simplify defaults

* Refactor events

* Update DisplayAnki to use events

* Simplify

* Update DisplayAudio to use events

* Simplify

* Move audio hotkeys

* Add frameVisibilityChange event

* Fix name

* Add logDictionaryEntryData event

* Move clearAutoPlayTimer handler

* Fix call

* Externalize DisplayAnki and DisplayAudio from Display

* Simplify clear
2021-10-03 16:46:15 -04:00
toasted-nutbread
52e4bc8e6a
Add disable-popup-preview option to the settings page (#1974) 2021-09-30 21:12:26 -04: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
55a7e7f9a8
Hotkey dictionary navigation fix (#1970)
* Add getRect function to ScrollElement

* Update _focusEntry to take a definition index

* Update behaviour of (next|previous)EntryDifferentDictionary
2021-09-30 19:31:45 -04:00
toasted-nutbread
b0f6c41f5d
Search query offset value (#1968)
* 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
2021-09-27 19:07:28 -04:00
toasted-nutbread
b784e5b11a
Katakana to hiragana conversion options (#1965)
* Refactor convertKatakanaToHiragana

* Add keepProlongedSoundMarks option

* Test keepProlongedSoundMarks option

* Refactor

* Add keepProlongedSoundMarks option to hiragana handlebars helper

* Update documentation
2021-09-27 18:19:53 -04:00
toasted-nutbread
729abbf561
Remove display query post process (#1967)
* Remove search query post-processing

* Remove _rawQuery, as it is redundant with _query
2021-09-26 22:14:52 -04:00
toasted-nutbread
ba267a545c
Rename dictionary import steps (#1966) 2021-09-26 20:08:16 -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
d739ccd63f
Fix japanese codepoint range issues (#1960)
* Add CJK_COMPATIBILITY_IDEOGRAPHS_RANGE

* Rename CJK_UNIFIED_IDEOGRAPHS_RANGES => CJK_IDEOGRAPH_RANGES

* Simplify isKana check

* Update tests
2021-09-26 13:29:55 -04:00
toasted-nutbread
25fe3ba514
Revert term/reading string normalization due to undesirable changes (#1959) 2021-09-26 13:29:50 -04:00
toasted-nutbread
076170cc38
Fix regexMatch and regexReplace handlebars helper functions (#1958) 2021-09-26 12:15:00 -04:00
toasted-nutbread
6694a9d9c3
Enable frequency dictionaries to specify the frequency mode (#1944) 2021-09-26 11:08:25 -04:00
toasted-nutbread
c15683d206
Ensure frequency values are always numbers (#1943) 2021-09-26 11:08:21 -04:00
toasted-nutbread
9899727d7d
Frequency dictionary sort (#1938)
* 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
2021-09-26 11:08:16 -04:00
toasted-nutbread
88e71f8223
Add data-is-primary attribute to headwords (#1946) 2021-09-11 12:51:51 -04:00
toasted-nutbread
dfddf3792e
Fix redundant secondary term lookups (#1942) 2021-09-09 23:29:41 -04:00
toasted-nutbread
7883d39496
Normalize terms and readings during import (#1941) 2021-09-09 23:25:24 -04:00
toasted-nutbread
069ca1a97b
Anki field templates suggestions (#1940)
* Remove unused

* Bold the suggested default field value
2021-09-08 20:12:26 -04:00
toasted-nutbread
6b566e0329
Rename _onDocumentStart => _onApiDocumentStart for consistency (#1939) 2021-09-08 14:49:00 -04:00
toasted-nutbread
ac12b50939
Dictionary import count details (#1935)
* Store count information when importing a dictionary

* Add importDate

* Update property ordering

* Update tests

* Update importDate
2021-09-07 11:12:58 -04:00
toasted-nutbread
c91831a817
Anki template regex helper updates (#1934)
* Update regexReplace and regexMatch to support content arguments

* Update documentation
2021-09-05 22:59:46 -04:00
toasted-nutbread
b988417031
Fix incorrect index being used for headword removal (#1933) 2021-09-05 21:07:23 -04:00
toasted-nutbread
97a80276f6
Database readwrite transaction updates (#1932)
* Add _readWriteTransaction helper

* Improve deleteDictionary order

* Make onProgress event optional

* Simplify progress rate parameter
2021-09-05 20:00:08 -04:00
toasted-nutbread
f68ad1f843
Structured content data (#1930)
* Add support for structured-content data attributes

* Assign dataset properties

* Don't remove data-sc attributes

* Use helper functions

* Update test data
2021-09-04 12:43:56 -04:00
toasted-nutbread
eb457caea9
Fix repeated note IDs shown on the "View Note" button (#1927) 2021-09-03 22:42:27 -04:00
toasted-nutbread
0331374241
Dictionary media import improvements (#1926)
* 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
2021-09-03 22:33:58 -04:00
toasted-nutbread
1599ec1f15
Fix dictionary import total progress (#1921)
* Fix incorrect total count for final step of dictionary import

* Update tests to validate progress args
2021-08-31 21:42:18 -04:00