Commit Graph

3813 Commits

Author SHA1 Message Date
toasted-nutbread
10e9f7acb8
Fix the color of links in display footer notifications (#2151) 2022-05-21 15:28:36 -04:00
toasted-nutbread
e498e2d029
Display notification updates (#2149)
* Expose container and node on DisplayNotification

* Add Display.createNotification

* Rename methods

* Rename fields

* Remove double newline
2022-05-20 18:08:20 -04:00
toasted-nutbread
31e20c889e
ESlint JSdoc (#2148)
* Install eslint-plugin-jsdoc

* Initial rules setup

* Update lists

* Use @returns rather than @return

* Remove error throwing code which is never executed

* Fix issues relating to @throws

* General error fixes

* Update Display type documentation

* Various doc fixes

* Fix invalid tuple syntax

* Doc updates

* Remove unused

* Doc updates

* Enable jsdoc/require-returns

* Update rules

* Update remaining rules
2022-05-20 10:28:38 -04:00
toasted-nutbread
ae0ad227c0
Add mode documentation about the types used by Translator (#2147) 2022-05-19 20:16:40 -04:00
toasted-nutbread
6e239638bb
DOMTextScanner updates (#2146)
* JSDoc updates

* Move function

* Simplify

* Refactor return type

* Refactor getElementSeekInfo return type
2022-05-18 21:43:19 -04:00
toasted-nutbread
a33a00f5ae
CssStyleApplier updates (#2145)
* Update internal structure of _styleData

* Rename parameter

* Rename

* Add docs
2022-05-18 19:40:47 -04:00
toasted-nutbread
18beb241a7
Fix this._horizontalTextPositionBelow being assigned incorrectly (#2144) 2022-05-18 19:12:24 -04:00
toasted-nutbread
bd53f2bbfb
Update _getNodeNoteIds to return integer IDs (#2142) 2022-05-16 22:20:53 -04:00
toasted-nutbread
63d37c872b
Popup positioning improvements (#2135)
* Rename elementRect to sourceRect

* Add getRects function to TextSourceElement and TextSourceRange

* Add jsdocs

* Remove unnecessary valid parameter

* Remove default parameter

* Make optionsContext optional

* Remove unnecessary checks

* Update sourceRect to use left/right rather than x/y

* Update the return type of Popup*.getFrameRect

* Rename some unrelated rect vars for disambiguation

* Disambiguate between Popup.Rect and Popup.ValidRect

* Move sourceRect destructuring

* Pass multiple source rects

* Simplify

* Change Rect to use right/bottom rather than width/height

* Update how popup offset is applied

* Simplify frame offset

* Remove _applyFrameOffset

* Use right/bottom rather than width/height

* Simplify some positioning settings

* Update parameter names for clarity

* Fix typos

* Refactor data type for _getPosition* functions

* Support using multiple source rects

* Combine _getPosition functions

* Refactor

* Expose after dataset value

* Consistently use this's property

* Add jsdoc
2022-05-16 21:45:22 -04:00
toasted-nutbread
96f5a06c80
Dependency update (#2141)
* Update dependencies

* Update JSZip to 3.9.1
2022-05-16 21:36:30 -04:00
toasted-nutbread
9941d583a0
Parse5 update (#2140)
* Update build-libs.js

* Add a test for build-libs.js

* Update parse5

* Rebuild parse5

* Update build-libs.js to generate consistent path names

* Rebuild
2022-05-16 21:25:05 -04:00
toasted-nutbread
5a723034b8
Dictionary validate updates (#2137)
* Reuse JsomSchema instance

* Install ajv

* Add support for using ajv as a JSON schema validator

* Update usage
2022-05-16 20:09:38 -04:00
toasted-nutbread
84c9231a5e
Update some JSON schemas to be more compliant to the spec (#2136) 2022-05-16 19:56:02 -04:00
toasted-nutbread
8b206e4d04
Update structured content tests (#2134) 2022-05-14 18:45:18 -04:00
toasted-nutbread
fd75e91e75
Ignore DOMExceptions thrown by assigning an invalid dataset property (#2133) 2022-05-14 18:16:13 -04:00
toasted-nutbread
8b6f526dc6
Regex optimizations (#2132)
* Remove regex construction for SimpleDOMParser.getElementsByClassName

* Remove regex construction for CssStyleApplier._getRulesForClass

* Rename, add jsdoc for clarity
2022-05-14 18:13:04 -04:00
toasted-nutbread
5dcc2315d2
Structured content auto language (#2131)
* Pass JapaneseUtil instance to StructuredContentGenerator

* Move body of createStructuredContent to an internal function

* Create _createStructuredContentGenericElement

* Wrap structured content in a <span>

* Change _createStructuredContent to _appendStructuredContent

* Add public appendStructuredContent function

* Add missing return

* Remove unused _createDocumentFragment

* Automatically assign lang=ja for content with Japanese characters
without an explicit language

* Add test
2022-05-14 18:12:57 -04:00
Stephen Kraus
6a74746113
Add new structured content features: lists and the HTML lang attribute (#2129)
* Add support for structured content lists and `list-style-type` style

A full list of supported style types is documented here:
https://developer.mozilla.org/en-US/docs/Web/CSS/list-style-type

There's nothing in this code preventing a term bank from assigning,
for example, a `list-style-type` style to a `div` element, but it
doesn't seem like browsers will complain about things like that.

* Add support for `lang` attribute in structured content

Support added for the following node types:

"ruby", "rt", "rp", "table", "thead", "tbody", "tfoot", "tr", "td",
"th", "span", "div", "ol", "ul", "li", "a"

I couldn't get it to work for the alt-hover text on "img" tags.

Tests are included in the file
"test/data/dictionaries/valid-dictionary/term_bank_1.json"

* Add styles for structured content lists

* Add override rules for new structured-content list styles

see: https://github.com/FooSoft/yomichan/pull/2129

Co-authored-by: stephenmk <stephenmk@users.noreply.github.com>
2022-05-14 09:59:38 -04:00
dependabot[bot]
e9843f67cb
Bump moment from 2.29.1 to 2.29.2 (#2114)
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-09 10:04:25 -04:00
197ec8c71b Update extension update manifest for Firefox 2022-04-08 09:56:49 -07:00
toasted-nutbread
1256e4bab7 Update version 2022-04-04 19:17:43 -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
77c4d135c7
Add a warning about the future of the Google docs workaround (#2108) 2022-04-03 21:49:33 -04:00
toasted-nutbread
150fcd82ef
Update browser bugs (#2107) 2022-04-03 20:05:55 -04:00
toasted-nutbread
b896724aac
Update Popup to not store the full options object (#2106) 2022-04-03 17:09:51 -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
3150da92fe
Update input action prevention settings (#2104)
* Update styles for the input action prevention modal

* Add information
2022-04-02 15:24:59 -04:00
toasted-nutbread
eb80fb233b
Settings advanced indicators (#2103)
* Update the advanced toggle to have a custom color

* Add indicators to advanced-only settings
2022-04-02 14:59:16 -04:00
toasted-nutbread
ea1d64c9dd
Settings page mobile layout updates (#2102)
* Remove use of --settings-group-inner-vertical-margin

* Update alignment
2022-04-02 14:48:57 -04:00
toasted-nutbread
6b88501afd
Text scanner event capture (#2101)
* Add capture parameter to event listeners

* Enable capture
2022-04-02 13:10:39 -04:00
toasted-nutbread
0629a2ddc8
Update node version and dependencies (#2100)
* Update packages

* Update node version used in CI

* Update node packages again using node v16

* Update stylelint-config-recommended
2022-04-02 09:41:25 -04:00
toasted-nutbread
8a1dcbc9f5
Workaround for Google Docs canvas rendering updates (#2096) 2022-04-02 09:38:40 -04:00
toasted-nutbread
7a2ab86609
Structured content links (#2089)
* Update CSS to JSON converter to generalize the remove-property comment

* Fix navigation not being updated when _clearContent is run

* Add structured content schema for link tags

* Add test links

* Add external-link icon

* Pass Display instance to DisplayContentManager

* Update structured content generation

* Update link styles
2022-03-17 19:01:59 -04:00
toasted-nutbread
8aa060337c
AnkiTemplateRendererContentManager (#2088)
* Make function private

* Update comments

* Refactor the content manager that is provided to StructuredContentGenerator in AnkiTemplateRenderer

* Update function to not be async, for API parity
2022-03-14 22:32:08 -04:00
toasted-nutbread
4e15f92329
Rename MediaLoader to DisplayContentManager (#2087) 2022-03-14 21:42:33 -04:00
toasted-nutbread
59ae55252e
Update ClipboardReader.getImage implementation (#2085) 2022-03-13 21:17:48 -04:00
toasted-nutbread
f98f5f9395
Improve Anki storeMediaFile (#2084)
* Use the return value of storeMediaFile

* Update documentation
2022-03-13 21:17:41 -04:00
toasted-nutbread
1590f5218c
Add additional Anki card marker aliases (#2083) 2022-03-13 21:17:35 -04:00
toasted-nutbread
48b2807120
Add support for logging Anki errors on the settings page (#2073) 2022-02-20 09:35:54 -05:00
045eb63a52 Remove a couple of questions from FAQ which are old and no longer relevant. 2022-02-19 11:13:37 -08:00
f6d65878a3 Merge branch 'master' of github.com:FooSoft/yomichan 2022-02-14 20:29:18 -08:00
e4ba71d15d Update dictionary links to point to raw downloads 2022-02-14 20:29:12 -08:00
toasted-nutbread
89a939eb39
Update anki card frequency (#2065)
* Prefer to use displayValue for Anki card frequency values

* Update test data
2022-02-05 21:35:03 -05:00
4e01bf6c85 Update extension update manifest for Firefox 2022-02-05 17:52:14 -08:00
toasted-nutbread
d48ea4dece Update version 2022-02-02 20:44:08 -05: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
3662c07c63
Update node dependencies (#2061)
* Run npm update

* Run npm audit fix

* Update eslint to 8.8.0

* Update eslint-plugin-no-unsanitized to 4.0.1

* Update html-validate to 6.2.0

* Update jsdom to 19.0.0

* Update stylelint to 14.3.0

* Update stylelint-config-recommended to 6.0.0

* Remove dead rule

* Fix rule affecting currentColor keyword
2022-02-02 20:34:21 -05:00
toasted-nutbread
2aea133868
Add info about touch events not working properly for certain webpages (#2060) 2022-02-02 20:09:32 -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
Alex Yatskov
dea018670c
Merge pull request #2054 from FooSoft/dependabot/npm_and_yarn/cached-path-relative-1.1.0
Bump cached-path-relative from 1.0.2 to 1.1.0
2022-01-28 21:22:19 -08:00