Commit Graph

2290 Commits

Author SHA1 Message Date
toasted-nutbread
b612bd8b8d
PopupProxy refactor (#609)
* Remove setDisabled member; replace with an event

* Pass frameOffsetForwarder directly to PopupProxy

* Replace .start with .prepare

* Make onMessage private

* Make message safer and handle unexpected inputs
2020-06-14 14:06:52 -04:00
toasted-nutbread
8d1a276a83
Remove debug log (#603) 2020-06-13 10:42:59 -04:00
toasted-nutbread
8a7ff6a18c
Replace XMLHttpRequest (#562)
* Replace XMLHttpRequest with fetch

* Implement fetch placeholder for tests
2020-06-13 10:23:04 -04:00
toasted-nutbread
5cba421201
Update the badge icon if the backend experiences an error (#602) 2020-06-13 10:20:12 -04:00
toasted-nutbread
8bc15e60b5
Detect language tags starting with "ja_" (#596) 2020-06-13 10:18:44 -04:00
toasted-nutbread
a84f188b73
Handle cases where platform info is not available (#597)
* Handle cases where platform info is not available

* Safely return the correct os property
2020-06-10 20:58:46 -04:00
toasted-nutbread
839e306cac
Immediate backend event handlers (#555)
* Add function to await until prepare is completed

* Create BackendEventHandler to synchronously set up event handling
2020-06-07 21:50:14 -04:00
toasted-nutbread
9767b76553
Use cross frame API (#553)
* Use new CrossFrameAPI for popup proxy communication

* Remove use of old cross-frame communication classes

* Remove use of old cross-frame communication files

* Make the crossFrame object a member of the api object
2020-06-07 21:40:11 -04:00
siikamiika
b614aca3dd
fix css class name (#591)
Broken in 90af55d4c84f545635f238178b30748a0e8093ee
2020-06-07 00:08:46 +03:00
siikamiika
0384e2afef
scale background icon when page is zoomed (#592) 2020-06-07 00:08:20 +03:00
toasted-nutbread
2c58b1c109
Limit action port message size (#587)
* Add onDisconnect handler

* Update how error is posted

* Update action ports to send long messages in fragments

* Remove ack timer

* Move message destructuring into try block
2020-05-31 18:17:12 -04:00
toasted-nutbread
cfd3a1ec3a
Update AudioController to not use mutable options references (#585) 2020-05-30 21:54:38 -04:00
toasted-nutbread
db209c9116
Generic settings controller merge (#584)
* Update how optionsContext is assigned to targets

* Add getSettings and modifySettings

* Merge DOMSettingsBinder into GenericSettingController

* Remove old DOMSettingsBinder
2020-05-30 21:53:36 -04:00
toasted-nutbread
ce7f9dd09a
Update how assignment of general.enableClipboardPopups works (#583) 2020-05-30 16:24:51 -04:00
toasted-nutbread
976a200ffc
Backup update (#582)
* Add function to assign all settings

* Update how settings backups are restored

* Remove page reload

* Update profile index after importing
2020-05-30 16:23:56 -04:00
toasted-nutbread
c8810bc929
Update AnkiController (#581)
* Update how fields are populated

* Update how fields are modified after a model change

* Update how _onFieldsChanged assigns fields

* Update how spinner is hidden

* Remove jQuery usage

* Use non-jQuery events
2020-05-30 16:22:51 -04:00
toasted-nutbread
ad8df26b6b
Update AnkiTemplatesController (#580)
* Use this._defaultFieldTemplates

* Don't use mutable options

* Remove some use of jQuery
2020-05-30 16:22:05 -04:00
toasted-nutbread
395a0f4096
Update GenericSettingController to use DOMSettingsBinder (#578) 2020-05-30 16:20:31 -04:00
toasted-nutbread
f228078613
SettingsController API update (#579)
* Include optionsContext as part of optionsChanged event

* Add get/modify functions
2020-05-30 11:24:34 -04:00
toasted-nutbread
789da0206b
Organize settings/main.js (#577) 2020-05-30 09:50:33 -04:00
toasted-nutbread
63a3e56367
Use SettingsController (#576)
* Use settingsController internally in settings/main.js

* Replace modifyingProfileChange with SettingsController.optionsContextChanged

* Update ClipboardPopupsController to use SettingsController

* Store reference to checkbox

* Use this._settingsController for everything

* Change where current profile is initially assigned from

* Remove some unnecessary async calls

* Move setup calls

* Update AnkiTemplatesController to use SettingsController

* Cache default field templates

* Update AnkiController to use SettingsController

* Update AudioController to use SettingsController

* Update SettingsBackup to use SettingsController

* Update DictionaryController to use SettingsController

* Update GenericSettingController to use SettingsController

* Update ProfileController to use SettingsController

* Remove unused

* Remove unused

* Replace some uses of api.options* functions

* Fix missing awaits

* Fix invalid function
2020-05-30 09:33:13 -04:00
toasted-nutbread
1a5a37c9e4
Fix frontend being null if messages are received early (#575) 2020-05-30 09:31:46 -04:00
toasted-nutbread
18f376358c
Generic settings controller + clipboard popups controller (#573)
* Create GenericSettingController

* Create ClipboardPopupsController
2020-05-29 20:33:40 -04:00
toasted-nutbread
df040b104a
Popup preview frame refactor (#572)
* Use private variables

* Use private methods

* Update overrides

* Make prepare called in the entry point function

* Change format of handlers

* Change where _apiOptionsGetOld is assigned

* Rename class
2020-05-29 20:29:19 -04:00
toasted-nutbread
9624566d2a
Convert popup-preview.js to a class (#571)
* Convert popup-preview.js to a class

* Don't invoke 'prepare'
2020-05-29 20:28:12 -04:00
toasted-nutbread
418e8a57bf
Convert dictionaries.js and storage.js to classes (#570)
* Convert dictionaries.js to a class

* Remove storage spinner

* Convert storage.js to a class

* Move dataset assignments into main.js
2020-05-29 20:25:22 -04:00
toasted-nutbread
c62f980f37
Audio controller (#569)
* Convert audio.js into a class

* Move audio-ui.js classes into audio.js

* Rename fields

* Merge classes

* Remove audio-ui.js
2020-05-29 19:56:38 -04:00
toasted-nutbread
5f9889fd26
Anki settings controllers (#567)
* Convert anki-templates.js to a class

* Convert anki.js to a class
2020-05-29 19:52:51 -04:00
toasted-nutbread
fde0072118
Change profile.js into a class (#566)
* Update how settings profile is stored and accessed

* Convert profiles.js into a class

* Rename members of ProfileController
2020-05-29 19:47:18 -04:00
toasted-nutbread
8537c8f386
Create class to abstract access, mutation, and events for settings (#565) 2020-05-29 19:45:54 -04:00
toasted-nutbread
37f0396f1c
DOM binder fixes (#564)
* Fix incorrect updateValue function

* Add source
2020-05-29 19:44:53 -04:00
toasted-nutbread
9d40955fc8
Update legal.html to include full licenses (#563) 2020-05-24 22:10:50 -04:00
toasted-nutbread
6dd6af05e1
Update background global object usage (#556)
* Omit global window object for scripts used on the background page

* Validate document exists before using

* Remove dom.js from background.html
2020-05-24 14:01:21 -04:00
toasted-nutbread
3c4c82dcfc
Ensure single popup factory (#554)
* Add createPopupFactory

* Ensure only a single PopupFactory is generated
2020-05-24 14:00:32 -04:00
toasted-nutbread
13f57cccba
Settings backup refactor (#551)
* Update backup.js to be a class

* Move utilReadFileArrayBuffer
2020-05-24 13:56:46 -04:00
toasted-nutbread
66e1185686
Settings binder (#542)
* Fix _modifySetting being async

* Return values for modifySettings's set and splice actions

* Add apiGetSettings

* Create a class which can accumulate tasks to run in bulk

* Create a class which binds input elements to customizable sources

* Create class which binds input elements to settings

* Add support for value transforms

* Remove redundant ObjectPropertyAccessor.getPathArray

* Fix not using correct types for input.min/max/step

* Fix wrong condition

* Use api object
2020-05-24 13:50:34 -04:00
toasted-nutbread
c800444a0d
Ensure the return value of promiseTimeout always has .resolve and .reject (#550) 2020-05-24 13:39:50 -04:00
toasted-nutbread
3089bb7908
Settings refactor (#541)
* Remove debug info

* Trigger onOptionsUpdated instead of formWrite when profile changes

* Update how Anki field changes are observed

* Update how general.enableClipboardPopups setting is changed

* Change where ankiTemplatesUpdateValue occurs

* Change where onDictionaryOptionsChanged occurs

* Remove unused global declarations

* Remove stray data attribute
2020-05-24 13:38:48 -04:00
toasted-nutbread
a595a0a481
Add icons (#540)
* Add icons

* Update icons
2020-05-24 13:37:49 -04:00
toasted-nutbread
4d2e5b93f4
Style adjustments (#537)
* Remove newlines for term-definition-item-template

* Update how action button icons are styled

* Fix spacing

* Group text colors together

* Correct image styles

* Fix missing </span>
2020-05-24 13:37:23 -04:00
toasted-nutbread
c61a87b152
API refactor (#532)
* Convert api.js into a class instance

* Use new api.* functions

* Fix missing binds

* Group functions with progress callbacks together

* Change style

* Fix API override not working
2020-05-24 13:30:40 -04:00
toasted-nutbread
83a577fa56
Add missing spreads (#552) 2020-05-23 14:18:02 -04:00
toasted-nutbread
694120b8a5
Cross frame communication (#531)
* Set up new cross-frame port connector

* Create classes for cross-frame API invocation with replies

* Remove event listeners on disconnect
2020-05-23 13:34:55 -04:00
toasted-nutbread
9a657214ad
Add support for additional types of event listeners (#522)
* Add support for additional types of event listeners

* Fixes
2020-05-23 13:19:31 -04:00
d0dcff765f Version bump to 20.5.22.0 2020-05-22 17:41:33 -07:00
siikamiika
39df44eca4
Fix "tags" template (#539)
* fix tag templates for merge and group modes

* update version upgrade

* adjust upgrade replacement order
2020-05-22 20:03:34 -04:00
toasted-nutbread
dd673f0b26
Dynamic loader load style (#521)
* Remove unnecessary load of /fg/css/client.css

* Replace dynamicLoader.loadStyles with dynamicLoader.loadStyle

* Replace Popup._injectStylesheet with dynamicLoader.loadStyle

* Remove unused global
2020-05-19 20:33:06 -04:00
toasted-nutbread
dd6c3015c4
Use both shadowRoot and openOrClosedShadowRoot (#534) 2020-05-10 14:10:02 -04:00
toasted-nutbread
c38cd70e91
Load frame content using contentDocument.location.href instead of src attribute (#529) 2020-05-10 14:08:18 -04:00
toasted-nutbread
9742d5662b
Use CSS variables for themes (#528)
* Update formatting

* Merge default tag color with category-less tags

* Use CSS variables for colors

* Add dark theme colors

* Move color variables into display.css

* Remove old stylesheets

* Update headings

* Bump minimum Firefox version to support CSS var()

* Revert popular kanji text color
2020-05-10 14:07:25 -04:00