Commit Graph

68 Commits

Author SHA1 Message Date
toasted-nutbread
331a2e6294
Add support for guiEditNote to view notes (#2143)
* Add AnkiConnect.guiEditNote

* Update _onApiNoteView to first try guiEditNote

* Add setting

* Update noteView API

* Use setting

* Return which mode was used

* Update DisplayGenerator

* Handle errors in DisplayAnki

* Update docs

* Add isErrorUnsupportedAction function

* Add an allowFallback option to noteView

* Disambiguate

* Simplify now that preferredMode isn't used

* Update settings info

* Implement test buttons

* Update styles

* Update status visibility

* Wrap layout

* Update description

* Update date
2022-05-29 21:24:41 -04:00
toasted-nutbread
e5b53bb238
Hide popup on cursor exit (#2109)
* Update phrasing

* Add new options

* Add settings

* Implement
2022-04-03 22:52:53 -04:00
toasted-nutbread
f61690ea2c
Theme updates (#2105)
* Change siteColor to siteTheme

* Fix potential null exception

* Simplify

* Update display theme assignment

* Add a data-browser-theme attribute

* Add "browser" option for theme

* Create ThemeController

* Add theme-controller.js to relevant pages

* Use ThemeController

* Simplify

* Fix 'light' being used instead of 'default'

* Update the settings values to more accurately reflect their usage

* Change default site theme in display.js

* Remove async

* Restore async for consistency
2022-04-03 16:20:55 -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
258f1b629a
Update sentence termination characters (#2059)
* Add vertical punctuation to terminationCharacters

* Upgrade settings

* Update tests
2022-02-02 20:09:13 -05:00
toasted-nutbread
0e52a1f509
Scanning wildcards (#2042)
* Add scanning.matchTypePrefix option

* Update TextScanner to use matchTypePrefix option

* Add setting

* Update warning
2021-12-18 12:38:39 -05: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
5d4141a429
Google Docs accessibility (#1875)
* Add accessibility option for forcing Google Docs HTML-based rendering

* Update settings

* Send a documentStart message at document start

* Add accessibility script for Google Docs

* Set up accessibility

* Update tests
2021-08-07 12:40:51 -04:00
toasted-nutbread
2ee3e3a7a1
Update pronunciation anki templates (#1842)
* Update anki pronunciation templates

* Expose nasalPositions/devoicePositions

* Update templates to support nasal/devoice positions

* Update test data
2021-07-18 16:01:42 -04:00
toasted-nutbread
d058237ba7
Duplicate scope check all models (#1810)
* Add duplicateScopeCheckAllModels option to createNote

* Add duplicateScopeCheckAllModels option

* Add setting
2021-07-13 20:29:53 -04:00
toasted-nutbread
7a1570885e
Simplify get media structure (#1817)
* Remove format argument of getMedia

* Implement escaping
2021-07-09 20:14:05 -04:00
toasted-nutbread
315dc425e4
Anki card selected text (#1809)
* Add support for injecting the text selection into Anki cards

* Add selection-text

* Upgrade to add {selection-text}

* Update descriptions

* Update test data
2021-07-07 20:00:30 -04:00
toasted-nutbread
9935e154f1
Update options-util tests and comment (#1806) 2021-07-06 22:59:24 -04:00
toasted-nutbread
e88d63fc6d
Template renderer media updates (#1802)
* Add TemplateRendererMediaProvider to abstract media-related functionality

* Update representation of injected media

* Update templates

* Update upgrade file

* Update tests

* Update test data

* Force media to be an object

* Update test data
2021-07-06 19:43:53 -04:00
toasted-nutbread
e155132085
OptionsUtil and tests updates (#1801)
* Update OptionsUtil.update to support an optional targetVersion param

* Update Anki template updates to have an explicit target version
2021-07-05 23:24:06 -04:00
toasted-nutbread
ca97e38bd2
Anki support for structured-content (#1786)
* Update how glossary text is formatted

* Update structured content and image generation

* Pass root data to _createStructuredContentGenerator

* Implement media URLs

* Update documentation

* Update options util

* Apply styles to content

* Improve HTML normalization

* Update DatabaseVM.fetch function

* Update test

* Update test data
2021-07-02 22:46:38 -04:00
toasted-nutbread
6b8cd5e623
Template patcher updates (#1766)
* Don't append anything if the additions is empty

* Simplify update list
2021-06-26 23:55:06 -04:00
toasted-nutbread
cca01e85a3
Improve multiple audio sources (#1718)
* Add url/voice options to audio sources

* Add help for TTS

* Remove old settings

* Update tests

* Update use of audio source URL

* Improve labels for sources with the same type
2021-05-30 12:41:19 -04:00
toasted-nutbread
0232325f96
Refactor json audio source (#1711)
* Move sources to the end of audio options object

* Add custom-json audio source type

* Add support for downloading custom-json

* Remove customSourceType
2021-05-26 20:38:15 -04:00
toasted-nutbread
76276e78da
Expose search query to anki template renderer (#1686)
* Expose query and fullQuery to Anki context

* Add {search-query} marker

* Update test data

* Update tests

* Wrap search query in multiLine
2021-05-17 20:18:37 -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
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
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
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
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
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
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
49b603c756
Remove old settings page (#1524)
* Remove old settings page

* Remove spinner.gif
2021-03-14 22:51:48 -04: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
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
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
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
2b4af57bd7
Move data folder (#1371)
* Move handlebars template files

* Move schema files
2021-02-12 19:56:24 -05:00
toasted-nutbread
a81787c55b
Remove the dictionary tag from the definitionTags (#1324)
* Remove dictionary tag from term definitionTags and kanji tags

* Update test data

* Update templates

* Update tests

* Update information
2021-01-28 21:33:30 -05:00
toasted-nutbread
e610a62ceb
Refactor anki field templates (#1323)
* Update glossary and glossary-single

* Define patch

* Create TemplatePatcher

* Add test
2021-01-28 21:17:10 -05:00
toasted-nutbread
8d292363d4
Update clipboard options organization (#1318)
* Update options organization

* Update general.enableClipboardPopups to clipboard.enableBackgroundMonitor

* Update general.enableClipboardMonitor to clipboard.enableSearchPageMonitor

* Update general.maximumClipboardSearchLength to clipboard.maximumSearchLength

* Update general.autoSearchClipboardContent to clipboard.autoSearchContent
2021-01-26 18:30:01 -05:00
toasted-nutbread
981f73b562
Clipboard lookup skip option (#1314)
* Add autoSearchClipboardContent option

* Hide header if there is any search text

* Add setting for autoSearchClipboardContent

* Add support for autoSearchClipboardContent
2021-01-25 22:05:06 -05:00
toasted-nutbread
ebfef0c748
Multiple custom audio sources (#1303)
* Fix label

* Fix icon size being flexible

* Add schema

* Add customSourceType option

* Update settings

* Pass customSourceType to the audio downloader

* Implement custom audio JSON mode
2021-01-23 22:46:00 -05:00
toasted-nutbread
d21de9df00
Update copyHostSelection to be popup-only (#1267) 2021-01-17 19:35:01 -05:00
toasted-nutbread
d89f23261c
Update default settings page (#1254)
* Update settings v2 to be the default for existing users

* Update information on the old settings page

* Update information on the new settings page

* Update tests
2021-01-16 16:55:40 -05:00
toasted-nutbread
b234294540
Stroke count marker (#1251)
* Add stroke-count definition

* Update options

* Update documentation

* Add helper
2021-01-16 15:29:42 -05:00
toasted-nutbread
8766744aa4
Popup window options (#1245)
* Add popupWindow options

* Add toBoolean converter

* Add settings

* Use new options

* Add test link

* Fix window state not working

* Make the window section advanced only
2021-01-16 10:22:24 -05:00
toasted-nutbread
0a1664ba29
Separate close hotkey (#1242)
* Add focusSearchBox hotkey

* Update close hotkey action

* Update hotkeys
2021-01-15 20:19:56 -05:00
toasted-nutbread
1dcfbf6ba6
Support suspending new anki cards (#1240)
* Add new option: anki.suspendNewCards

* Update Anki APIs

* Suspend card based on options

* Add setting

* Disable wrap for toggle property
2021-01-14 22:42:11 -05:00
toasted-nutbread
84d3af0f8d
Hotkeys (#1236)
* Set up hotkey inputs

* Improve key display

* Add setInput

* Add KeyboardShortcutController

* Update how display handles hotkeys
2021-01-14 20:56:18 -05:00
toasted-nutbread
25080ac82e
Change popupActionBarLocation to top (#1222) 2021-01-10 16:49:40 -05:00
toasted-nutbread
f6a38f40dc
Customizable sentence parsing (#1217)
* Add new sentenceParsing options

* Update TextScanner.setOptions

* Assign terminator/quote maps

* Pass sentence parsing info to extractSentence

* Simplify setting

* Add setting for enableTerminationCharacters

* Create new settings for sentence termination characters
2021-01-10 14:43:06 -05:00
toasted-nutbread
da1e1e5c5b
Sentence parsing options (#1214)
* Rename options.anki.sentenceExt to options.sentenceParsing.scanExtent

* Create sentence parsing icon

* Create new sentence parsing section
2021-01-09 21:25:04 -05:00
toasted-nutbread
8e304b83c6
Translator regex replacements (#1199)
* Add support for regex replacements during the translation process

* Allow assignment of textReplacements

* Rename

* Set up test data

* Write expected data

* Set up options

* Prevent infinite loop if regex matches empty string

* Implement setting controller

* Add support for testing pattern replacements
2021-01-03 12:12:55 -05:00
toasted-nutbread
a02891e52c
Update copyright year (#1194)
* Update copyright year

* Remove redundant Author info
2021-01-01 14:50:41 -05:00