Skip to content

Build your personal knowledge base with Trilium Notes

client: Add some JSDoc

Elian Doran6a11f9c073b5
diff --git a/src/public/app/widgets/ribbon_widgets/classic_editor_toolbar.js b/src/public/app/widgets/ribbon_widgets/classic_editor_toolbar.js
index a15c6c76bd..ff58c19eaf 100644
--- a/src/public/app/widgets/ribbon_widgets/classic_editor_toolbar.js
+++ b/src/public/app/widgets/ribbon_widgets/classic_editor_toolbar.js
@@ -16,6 +16,12 @@ const TPL = `\
</style>
`;
+/**
+ * Handles the editing toolbar when the CKEditor is in decoupled mode.
+ *
+ * <p>
+ * The ribbon item is active by default for text notes, as long as they are not in read-only mode.
+ */
export default class ClassicEditorToolbar extends NoteContextAwareWidget {
get name() {
return "classicToolbar";
diff --git a/src/public/app/widgets/type_widgets/editable_text.js b/src/public/app/widgets/type_widgets/editable_text.js
index 36d4d66395..43500a7ae4 100644
--- a/src/public/app/widgets/type_widgets/editable_text.js
+++ b/src/public/app/widgets/type_widgets/editable_text.js
@@ -107,6 +107,12 @@ function buildListOfLanguages() {
];
}
+/**
+ * The editor can operate into two distinct modes:
+ *
+ * - Ballon block mode, in which there is a floating toolbar for the selected text, but another floating button for the entire block (i.e. paragraph).
+ * - Decoupled mode, in which the editing toolbar is actually added on the client side (in {@link ClassicEditorToolbar}), see https://ckeditor.com/docs/ckeditor5/latest/examples/framework/bottom-toolbar-editor.html for an example on how the decoupled editor works.
+ */
export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
static getType() { return "editableText"; }