Commit Graph

3551 Commits

Author SHA1 Message Date
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
723a5a5a35
Update eslint rules (#1401) 2021-02-15 12:38:45 -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
d97c84f8ac
Update lint definitions for sandboxed files (#1395) 2021-02-14 18:20:35 -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
0117df6bd8
Update lint and tests (#1388)
* Update paths to no longer use bg/, fg/, or mixed/

* Only allow modal-jquery.js to use jQuery
2021-02-14 11:24:43 -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
acda45c598
Add information about communication port bugs (#1380) 2021-02-13 17:21:05 -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