Extend classes documentation

This should encourage developers and users of this service pick the
right tool for the right job.
This commit is contained in:
Simon Rozman 2024-06-11 11:05:14 +02:00
parent a5bc133d5e
commit 2f8b8d0e45

View File

@ -20,6 +20,12 @@ window.addEventListener('resize', () =>
*
* Base class for all grammar-checking services
*
* This class provides properties and implementations of methods common to
* all types of HTML controls.
*
* This is an intermediate class and may not be used directly in client
* code.
*
*************************************************************************/
class BesService {
constructor(hostElement) {
@ -356,6 +362,14 @@ class BesService {
*
* Grammar-checking service base class for tree-organized editors
*
* This class provides common properties and methods for HTML controls
* where text content is organized as a DOM tree. The grammar is checked
* recursively and the DOM elements in tree specify which parts of text
* represent same unit of text: block element => one standalone paragraph
*
* This is an intermediate class and may not be used directly in client
* code.
*
*************************************************************************/
class BesTreeService extends BesService {
constructor(hostElement) {
@ -727,6 +741,13 @@ class BesTreeService extends BesService {
*
* DOM grammar-checking service
*
* This class provides grammar-checking functionality to contenteditable=
* "true" HTML controls.
*
* May also be used on most of the HTML elements to highlight grammar
* mistakes. Replacing text with suggestions from the grammar-checker will
* not be possible when contenteditable is not "true".
*
*************************************************************************/
class BesDOMService extends BesTreeService {
constructor(hostElement) {
@ -799,6 +820,9 @@ class BesDOMService extends BesTreeService {
*
* CKEditor grammar-checking service
*
* This class provides grammar-checking functionality to CKEditor
* controls.
*
*************************************************************************/
class BesCKService extends BesTreeService {
constructor(hostElement, ckEditorInstance) {
@ -940,6 +964,13 @@ class BesCKService extends BesTreeService {
*
* Plain-text grammar-checking service
*
* This class provides grammar-checking functionality to contenteditable=
* "plaintext-only" HTML controls.
*
* Note: Chrome and Edge only, as Firefox reverts contenteditable=
* "plaintext-only" to "false". The grammar mistakes will be highlighted
* nevertheless, but consider using BesDOMService on Firefox instead.
*
*************************************************************************/
class BesPlainTextService extends BesService {
constructor(hostElement) {
@ -1359,6 +1390,9 @@ class BesPlainTextService extends BesService {
*
* Grammar mistake popup dialog
*
* This is internal class implementing the pop-up dialog user may invoke
* by clicking on a highlighted grammar mistake in text.
*
*************************************************************************/
class BesPopup extends HTMLElement {
constructor() {