47 Commits

Author SHA1 Message Date
a6130c39ce Move code from popupjs and paste it into main JS file. 2024-02-13 11:42:41 +01:00
fbb9a06a10 Add TODO mark 2024-02-13 11:23:43 +01:00
6bdb339b88 Add MutationObserver for Editor Changes.
This allows detection and handling of deleted 'div' elements, thereby improving error correction and overall editor functionality.
2024-02-13 09:55:37 +01:00
06c88c37cd Support rendering popup after scroll events 2024-02-09 12:18:43 +01:00
fe98c9237a Move styles to .css file and remove redundant class rules. 2024-02-09 10:56:37 +01:00
5d9d22bfef Refactor correction panel creation to support scroll functionality
This feature is not fully tested, there are still some bugs left, i.e., after scroll event the popup is unavailable
2024-02-09 10:38:31 +01:00
40631798d1 Support rendering mistakes for multiple active editors 2024-02-07 14:04:57 +01:00
1efc383c50 Remove editor's and correction-panel's IDs 2024-02-07 13:08:24 +01:00
10d41da4f4 Add readme 2024-02-07 12:44:16 +01:00
bf94c6a53a Enforce VSCode settings for all developers
But continue to allow own launch and other VSCode files per each working
directory.
2024-02-07 12:44:13 +01:00
81240397d7 Allow post-window.onload editor registration
This allows grammar-checking support setup for contentEditable <div>s
added to the DOM tree later.
2024-02-07 12:39:27 +01:00
494107bafb Insert correction panel using JS and add editor IDs to support multiple editors 2024-02-07 11:13:32 +01:00
09be0aec88 Add .prettierrc file with formatting settings 2024-02-07 09:09:07 +01:00
dd5a6ff85b Apply JS formatter 2024-02-07 09:08:53 +01:00
f3f37fff02 Rename methods to describe better what they are doing
clearAllMistakes and addMistake were not clearing mistakes or adding
one. They merely manipulate the mistake markup.
2024-02-06 16:31:34 +01:00
7fc063650c Cache correction panel element
We will create this element dynamically in the future.

Not to collide with sibling editors, we'd need to assign it a unique ID.
--OR--
Just cache the element we will be creating and we won't need countless
document.getElementById() calls.
2024-02-06 16:23:47 +01:00
1ef4cd2a2e Cleanup 2024-02-06 16:00:13 +01:00
bb58472a5c Cleanup
No need for besEditors to be a dictionary any more. This also makes us
id-agnostic with <div class="bes-online-editor">. 😎
2024-02-06 15:58:11 +01:00
e33fb6b8fc Convert into class 2024-02-06 15:44:17 +01:00
01be8afcdf Rename popup component, and render replacement suggestions 2024-02-06 15:07:38 +01:00
b1778aa658 Fix editor referencing
Pass editor data as a function argument rather than perform voodoo to
get it.
2024-02-06 14:55:45 +01:00
6342e8c68f Fix potential use-before-init 2024-02-06 14:33:12 +01:00
2a579b53fd Cleanup 2024-02-06 14:07:09 +01:00
aa7ff184a2 Fix right&bottom edge of point-in-rect test
x==0 and width==100 means the rectangle spans from 0 to 99. 100 is not
part of the rectangle anymore.
2024-02-06 14:04:29 +01:00
c14294d80d Add support for handling editor resize events 2024-02-06 10:59:46 +01:00
a9330e50b9 Update mistake rendering and clearing functionality 2024-02-06 10:11:18 +01:00
41c6c22dfa Enhance popup styles and improve functionality 2024-02-05 14:40:32 +01:00
c364ed71ee Refine popup positioning and update it's styles 2024-02-02 15:34:37 +01:00
12c93bc0b4 On click open correct popup and show error message 2024-02-02 13:06:15 +01:00
c0605e4a60 Respect element lang attribute if present
Should parts of the document specify language, use it for grammar
checking.
2024-02-02 11:10:54 +01:00
5aaf30934a Rename classes to follow 'bes-xyz' naming convention and apply JavaScript formatter 2024-02-02 11:03:37 +01:00
218bac6ece Simplify besGetBlockParent() 2024-02-02 10:44:51 +01:00
b034d5dd56 Add note for .online-editor 2024-02-02 10:40:25 +01:00
887741f061 Minor code revision 2024-02-02 10:34:53 +01:00
4d29dfa06e Refactor code 2024-02-02 10:13:49 +01:00
4e2409fa38 Implement correction panel with highlight functionality for error display 2024-02-02 09:18:28 +01:00
aa3f025c7d Support HTML editing with inline <span> grammar markup 2024-02-01 12:56:36 +01:00
0d8d6e165a Separate internal and LanguageTool data formats
This allows a bit simpler code and less clutter in the LanguageTool
communication.
2024-02-01 09:43:18 +01:00
279c815b15 Make sample text more complicated
To catch as many corner cases as possible.
2024-02-01 09:41:20 +01:00
8fe954993b Reverse sorting order and find a way to apply spans when the range has partially selected a non-text node 2024-01-31 14:59:15 +01:00
9447faa024 Attempt to extend grammar checking to HTML 2024-01-31 12:34:38 +01:00
4470c4fccf Unique function names and cleanup
Since this component is about to be included in other solutions, chance
of name collisions with others should be minimized.
2024-01-31 08:51:25 +01:00
3e4a4e6e91 Support initial and periodic grammar checks 2024-01-30 15:40:44 +01:00
1ce46bf8a2 Create popup component and implement bestr api calls 2024-01-30 10:09:16 +01:00
db9785744f Improve paragraph splitting logic 2024-01-29 14:18:16 +01:00
f733f73509 Implement basic spell checking functionality 2024-01-29 11:04:39 +01:00
93d3dbfd8f Initial commit 2024-01-25 14:06:36 +01:00