Commit Graph

3318 Commits

Author SHA1 Message Date
toasted-nutbread
2c752fd89d
Popup action search (#1678)
* Set up search page in the action popup

* Fix a style causing incorrect overflow

* Fix error when trying to take a screenshot

* Fix popup size on Firefox
2021-05-15 16:30:33 -04:00
toasted-nutbread
bc6fb4e7d7
Fix incorrect _updateClipboardMonitorEnabled invocation (#1677) 2021-05-15 15:31:54 -04:00
toasted-nutbread
8442a8ba22
Add SearchPersistentStateController (#1676) 2021-05-15 15:11:42 -04:00
toasted-nutbread
de6db32aa6
Improve source term exact match count (#1674)
* Update sourceTermExactMatchCount to be based on headword count

* Update tests
2021-05-14 19:26:27 -04:00
toasted-nutbread
ff9dafc6f7
Restore the Anki on macOS warning from the old settings page (#1673) 2021-05-14 19:26:19 -04:00
toasted-nutbread
e7d349c3ec
Improve the behaviour of the "Move to..." action (#1667) 2021-05-11 18:11:10 -04:00
toasted-nutbread
de57d73826
Improve overflow wrap (#1663) 2021-05-10 20:02:06 -04:00
toasted-nutbread
892b908615
Update welcome page settings to match the settings page (#1662) 2021-05-10 19:41:04 -04:00
toasted-nutbread
ecf2ccf633
Change mobile extension page label from "Help" to "Information" (#1661) 2021-05-10 19:07:09 -04:00
toasted-nutbread
b50f5e1cf6
Improve internal page overflow (#1660)
* Improve overflow of internal pages

* Improve wrapping of the Origin: example text
2021-05-10 19:06:07 -04:00
toasted-nutbread
7b14cb3ab0
Remove more legacy settings page selectors (#1659) 2021-05-10 18:16:01 -04:00
toasted-nutbread
376a28326b
Fix invalid node/selectors being used in the dictionary delete process (#1658) 2021-05-10 18:04:08 -04:00
210f633dcc Update version 2021-05-08 21:14:54 -07:00
toasted-nutbread
f935623f35
Fix secondary search dictionary options layout (#1654) 2021-05-08 15:18:41 -04:00
toasted-nutbread
289bdc1622
Improve term grouping (#1653)
* Rename _addUniqueStrings to _addUniqueSimple

* Update definition merging to not depend the sequence number

* Improve naming

* Update AnkiNoteDataCreator

* Update docs

* Remove fields that no longer exist

* Update test data
2021-05-08 13:16:56 -04:00
toasted-nutbread
32f5544021
Add "Move to" menu option for moving dictionary options to a specific location (#1651)
* Add "Move to" option

* Fix IDs
2021-05-02 21:04:39 -04:00
toasted-nutbread
a8b602834f
Fix the "Prefix wildcard searches supported" toggle having incorrect state (#1650) 2021-05-02 10:15:47 -04:00
toasted-nutbread
46f60619d5
Display fixes (#1648)
* Fix incorrect tabId/frameId being used

* Only enable nested popups if the tabId is valid

* Remove unused APIs
2021-05-01 17:30:17 -04:00
toasted-nutbread
c514bbc4fb
Flags profile conditions (#1647)
* Generalize modifier keys

* Optimize bindings

* Add support for flags

* Add clipboard flag

* Update tests

* Add tests
2021-05-01 15:54:31 -04:00
toasted-nutbread
8bf6ff92f9
Increase the default scanning length to 16 (#1646) 2021-05-01 12:23:39 -04:00
toasted-nutbread
c433819c1b
Update search tags to always be displayed in a consistent manner (#1645) 2021-05-01 11:53:56 -04:00
toasted-nutbread
8ee470caa0
Remove the mouseover tags that are shown in merge mode (#1644) 2021-05-01 11:41:10 -04:00
toasted-nutbread
919c59a776 Update version 2021-04-30 18:23:40 -04:00
toasted-nutbread
0b554c936a
Add support for reordering dictionary options (#1641) 2021-04-30 18:15:32 -04:00
toasted-nutbread
076e201225
Improve dictionary options (#1640)
* Update dictionary options layout

* Update extras

* Improve display when no dictionaries are installed

* Implement "All" toggle

* Move modal

* Update welcome page

* Remove resizer button

* Fix ordering

* Fix extra closing tag
2021-04-30 18:01:16 -04:00
toasted-nutbread
d77d8e44e0
Replace collapsable with collapsible (#1639) 2021-04-30 17:59:20 -04:00
soriac
ba3f7b3e96
Show any custom tags on words that have anki cards created (#1628)
* Proof-of-concept for showing card tags (#1626)

* Resolved most PR comments:
- Added a snackbar notification when clicking tag button
- Replaced magnifying glass icon with new tag icon
- Button now contains a span w/icon, to use text color
- Removed unnecessary attributes from button
- Backend now returns full noteInfos object
- Frontend now handles filtering tags

* Add options to show/hide tag button & filter tags

* Do not show tags button if, after filtering, we have zero tags.

* Change tags option to enums, optimize tags intersection check & fix code style.

* Update options-util.js to include new tag options.

* Fix wording on new tag setting.

* Add CSS to remove hidden buttons from the display layout.

* getAnkiNoteInfo extra parameter for additional info.

* Add new tag option to tests.

* Remove unnecessary changes related to anki tags option.

* Code style fixes.
2021-04-30 17:57:53 -04:00
toasted-nutbread
69a739f00a
Use childNodes instead of children (#1638) 2021-04-28 22:07:11 -04:00
toasted-nutbread
0a7def1c01
Fix triangle current selection indicator using incorrect rule (#1637) 2021-04-28 21:57:56 -04:00
toasted-nutbread
40b29cb0d3
Add pitch categories template helper (#1636)
* Move utility function

* Expose dictionary entry as a hidden property for internal use

* Add pitchCategories helper
2021-04-28 21:57:49 -04:00
toasted-nutbread
512391346b
Translator alphanumeric improvement (#1635)
* Simplify alphanumeric check

* Update option name for clarity
2021-04-28 21:17:05 -04:00
toasted-nutbread
763c6c76aa
Add scanTextAtCaret option (#1632) 2021-04-26 21:11:43 -04:00
toasted-nutbread
6f5ad490fb
Add support for restoring the selection after using scanSelectedText (#1631) 2021-04-26 21:05:46 -04:00
toasted-nutbread
59f788be39
Enable showIframePopupsInRootFrame by default for new installs (#1630) 2021-04-26 20:07:27 -04:00
toasted-nutbread
38ed4dc5c7
Improve kifuku detection to not include suru nouns (#1621) 2021-04-26 20:00:03 -04:00
toasted-nutbread
83e73800b0
Add tag icon (#1629) 2021-04-26 19:59:49 -04:00
toasted-nutbread
f022febfe9
Fix incorrect return type causing an error (#1623) 2021-04-21 18:11:43 -04:00
toasted-nutbread
b40cfe0458
Translator refactoring for consistency (#1619)
* Remove unused argument

* Improve naming in _groupDictionaryEntriesByHeadword

More consistent with _getRelatedDictionaryEntries.
2021-04-18 18:15:58 -04:00
toasted-nutbread
03dd1dc6ff
Remove redundant dictionary entry sequence (#1618)
* Remove sequence/sequenceDictionary from dictionary entry objects

* Expose isPrimary on definitions

* Update sequence

* Update test data
2021-04-18 18:11:09 -04:00
toasted-nutbread
f9774b4ce9
Improve dictionary sequence info (#1617)
* Ensure negative sequence is always -1

* Expose sequence on definition objects

* Update how sequence is exposed for definitions

* Update test data

* Update TS docs
2021-04-18 18:08:02 -04:00
toasted-nutbread
609d4fe334
Replace furigana with reading (#1614)
* Use "reading" instead of "furigana" for reading distribution

* Update tests
2021-04-13 20:32:24 -04:00
toasted-nutbread
bbf47865ff
Improve AnkiController to indicate when the model/deck is invalid (#1611) 2021-04-12 20:20:14 -04:00
toasted-nutbread
20d60a2ba7
Initial safari compatibility (#1609)
* Update environment info to return the 'safari' browser

* Fix popup display on Safari

* Update environment assignment

* Add data-loading-stalled property when loading takes longer than expected

* Add notification when loading has stalled

* Allow getDictionaryInfo invocation on non-privileged contexts

* Update _validatePrivilegedMessageSender

* Don't listen to 'voiceschanged' event unless addEventListener is present

Also expose an event
2021-04-10 23:55:11 -04:00
toasted-nutbread
b23c4bff4b
Use consistent window size properties to improve popup positioning (#1607) 2021-04-09 18:17:02 -04:00
toasted-nutbread
331b164900
Remove settings-old.css (#1604) 2021-04-08 22:55:09 -04:00
toasted-nutbread
51c9bef032
Add PermissionsOriginController (#1603) 2021-04-08 22:52:28 -04:00
toasted-nutbread
c2aa51fdbb
Minor updates to settings styles (#1601) 2021-04-08 22:04:11 -04:00
toasted-nutbread
c73ee13086
More terminology updates (#1600)
* Update terminology

* Update display

* Rename expression-list to headword-list

* Rename expression-current-indicator

* Rename expression classes

* Update dictionary entry container

* Rename glossary => gloss

* Rename heading

* Rename gloss classes to gloss-content
2021-04-08 19:59:55 -04:00
toasted-nutbread
e444141511
Fix autofocus sometimes not working on the search page (#1597) 2021-04-07 19:07:42 -04:00
toasted-nutbread
e14b52ef84
Update dictionary entry terminology (#1592)
* Update terminology

* Update terminology in display.js

* Update terminology in display-audio.js

* Update terminology in text-scanner.js

* Update terminology in backend.js

* Update terminology in mecab.js

* Update terminology in audio-downloader.js

* Update terminology in translator-vm.js

* Update terminology in dictionary-data-util.js

* Update terminology in dictionary-database.js

* Update terminology in japanese-util.js

* Change/upgrade {expression} to {term}

* Update terminology in test-japanese.js

* Update terminology in test-database.js

* Update terminology in anki-templates-controller.js

* Update terminology in anki-note-builder.js

* Update terminology in backend.js

* Update terminology in text-scanner.js

* Update terminology in display.js

* Update terminology in display.js
2021-04-04 16:22:35 -04:00
toasted-nutbread
b8bedd5185
Improve term dictionary entry sequence (#1591)
* Improve sequence for merged entries and add sequenceDictionary

* Update docs

* Expose sequence in definitions

* Expose sequence in root definition

* Update test data
2021-04-03 15:41:44 -04:00
toasted-nutbread
8de1e9b3d8
Update logged data name to dictionaryEntry (#1590) 2021-04-03 15:23:55 -04:00
toasted-nutbread
4d5db960d2
Fix debug log of Anki note data using old format (#1589) 2021-04-03 15:18:52 -04:00
toasted-nutbread
0e26d9a667
Remove code for old settings page (#1588) 2021-04-03 13:32:53 -04:00
toasted-nutbread
a9fe2d03b2
Update dictionary settings structure (#1587)
* Update dictionary settings structure to use an array instead of an object

* Update ensureDictionarySettings implementation

* Remove some usage of ObjectPropertyAccessor
2021-04-03 13:02:49 -04:00
toasted-nutbread
0d2d342cd3
Fix selectability of kanji text (#1586) 2021-04-03 11:39:46 -04:00
toasted-nutbread
dabda86259
Optimize template renderer (#1585)
* Add renderMulti

* Batch template rendering

* Update tests
2021-04-02 19:09:21 -04:00
toasted-nutbread
8179846e38
Refactor template rendering (#1583)
* Update _errorToJson to _serializeError

* Remove async

* Refactor render

* Simplify _getModifiedData

* Rename data => commonData

* Rename templates => template for consistency

* Improve errors check

* Update tests
2021-04-02 12:42:06 -04:00
toasted-nutbread
36b7e34cce Update version 2021-04-01 19:17:53 -04:00
toasted-nutbread
c66fe71ee0 Remove debug statements (#1582) 2021-04-01 19:17:53 -04:00
toasted-nutbread
5d7309ed54
Log Anki data (#1579)
* Remove unused modifierPost

* Add _getModifier

* Add _getModifiedData

* Add getModifiedData

* Add getRenderingData

* Update logging to also log anki note data

* Fix dangling comma
2021-03-31 20:07:11 -04:00
toasted-nutbread
da612bbdd7
Fix missing document title on the search page (#1578) 2021-03-31 19:58:33 -04:00
toasted-nutbread
f4af3f31ef
Make secondary dictionary option controllers more consistent (#1577) 2021-03-31 18:53:08 -04:00
toasted-nutbread
bdec71976a
Fix dictionary settings being missing after importing settings (#1576) 2021-03-31 18:32:17 -04:00
toasted-nutbread
bcbd413e57
Definition collapsing when overflowing (#1575)
* Add double-down-chevron.svg

* Add options

* Update dictionary importers

* Update settings

* Add support for collapsible definitions

* Improve case when there is a very small amount of overflow

* Fix incorrect enabled state of newly imported dictionaries
2021-03-31 18:17:28 -04:00
toasted-nutbread
cbcfdcacaf
Fix incorrect state assignment when unbinding wanakana (#1573) 2021-03-29 18:46:32 -04:00
toasted-nutbread
f58b4962f1
Remove repeated disambiguations (#1572) 2021-03-28 16:04:55 -04:00
toasted-nutbread
b4d6a5d3b4
Toggle option hotkey (#1571)
* Set up toggleOption hotkey action settings

* Update styles

* Disable spell check and autocomplete

* Add OptionToggleHotkeyHandler

* Improve auto-close behaviour
2021-03-28 14:04:20 -04:00
toasted-nutbread
98994d0b65
Add playAudioFromSource hotkey (#1570) 2021-03-28 11:27:37 -04:00
toasted-nutbread
1664cc75f1
Shimau inflection (#1569)
* Add deinflection rule

* Update tests
2021-03-28 00:19:47 -04:00
toasted-nutbread
5be2362350
-chimau inflection (#1568)
* Update inflections

* Update tests
2021-03-28 00:05:45 -04:00
toasted-nutbread
34f8d8a812
Add a modal to confirm hotkey reset (#1567) 2021-03-27 23:03:06 -04:00
toasted-nutbread
8fe0e5fdf5
Add reset argument menu item (#1566) 2021-03-27 22:56:48 -04:00
toasted-nutbread
2098d2faae
Hotkey arguments (#1565)
* Update display

* Move scope definitions

* Update scopes button after changing action

* Don't show menu if empty

* Improve scope updating

* Update style

* Simplify

* Add argument to settings

* Update convertToNumber implementation

* Add support for arguments

* Pass argument to action handler

* Update hotkey action definitions

* Remove x3 options
2021-03-27 22:30:45 -04:00
toasted-nutbread
422f011fac
Update hotkey settings design (#1564)
* Update PopupMenu event prevention

* Use vars for button padding

* Add button-inner-label style

* Add input-button button

* Update display of scope selection

* Add hidden argument text input field

* Remove unnecessary calls

* Display a strike through the enabled button when no scopes are selected
2021-03-27 13:21:34 -04:00
toasted-nutbread
af768624ac
Update wording on the info page (#1563) 2021-03-26 20:01:04 -04:00
toasted-nutbread
299720d799
Fix definitionDetails using expression instead of term (#1562) 2021-03-26 19:57:57 -04:00
toasted-nutbread
90f7d5ba07
Add part of speech info (#1561)
* Add part of speech info to headwords

* Expose parts of speech to Anki template rendering

* Expose parts of speech

* Update pitch accent categories

* Update docs

* Add part-of-speech

* Update options and tests

* Update markers

* Update test data
2021-03-26 19:50:54 -04:00
toasted-nutbread
482dd8c8d8
Display fixes (#1560)
* Fix _getDefinitionDetailsForNote

* Fix _getExpressionAndReading
2021-03-26 19:31:19 -04:00
toasted-nutbread
a14caaeab9
Add join and concat utility functions for template rendering (#1559) 2021-03-26 19:07:43 -04:00
toasted-nutbread
a756ce85c0
Remove debug log (#1558) 2021-03-25 22:42:24 -04:00
toasted-nutbread
4ddd3ec80c
Fix incorrect sorting (#1557)
* Sort by the maximum length of transformedText instead of deinflectedText

* Update docs

* Update tests
2021-03-25 21:40:27 -04:00
toasted-nutbread
6af0ee26b9
Fix tag disambiguation (#1556)
* Update display generator to use new data format for tag disambiguation

* Add separator for multiple disambiguations
2021-03-25 20:54:39 -04:00
toasted-nutbread
4be5c8fd9f
Refactor Translator and dictionary entry format (#1553)
* Update test data

* Move translator.js

* Create new version of Translator

* Update Backend

* Update DictionaryDataUtil

* Update DisplayGenerator

* Create AnkiNoteDataCreator

* Replace AnkiNoteData with AnkiNoteDataCreator

* Update tests

* Remove AnkiNoteData

* Update test data

* Remove translator-old.js

* Add TypeScript interface definitions for the new translator data format
2021-03-25 19:55:31 -04:00
toasted-nutbread
e7035dcff4
Enable audio menu shift click (#1555)
* Expose modifier keys

* Add updateMenuItems

* Don't close menu if shift key is held

* Add _createMenuItems

* Simplification

* Maintain a list of open popup menus

* Expose expression/reading

* Reuse existing items

* Update menu after a cache update

* Update menu position
2021-03-25 19:22:34 -04:00
toasted-nutbread
0e1845c7ed
Fix case where {tags} returns an error (#1549) 2021-03-23 20:43:38 -04:00
toasted-nutbread
28f97ba40b
Update display results style (#1536)
* Expose resultOutputMode

* Update display styles
2021-03-16 18:48:24 -04:00
toasted-nutbread
8ae78449f2
Fix furigana distribution when source/expression kana differs (#1532)
* Fix furigana distribution when source/expression kana differs

* Add an additional test
2021-03-15 23:02:38 -04:00
toasted-nutbread
9ad9961ca8
Fix error for kanji note data (#1530) 2021-03-15 20:50:18 -04:00
toasted-nutbread
9addd3f6d1
Fix search tab not focusing correctly (#1529) 2021-03-15 18:53:03 -04:00
toasted-nutbread
49b603c756
Remove old settings page (#1524)
* Remove old settings page

* Remove spinner.gif
2021-03-14 22:51:48 -04:00
toasted-nutbread
a52d86a39e
Dictionary database improvements (#1527)
* Update formatting

* Add _findMultiBulk

* Update implementation of findTermsBySequenceBulk

* Update tests

* Generalize query creation

* Remove _findGenericBulk

* Reduce function creation

* Add more bindings

* Simplify findTermsExactBulk implementation

* Update var names

* Update _findMultiBulk to support multiple index queries

* Update findTermsBulk

* Update getMedia implementation

* Pass data arg to getAll and findFirst to avoid having multiple closures
2021-03-14 22:51:20 -04:00
toasted-nutbread
07df1e0117
Fix dictionary image support (#1526)
* Fix content security policy for images

* Add createBlobFromBase64Content to MediaUtil

* Update MediaLoader to use MediaUtil

* Use blob URLs when importing dictionaries

* Update VM's URL to support createObjectURL and revokeObjectURL

* Fix test
2021-03-14 18:41:15 -04:00
toasted-nutbread
52a4d874ea
Make MediaUtil a static class (#1525) 2021-03-14 18:04:19 -04:00
toasted-nutbread
06b02c3cf2
Add css width var (#1523)
* Rename --main-content-size to --content-width

* Add --content-width-search variable
2021-03-13 13:08:50 -05:00
toasted-nutbread
f6b591fd1a
Remove TODO comment from settings.css (#1522) 2021-03-13 13:04:26 -05:00
toasted-nutbread
e1477adeec
Simplify _findFirstBulk (#1521) 2021-03-13 11:42:04 -05:00
toasted-nutbread
a00ed41838
Database API updates (#1520)
* Add Database.findFirst

* Add DictionaryDatabase.findTagMetaBulk
2021-03-13 11:25:10 -05:00
toasted-nutbread
638e5783ac
Fix sorting of non-top-level definitions (#1516) 2021-03-10 20:27:10 -05:00
toasted-nutbread
5fe40d7ec4
Fix tag height (#1515) 2021-03-10 20:27:06 -05:00
toasted-nutbread
800ce9ed9e
Fix incorrect furigana distribution (#1514)
* Improve distributeFuriganaInflected implementation

* Update tests
2021-03-10 20:27:01 -05:00
toasted-nutbread
63de9273b3
Fix permissions changes not being supported on some browsers (#1513) 2021-03-10 20:26:57 -05:00
toasted-nutbread
b1f96a7ca7
Fix previousStyles being recreated for every transparent element (#1512) 2021-03-10 20:26:53 -05:00
toasted-nutbread
4f4990820e
Fix text selection during scanning (#1508)
* Move function

* Add _onSearchClick function

* Move _onSearchClick after event prevention

* Prevent search if selection is changed before a click occurs
2021-03-09 20:01:37 -05:00
toasted-nutbread
c6f4144fda
Clean up translator (#1505)
* Remove unused: _removeUsedDefinitions

* Remove unused: _scoreToTermFrequency

* Remove unused: _getTermTagsScoreSum

* Add RegexUtil

* Update Translator to use RegexUtil

* Update sw.js

* Update tests
2021-03-08 21:01:55 -05:00
toasted-nutbread
643dbfb12a
Refactor term frequency data (#1503)
* Add getTermFrequency

* Update DisplayGenerator to use getTermFrequency

* Remove termFrequency from Translator data

* Backwards compatibility

* Update tests
2021-03-07 20:38:40 -05:00
toasted-nutbread
19f6bf5a3a
Refactor furigana segment data (#1502)
* Remove redundant language assignment

* Segment furigana from DisplayGenerator

* Remove furiganaSegments from translator data

* Add backwards compatibility for furiganaSegments

* Update tests
2021-03-07 17:55:51 -05:00
toasted-nutbread
7793e14e57
Deinflector refactor (#1501)
* Make Deinflector._ruleTypes private

* Add createDeinflection helper

* Remove unnecessary field assignments from Deinflector

Move them to Translator instead
2021-03-07 14:07:26 -05:00
toasted-nutbread
92fe1571ae
Translator data format improvements (#1500)
* Update _createTermDetailsList usage and docs

* Update source of expression/reading/furiganaSegments
2021-03-07 12:18:44 -05:00
toasted-nutbread
49bf562690
Update audio downloader (#1499)
* Update _getInfoJpod101's empty reading check

* Use URLSearchParams instead of a string
2021-03-06 18:26:16 -05:00
toasted-nutbread
16217728af
Improve empty reading handling (#1497)
* Handle empty readings earlier in the definition creation process

* Remove empty reading check

* Remove special handling of empty readings
2021-03-06 15:53:45 -05:00
toasted-nutbread
a65742a884
Fix furigana distribution when reading starts with expression, but has remainder characters (#1496) 2021-03-06 15:49:07 -05:00
toasted-nutbread
aa6a547da7
Add CSS variable to control tag height (#1495) 2021-03-06 15:08:21 -05:00
toasted-nutbread
01f74510f0
Separate display resizer (#1494)
* Make invokeContentOrigin public

* Move display resizer functionality into a new class: DisplayResizer

* Simplify field names

* Use parent frame instead of content origin

* Remove unused
2021-03-06 14:31:23 -05:00
toasted-nutbread
6e00b5d765
Fix multiline copying (#1493)
* Change order

* Update multiline text assignment
2021-03-06 13:41:38 -05:00
toasted-nutbread
4bc53d2348
Use dictionary priority later in the definition sorting algorithm (#1492) 2021-03-06 13:27:20 -05:00
toasted-nutbread
019c8cd4d7
Split dictionary order and index sorting (#1491)
* Refactor expression comparison

* Rename function

* Add dictionary index sorting

* Update test data
2021-03-06 13:04:50 -05:00
toasted-nutbread
e28a89e580
Add workaround for a frequency disambiguation layout issue on Firefox (#1489) 2021-03-05 23:48:38 -05:00
toasted-nutbread
2203202861
Fix missing meta when reading is empty (#1486) 2021-03-05 19:25:31 -05:00
toasted-nutbread
ca4d5a2ac1
Fix text being overwritten when generating the query parser content (#1483) 2021-03-03 18:06:12 -05:00
toasted-nutbread
14717b7579
Fix missing required options (#1482) 2021-03-02 22:51:06 -05:00
toasted-nutbread
65c20382d3
Add clickable web browser settings links (#1481) 2021-03-02 22:46:26 -05:00
toasted-nutbread
3fe825cf30
Request persistent storage on Firefox (#1480) 2021-03-02 22:27:53 -05:00
toasted-nutbread
b0bc7dc08f
Add a toggle for the persistent storage option on the permissions page (#1479) 2021-03-02 22:08:34 -05:00
toasted-nutbread
4208595293
Persistent storage controller (#1478)
* Add PersistentStorageController

* Update DictionaryController

* Update DictionaryImportController

* Update when storage stats are updated
2021-03-02 20:27:51 -05:00
toasted-nutbread
571b865ae5
Fix enter key causing duplicate text when typing using an IME (#1477) 2021-03-02 18:18:31 -05:00
toasted-nutbread
0e705292cc
Remove zero-width space (#1475) 2021-03-01 22:45:03 -05:00
toasted-nutbread
0dab38f0a6
Refactor translator merged mode (#1474)
* Remove sourceDefinitions

* Add id

* Remove related definitions from unsequencedDefinitions

* Add separate _addRelatedDefinitions function

* Add secondary definitions

* Update how secondary definitions are added

* Update expression/reading source

* Move _mergeByGlossary body

* Refactor _createTermDetailsListFromTermInfoMap

* Move _addUniqueTermInfos body

* Rename function

* Organize

* Simplify duplicate check

* Rename relatedDefinitionIds to definitionIds

* Refactor secondary definition adding

* Early exit

* Add matching unsequencedDefinitions to secondaryDefinitions

* Clean

* Fix incorrect condition

* Move _addSecondaryDefinitions call

* Add comments
2021-03-01 22:17:23 -05:00
toasted-nutbread
b477da97d4
Translator refactor (#1473)
* Refactor _groupTerms and add doc comment

* Update where expression/reading is acquired from

* Add doc comment

* Add isPrimary field

* Update test data

* Add definition which has "isPrimary": false definitions
2021-03-01 19:01:30 -05:00
toasted-nutbread
488dc486f1 Update version 2021-02-28 18:28:50 -05:00
toasted-nutbread
90da87f378
Add support for resizing the popup window using touch events (#1471) 2021-02-28 17:13:11 -05:00
toasted-nutbread
c192b4a4c1
Wrap host selection copy in a try-catch (#1470) 2021-02-28 16:51:48 -05:00
toasted-nutbread
8f057c63fe
Improve text parser (#1469)
* Merge ungrouped characters

* Update iteration

* Fix incorrect code point handling

* Simplify text

* Specify language

* Update how parsed status is represented
2021-02-28 16:38:01 -05:00
toasted-nutbread
ec1a8380b5
Fix a poorly handled edge case of the scanning parser (#1468) 2021-02-28 15:44:57 -05:00
toasted-nutbread
1dfcd3e435
Fix missing details causing frequency tags to not be clickable (#1467) 2021-02-28 14:44:44 -05:00
toasted-nutbread
704db45e29
Remove the now-unused hotkey forwarding functionality (#1466) 2021-02-28 14:29:43 -05:00
toasted-nutbread
75d7e5dc32
Fix and improve some CSS vars (#1465) 2021-02-28 14:23:51 -05:00
toasted-nutbread
4806414f95
Text source element scanning improvements (#1464)
* Add api.textHasJapaneseCharacters

* Add support for empty query

* Add support for showing the query parser for TextSourceElement
with content that does not start with Japanese text
2021-02-28 14:18:18 -05:00
toasted-nutbread
6f76645f4c
Use a Set instead of an array (#1463) 2021-02-28 13:33:33 -05:00
toasted-nutbread
445f87ebdb
Get categorization of pitch accents (#1462) 2021-02-28 13:26:34 -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
f2d2ba0d25
Add ge deinflect rule (#1458)
* Add -ge rule

* Add tests
2021-02-27 23:26:47 -05:00
toasted-nutbread
990d3611cd
Update color of name tag to not overlap with frequency tag color (#1457) 2021-02-27 23:19:16 -05:00
toasted-nutbread
0decabd768
Improve definition ordering (#1456)
* Update dictionary priority

* Replace dictionaryPriority with dictionaryOrder

* Update tests
2021-02-27 23:11:41 -05:00
toasted-nutbread
e4a4e5f85f
Improve term meta ordering (#1455)
* Update implementation of _buildTermMeta

* Remove old implementation

* Expose dictionaryPriority on frequencies and pitch accents

* Update how meta data is generated; add index

* Update order

* Update names

* Expose expressionIndex as part of pitch/frequency data

* Implement meta sorting

* Update test data
2021-02-27 22:27:00 -05:00
toasted-nutbread
7d6915ec3b
Misc display style updates (#1454)
* Remove unused style

* Update inflection separator
2021-02-27 17:58:28 -05:00
toasted-nutbread
c7caea7203
Improve expression variables (#1453)
* Improve how colors are used for expressions

* Add more color definitions
2021-02-27 17:29:59 -05:00
toasted-nutbread
c4b2e83cb4
Organize display styles (#1452)
* Improve grouping for inflection and expression styles

* kanji-link => expression-kanji-link

* Remove unnecessary entry-header2 and entry-header3

* Move tag list into header for consistency with term definitions

* Move styles

* Add clear
2021-02-27 16:54:15 -05:00
toasted-nutbread
8d3436fca3
Refactor display styles (#1451)
* term-expression => expression

* term-pitch-accent => pitch-accent

* term-reason => inflection, term-reasons => inflection-list

* term-details => expression-list-details

* term-glossary => glossary

* Update tag list classes

* term-definition => definition
2021-02-27 16:32:44 -05:00
toasted-nutbread
c64a8eac1e
Change "Raw term" to "Plain term" (#1450) 2021-02-27 15:29:34 -05:00
toasted-nutbread
2a5aa53411
Refactor expression vars (#1449)
* Group expression styles

* Rename var

* Update var name and style

* Group --kanji* vars

* Rename var

* Rename vars
2021-02-27 15:28:40 -05:00
toasted-nutbread
1a7c264165
Add standalone reading (#1448)
* Add option

* Update display

* Hide redundant readings

* Improve label and description
2021-02-27 14:04:52 -05:00
toasted-nutbread
9e7a76a1f1
Improve dictionary priority (#1447)
* Refactor _sortDefinitions

* Remove use of useDictionaryPriority
2021-02-26 23:55:32 -05:00
toasted-nutbread
0bf0620c35
Improve kana segmentation (#1446)
* Improve edge case furigana distribution for mixed hiragana/katakana

* Update/add tests
2021-02-26 23:23:16 -05:00
toasted-nutbread
b994414b14
Improve Anki card type selection (#1445)
* Update separator line styles

* Add tabs

* Add support for radio select

* Remove old select

* Move out of scroll region

* Fix missing line
2021-02-26 18:15:04 -05:00
toasted-nutbread
782b945905
Header lint (#1444)
* Add eslint-plugin-header

* Add rule for header format

* Add missing header

* Fix header issues
2021-02-25 20:21:05 -05:00
toasted-nutbread
b2f225a0d6
Fix wait for frontend not working properly (#1443) 2021-02-25 19:04:41 -05:00
toasted-nutbread
5197b6cb9a
Disambiguation style strings (#1442)
* Add strings section

* Add disambiguation prefix/suffix strings

* Add separator strings

* Add padding definition
2021-02-25 18:48:42 -05:00
toasted-nutbread
ec495bd7b2
Improve frequency display (#1438)
* Add frequencyDisplayMode option

* Update tests

* Add setting

* Update frequency display styles

* Improve wrapping
2021-02-25 17:48:39 -05:00
toasted-nutbread
6bda81b422
Improve note addability (#1440)
* Add valid field

* Add isNoteDataValid function

* Update _areDefinitionsAddableForcedValue to return proper valid values

* Refactor isAnkiConnected check

* Force canAdd to false if not valid
2021-02-24 22:23:40 -05:00
toasted-nutbread
ae92e0b378
AnkiUtil (#1439)
* Add AnkiUtil

* Update AnkiConnect to use AnkiUtil

* Use AnkiUtil in AnkiNoteBuilder

* Replace containsAnyMarker with AnkiUtil.stringContainsAnyFieldMarker

* Add AnkiUtil.getFieldMarkers

* Add fieldsObjectContainsMarker to AnkiUtil

* Remove unused global

* Remove unused parameter: enabled

* Add cloneFieldMarkerPattern
2021-02-24 21:54:58 -05:00
toasted-nutbread
0a76de1b44
Update tag styles (#1437) 2021-02-23 18:42:04 -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
7abb8a6056
Update tag display styles (#1433) 2021-02-21 17:47:46 -05:00
toasted-nutbread
e8d22b883b
Fix missing spacing after frequency disambiguation (#1432) 2021-02-21 16:54:32 -05:00
toasted-nutbread
b778974938
Improve tag styles (#1431)
* Update tag styles

* Refactor _createTag

* Update padding
2021-02-21 13:57:28 -05:00
toasted-nutbread
75d0d333d8
Improve some values based on the font-size (#1430) 2021-02-21 11:34:55 -05:00
toasted-nutbread
1e4545107d
Rename context.css to action-popup.css (#1428) 2021-02-21 00:22:21 -05:00
toasted-nutbread
ae1f7ad9fe
Improve button styles (#1427)
* Update variable names

* Update standard button styles

* Update styles

* Update button styles

* Update styles

* Add current styles

* Update button styles

* Update styles

* Update outline item styles

* Update styles

* Update styles

* Update notification button styles

* Update button styles
2021-02-21 00:18:43 -05:00
toasted-nutbread
ad0f8bfe39
Focus visible styles (#1426)
* Add focus-visible styles

* Add focus-visible styles

* Add focus-visible styles

* Add focus-visible styles

* Add focus-visible styles
2021-02-20 20:56:20 -05:00
toasted-nutbread
7315ecdd1a
Refactor styles (#1425)
* Replace :not(:disabled) styles

* Use var for style

* Update active styles

* Update disabled styles for <input> elements

* Update button disabled styles

* Add focus styles to checkbox

* Update style name
2021-02-20 17:09:58 -05:00
toasted-nutbread
b9e92a2528
Improve key press to focus the search query input (#1424) 2021-02-19 21:20:58 -05:00
toasted-nutbread
1e927dd66e
Fix translation regex replacements (#1423)
* Fix regex replacements having issues at the start of scanned text

* Fix test cases

* Add tests
2021-02-19 18:39:43 -05:00
toasted-nutbread
6a6d7ba84e
Fix wanakana.unbind throwing an error (#1422) 2021-02-19 18:39:36 -05:00
toasted-nutbread
19d0d5b512
Fix useSettingsV2 option (for real this time) (#1421) 2021-02-19 18:39:28 -05:00
toasted-nutbread
98ac73260e
Remove section headings (#1413) 2021-02-16 21:25:21 -05:00
toasted-nutbread
53d02ca3d3
Fix search tags in split and grouped display modes (#1412) 2021-02-16 21:19:52 -05:00
toasted-nutbread
6fc5eb2ae1
Fix copy hotkey not working (#1411) 2021-02-16 21:19:43 -05:00
toasted-nutbread
3a86601c88
Improve primary audio assignment when audio isn't available (#1407) 2021-02-15 21:46:55 -05:00
toasted-nutbread
55f5182ca9
Audio popup menu primary card audio selection (#1406)
* Add card icon to audio menu items

* Update cache data format

* Create _getCacheItem

* Add _playAudioFromSource function

* Implement default card audio info

* Specify exact audio to download when an override is assigned

* Abstract using _getMenuItemSourceInfo

* Update downloadability check

* Update the main audio menu buttons to also assign the default source
2021-02-15 21:34:10 -05:00
toasted-nutbread
f2a387237b
Update audio downloading to support specifying an exact array index (#1405) 2021-02-15 20:47:35 -05:00
toasted-nutbread
7027d537a9
Display audio menu refactor (#1404)
* Update display and generation of the audio menu

* Wrap menu items in a div to allow for horizontal layout groupings
2021-02-15 14:31:16 -05:00
toasted-nutbread
74a9c7499c
Update html files and scripts (#1403)
* Add <!-- Scripts --> heading for consistency

* Update indentation of background.html to be more consistent

* Update script grouping
2021-02-15 12:50:21 -05:00
toasted-nutbread
4be066ac8a
Use consistent number of newlines at the start of files (#1402) 2021-02-15 12:43:24 -05:00
toasted-nutbread
750bb67b4a
Move settings2.css to settings.css (#1400) 2021-02-15 10:48:57 -05:00
toasted-nutbread
65bca5ce72
Move settings.css to settings-old.css (#1399) 2021-02-15 10:46:32 -05:00
toasted-nutbread
67aa66c1a0
Disable user-select on preview iframe (#1398) 2021-02-15 10:43:38 -05:00
toasted-nutbread
450912c109
Move js/settings (#1397)
* Move js/settings to js/pages/settings

* Fix script ordering
2021-02-14 23:10:01 -05:00
toasted-nutbread
d6332d2bc7
Test html script ordering (#1396)
* Simplify getAllFiles

* Add test to validate script order

* Update script include order

* Update content script order

* Update sw.js and corresponding lint

* Update manifest
2021-02-14 20:25:41 -05:00
toasted-nutbread
48b59375eb
Cleanup yomichan api (#1394)
* Move invokeMessageHandler to core.js

* Move getMessageResponseResult to backghend.js

* Replace getTemporaryListenerResult
2021-02-14 18:18:02 -05:00
toasted-nutbread
9279ced686
Log refactoring (#1393)
* Create Logger class and log instance

* Replace yomichan.logWarning with log.warn

* Replace yomichan.logError with log.error

* Replace yomichan.log with log.log

* Update the Yomichan class to use the global log object

* Update lint rules
2021-02-14 17:52:01 -05:00
toasted-nutbread
286534e648
Move api to yomichan object (#1392)
* Move cross frame API from API to Yomichan

* Add API instance to Yomichan

* Move api global to yomichan.api

* Pass yomichan to API

* Remove IIFE
2021-02-14 15:53:35 -05:00
toasted-nutbread
efe8140f10
Api prepare refactor (#1391)
* Refactor API preparation

* Run yomichan.prepare manually in the entry point function
2021-02-14 15:19:31 -05:00
toasted-nutbread
94201ed44a
Rename window scroll (#1390)
* Rename WindowScroll to ScrollElement

* Rename window-scroll.js to scroll-element.js

* Update global order
2021-02-14 11:36:44 -05:00
toasted-nutbread
5268c5d1bc
Util rename (#1389)
* Rename MediaUtility to MediaUtil for consistency

* Update variable names

* Rename media-utility.js to media-util.js

* Rename ProfileConditions to ProfileConditionsUtil

* Rename variables

* Move profile-conditions.js to profile-conditions-util.js

* Rename test-profile-conditions.js to test-profile-conditions-util.js
2021-02-14 11:32:30 -05:00
toasted-nutbread
e419a418f6
Move bg/js (#1387)
* Move bg/js/anki.js to js/comm/anki.js

* Move bg/js/mecab.js to js/comm/mecab.js

* Move bg/js/search-main.js to js/display/search-main.js

* Move bg/js/template-patcher.js to js/templates/template-patcher.js

* Move bg/js/template-renderer-frame-api.js to js/templates/template-renderer-frame-api.js

* Move bg/js/template-renderer-frame-main.js to js/templates/template-renderer-frame-main.js

* Move bg/js/template-renderer-proxy.js to js/templates/template-renderer-proxy.js

* Move bg/js/template-renderer.js to js/templates/template-renderer.js

* Move bg/js/media-utility.js to js/media/media-utility.js

* Move bg/js/native-simple-dom-parser.js to js/dom/native-simple-dom-parser.js

* Move bg/js/simple-dom-parser.js to js/dom/simple-dom-parser.js

* Move bg/js/audio-downloader.js to js/media/audio-downloader.js

* Move bg/js/deinflector.js to js/language/deinflector.js

* Move bg/js/backend.js to js/background/backend.js

* Move bg/js/translator.js to js/language/translator.js

* Move bg/js/search-display-controller.js to js/display/search-display-controller.js

* Move bg/js/request-builder.js to js/background/request-builder.js

* Move bg/js/text-source-map.js to js/general/text-source-map.js

* Move bg/js/clipboard-reader.js to js/comm/clipboard-reader.js

* Move bg/js/clipboard-monitor.js to js/comm/clipboard-monitor.js

* Move bg/js/query-parser.js to js/display/query-parser.js

* Move bg/js/profile-conditions.js to js/background/profile-conditions.js

* Move bg/js/dictionary-database.js to js/language/dictionary-database.js

* Move bg/js/dictionary-importer.js to js/language/dictionary-importer.js

* Move bg/js/anki-note-builder.js to js/data/anki-note-builder.js

* Move bg/js/anki-note-data.js to js/data/anki-note-data.js

* Move bg/js/database.js to js/data/database.js

* Move bg/js/json-schema.js to js/data/json-schema.js

* Move bg/js/options.js to js/data/options-util.js

* Move bg/js/background-main.js to js/background/background-main.js

* Move bg/js/permissions-util.js to js/data/permissions-util.js

* Move bg/js/context-main.js to js/pages/action-popup-main.js

* Move bg/js/generic-page-main.js to js/pages/generic-page-main.js

* Move bg/js/info-main.js to js/pages/info-main.js

* Move bg/js/permissions-main.js to js/pages/permissions-main.js

* Move bg/js/welcome-main.js to js/pages/welcome-main.js
2021-02-14 11:19:54 -05:00
toasted-nutbread
43d1457ebf
Move bg/js/settings(2) (#1385)
* Move bg/js/settings/ to js/settings/

* Move bg/js/settings2/ to js/settings/
2021-02-13 23:20:22 -05:00
toasted-nutbread
7a74c3c31e
Move fg/js (#1384)
* Move fg/js/frame-ancestry-handler.js to js/comm/frame-ancestry-handler.js

* Move fg/js/frame-offset-forwarder.js to js/comm/frame-offset-forwarder.js

* Move fg/js/dom-text-scanner.js to js/dom/dom-text-scanner.js

* Move fg/js/text-source-element.js to js/dom/text-source-element.js

* Move fg/js/text-source-range.js to js/dom/text-source-range.js

* Move fg/js/float-main.js to js/display/popup-main.js

* Move fg/js/content-script-main.js to js/app/content-script-main.js

* Move fg/js/frontend.js to js/app/frontend.js

* Move fg/js/popup-factory.js to js/app/popup-factory.js

* Move fg/js/popup-proxy.js to js/app/popup-proxy.js

* Move fg/js/popup-window.js to js/app/popup-window.js

* Move fg/js/popup.js to js/app/popup.js
2021-02-13 23:13:53 -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
toasted-nutbread
deed5027cd
Move mixed/lib/ to lib/ (#1382) 2021-02-13 21:28:47 -05:00
toasted-nutbread
e9358997c0
Move search mode (#1381)
* Move mode handling to SearchDisplayController

* Remove mode state info and handlers from Display
2021-02-13 18:52:54 -05:00
toasted-nutbread
00066e4eb5
Fix cross frame communication not exposing sourceTabId properly (#1379) 2021-02-13 12:13:05 -05:00
toasted-nutbread
edc22b98e3
Improve search page popup detection (#1378)
* Add _getAllTabs function

* Add _findTabs

* Use _findTabs instead of _findTab

* Remove _findTab

* Refactor tab check

* Add ability to search for a popup native window

* Fix dangling comma
2021-02-13 12:13:01 -05:00
toasted-nutbread
d5964ee4d4
Rename html files (#1377)
* Rename context.html to action-popup.html

* Rename float.html to popup.html
2021-02-12 23:23:26 -05:00
toasted-nutbread
daea80942c
Fix old settings page not being used properly (#1376) 2021-02-12 23:07:19 -05:00
toasted-nutbread
4053d9b2fa
Move html files (#1375)
* Move background.html to /

* Move context.html to /

* Move info.html to /

* Move legal.html to /

* Move permissions.html to /

* Move pitch-accents-preview.html to /

* Move popup-preview.html to /

* Move search.html to /

* Move settings.html to /

* Move settings2.html to /

* Move template-renderer.html to /

* Move welcome.html to /

* Move float.html to /

* Move display-templates.html to /
2021-02-12 23:03:15 -05:00
toasted-nutbread
4f13de2835
Move css files (#1374)
* Move bg/css/ to css/

* Move mixed/css/ to css/
2021-02-12 21:03:30 -05:00
toasted-nutbread
8454f52378
Move more data files (#1373)
* Move deinflect.json

* Move button.mp3

* Move fonts
2021-02-12 20:37:43 -05:00
toasted-nutbread
f70464e5f3
Add additional vz deinflection rule (#1367) 2021-02-12 20:29:23 -05:00
toasted-nutbread
98975d5923
Move images (#1372)
* Move mixed/img/ to images/

* Move bg/img/ to images/
2021-02-12 20:27:43 -05:00
toasted-nutbread
2b4af57bd7
Move data folder (#1371)
* Move handlebars template files

* Move schema files
2021-02-12 19:56:24 -05:00
toasted-nutbread
37f9161718
Update the warning on the old settings page (#1370) 2021-02-12 19:54:44 -05:00
toasted-nutbread
1c5e3e6d39
Search decouple (#1369)
* Update how query post-processing is implemented

* Update DisplaySearch to not subclass Display

* Update display construction

* Make display initialization consistent

* Remove unused

* Fix wanakana binding

* Use own frame/tab ID

* DisplaySearch => SearchDisplayController

* Fix globals
2021-02-11 22:57:38 -05:00
toasted-nutbread
94db6c69fa
Permissions button in browser action popup (#1368)
* Add key icon

* Update context icon styles

* Add permissions links

* Show warning badge if permissions are insufficient for certain settings

* Create PermissionsUtil

* Use PermissionsUtil in Backend

* Update SettingsController to use PermissionsUtil

* Update AnkiController to use getRequiredPermissionsForAnkiFieldValue

* Show the permissions buttons/links on the context page when necessary

* Update MV3 compatibility
2021-02-11 18:55:09 -05:00
toasted-nutbread
07cd006127
Add support for multiple types of audio (#1366) 2021-02-10 19:18:28 -05:00
toasted-nutbread
673952e825
Fix window popup screenshot (#1365)
* Pass tabId to the screenshot functionality

* Make setVisibleOverride async

* Fix argument order

* Fix incorrect windowId

* Remove unused argument
2021-02-09 23:14:29 -05:00
toasted-nutbread
166451b8f7
Improve popup window ownership (#1364)
* Update frameInformationGet to also return the tab ID

* Add tabId to Frontend

* Pass tabId/frameId to Display

* Pass ownership information using setContent

* Remove ownerFrameId for Popup classes

* Use frameId instead of ownerFrameId for screenshotting

* Use contentOrigin instead of owner

* Update _invokeContentOrigin implementation
2021-02-09 22:56:04 -05:00
toasted-nutbread
0f5fb804d0
Mecab test (#1361)
* Update Mecab API

* Add testMecab API function

* Add a test button for the Mecab component
2021-02-08 19:40:49 -05:00
toasted-nutbread
0ed24347ee
Fix settings permissions issues (#1360)
* Add missing warning indicator for the MeCab option

* Fix error handling of permissions requests
2021-02-08 19:37:36 -05:00
toasted-nutbread
0d031ab785
Improve context page display on mobile (#1359) 2021-02-08 17:53:22 -05:00
toasted-nutbread
e386599872
Fix changing the parser not immediately updating (#1358) 2021-02-08 17:53:17 -05:00
toasted-nutbread
69e8addb47
Mecab refactor (#1357)
* Use private variables

* Use local variables

* Remove onError

* Use private functions

* Move results parsing

* Set up disconnect observation

* Add _clearPort

* Update API

* Rename

* Fix iterator

* Update parseText invocation

* Update parseText format

* Reorganize

* Update implementation and docs

* Fix some port setup issues
2021-02-08 17:53:12 -05:00
toasted-nutbread
7b28c2c532
Auto-fill Anki card fields when possible (#1355) 2021-02-08 17:53:07 -05:00
toasted-nutbread
bb8a521dff
Remove unused api functions (#1354)
* Remove screenshotGet

* Remove downloadDefinitionAudio

* Remove clipboardGetImage
2021-02-08 17:53:02 -05:00
toasted-nutbread
73e91b3b62
Refactor FrameOffsetForwarder (#1353)
* Add getChildFrameElement to FrameAncestryHandler

* Add isRootFrame

* Initialize _frameOffset to [0, 0]

* Update FrameOffsetForwarder implementation

* Update documentation
2021-02-08 17:52:56 -05:00
toasted-nutbread
3e5b30ff76
Fix overflow scrollbar appearing sometimes (#1350) 2021-02-08 17:52:51 -05:00
toasted-nutbread
4b6703114c
Improve dictionaries not enabled badges (#1349)
* Improve badges on the settings page

* Add badges on the context page
2021-02-08 17:52:46 -05:00
toasted-nutbread
849e4fabe1
Native messaging optional permission (#1348)
* Refactor PermissionsToggleController to not require a setting

* Update nativeMessaging to be optional on Chrome

* Update parsing.enableMecabParser setting to request permissions

* Update permissions page to use PermissionsToggleController

* Update permissions documentation

* Disable toggle for permissions which are not optional
2021-02-08 17:52:41 -05:00
toasted-nutbread
008809e0e7
Enforce language (#1344)
* Assign text content and a language

* Remove _appendMultilineText

* Assign lang for createTextNode content

* Add language attributes to HTML pages
2021-02-08 17:52:35 -05:00
toasted-nutbread
c6315cdb8c
え deinflection (#1343)
* Add -e deinflections

* Add tests

* Add more rules for double え
2021-02-08 17:52:30 -05:00
toasted-nutbread
ace6e92d55
Update chrome://extensions/shortcuts URLs to be clickable (#1342) 2021-02-08 17:52:25 -05:00
toasted-nutbread
9f5cbaac5a
Frame ancestry handler refactor (#1352)
* Validate source window before handling messages

* Add unregisterHandler to CrossFrameAPI

* Refactor the process FrameAncestryHandler uses to get ancestor frame IDs

* Store a mapping of child frame information

* Update getFrameAncestryInfo to only run once
2021-02-06 16:19:55 -05:00
toasted-nutbread
356e7f5274
Add FrameAncestryHandler (#1351) 2021-02-06 14:32:21 -05:00
toasted-nutbread
8f97ca0aac
Permissions toggle controller (#1347)
* Move file, rename class

* Expose required permissions in an attribute

* Update selector

* Update attribute

* Fix global declaration order
2021-02-04 22:17:42 -05:00
toasted-nutbread
47f16862d0
Fix incorrect clipboard setting target (#1346) 2021-02-04 21:12:32 -05:00
toasted-nutbread
6c9f4a2be9 Update version 2021-01-31 16:18:54 -05:00
toasted-nutbread
6218b0d8f7
Fix the settings page trying to create a popup window (#1341) 2021-01-31 16:18:17 -05:00
toasted-nutbread
b0b201fc6a
Update default settings page to the v2 page (#1339) 2021-01-31 11:58:57 -05:00
toasted-nutbread
08a87bd007
Settings permissions info display (#1338)
* Add getAllPermissions function

* Add permissionsChanged event

* Update ClipboardPopupsController to show permissions validation info

* Add invalid indicator

* Display invalid indicator when permissions are not valid

* Fix border color transition not being necessary on input-suffix-button
2021-01-31 11:55:11 -05:00
toasted-nutbread
9e83faa02c
Html lint (#1336)
* Move style rules

* Fix non-unique IDs

* Remove erroneous ids

* Add title

* Fix invalid closing tag

* Install html-validate

* Add .htmlvalidate.json

* Update HTML and styles

* Add test-lint-html

* Update test files

* Update test-lint-html/css commands to have more explicit targets
2021-01-30 20:44:54 -05:00
toasted-nutbread
60c38ab83c
Modal refactor (#1335)
* Rename modal-container to modal

* Update how modal IDs are handled

* Fix invalid modal check

* Update modal IDs
2021-01-30 19:47:16 -05:00
toasted-nutbread
828c4b11c1
Permissions requesting fixes (#1334)
* Fix permissions requests not occurring during user interaction

* Update toggle after changing permissions

* Update functions

* Update clipboard requests
2021-01-30 15:05:08 -05:00
toasted-nutbread
a802666d8d
Update error handling for navigator.clipboard (#1333) 2021-01-30 15:03:19 -05:00
toasted-nutbread
7177694419
Fix the alt key opening the menu in KBM input fields on Firefox (#1332) 2021-01-30 14:15:27 -05:00
toasted-nutbread
0ba1427775
Fix null not being handled properly in _findTab result (#1331) 2021-01-30 14:06:43 -05:00
toasted-nutbread
d0b8b605db
Add note errors (#1329)
* Update _addAnkiNote to track errors

* Change comparison

* Update anki note adding to show errors

* Fix template

* Show errors when Anki card creation behaves unexpectedly

* Update some errors related to anki media injection

* Update addAnkiNote error handling

* Improve Anki errors

* Simplify error messages related to template rendering
2021-01-30 12:33:29 -05:00
toasted-nutbread
af6e9a8153
Fix CSP error when reading images from the clipboard using the paste command (#1328) 2021-01-30 11:15:11 -05:00
toasted-nutbread
588d8a681a
Display notification style updates (#1327)
* Add scrollbar-inverse styles

* Update notification styles to support better overflowing
2021-01-29 22:12:24 -05:00
toasted-nutbread
04cf4ec8d5
Settings and welcome page improvements (#1326)
* Update wording to be less repetitive

* Remove the shadow theme option from the welcome page, to avoid confusion

* Update input sizes

* Update select text to not clip the triangle icon

* Update wording

* Update descriptions

* Remove "popup" to not exclude the search page
2021-01-29 19:10:57 -05:00
toasted-nutbread
c7c5bab1a9
Fix incorrect function (#1325) 2021-01-28 21:38:13 -05:00