diff --git a/ccm-cms/src/main/resources/META-INF/resources/components/librecms/cmsEditor.xhtml b/ccm-cms/src/main/resources/META-INF/resources/components/librecms/cmsEditor.xhtml
index 33c701d78..c0ff9f7be 100644
--- a/ccm-cms/src/main/resources/META-INF/resources/components/librecms/cmsEditor.xhtml
+++ b/ccm-cms/src/main/resources/META-INF/resources/components/librecms/cmsEditor.xhtml
@@ -879,7 +879,7 @@
{
+ return cmsEditor
+ .getEditor()
+ .chain()
+ .focus()
+ .setLibreCmsAudio()
+ .insertContent("
")
+ .run();
+ },
+ can: (cmsEditor) => {
+ return cmsEditor
+ .getEditor()
+ .can()
+ .chain()
+ .focus()
+ .setLibreCmsAudio()
+ .run();
+ },
+ },
{
selector: ".tiptap-insert-image",
command: (cmsEditor) => {
@@ -568,6 +591,27 @@ const BUTTONS: CmsEditorButton[] = [
.run();
},
},
+ {
+ selector: ".tiptap-insert-video",
+ command: (cmsEditor) => {
+ return cmsEditor
+ .getEditor()
+ .chain()
+ .focus()
+ .setLibreCmsVideo()
+ .insertContent("
")
+ .run();
+ },
+ can: (cmsEditor) => {
+ return cmsEditor
+ .getEditor()
+ .can()
+ .chain()
+ .focus()
+ .setLibreCmsVideo()
+ .run();
+ },
+ },
// {
// selector: "",
// command: cmsEditor => {},
@@ -732,6 +776,7 @@ class CmsEditorBuilder {
const editor: Editor = new Editor({
element: canvasElement,
extensions: [
+ AudioNode,
Gapcursor,
ImageNode,
StarterKit,
@@ -746,6 +791,7 @@ class CmsEditorBuilder {
TableRow,
TableHeader,
TableCell,
+ VideoNode,
],
content: variant,
});
diff --git a/ccm-cms/src/main/typescript/content-sections/cms-editor/audio-node/audio-node.ts b/ccm-cms/src/main/typescript/content-sections/cms-editor/audio-node/audio-node.ts
index cc4c70a00..43fe42024 100644
--- a/ccm-cms/src/main/typescript/content-sections/cms-editor/audio-node/audio-node.ts
+++ b/ccm-cms/src/main/typescript/content-sections/cms-editor/audio-node/audio-node.ts
@@ -415,12 +415,12 @@ function loadAudioAssets(
"click",
(event) => {
const audioUrl = `/content-sections/info/audio/uuid-${audioAsset["uuid"]}`;
- node.attrs.imgSrc = audioUrl;
+ node.attrs.audioSrc = audioUrl;
if (audioElem) {
audioElem.src = audioUrl;
} else {
console.error(
- "img element not found."
+ "audio element not found."
);
}
}