From 2653cf75410339842e7fde33153a6f62aa6931ba Mon Sep 17 00:00:00 2001 From: Helmi Akermi <70575401+hakermi@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:25:29 +0100 Subject: [PATCH] feat: Add note toc plugin styles to generated sources - EXO-75747 - Meeds-io/MIPs#161 (#1255) Add note toc plugin styles in generated sources --- notes-webapp/pom.xml | 57 +++++++++++++++---- .../eXo/wiki/ckeditor/plugins/toc/toc.css | 7 +-- .../components/NoteFullRichEditor.vue | 28 +++++---- .../notes/components/NotesOverview.vue | 2 + pom.xml | 6 ++ 5 files changed, 74 insertions(+), 26 deletions(-) diff --git a/notes-webapp/pom.xml b/notes-webapp/pom.xml index b914c8f6f6..91a96ea493 100644 --- a/notes-webapp/pom.xml +++ b/notes-webapp/pom.xml @@ -40,16 +40,6 @@ com.github.eirslett frontend-maven-plugin - - org.apache.maven.plugins - maven-war-plugin - - - WEB-INF/lib/*.jar - - maven-resources-plugin @@ -85,6 +75,43 @@ true + + c-copy-resources + generate-sources + + copy-resources + + + ${project.build.directory}/src/main/webapp/skin/css/toc + + + src/main/webapp/javascript/eXo/wiki/ckeditor/plugins + + toc/*.css + + + + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ${project.build.directory}/src/main/webapp/skin/css/toc + + + @@ -140,6 +167,16 @@ + + org.apache.maven.plugins + maven-war-plugin + + + WEB-INF/lib/*.jar + + diff --git a/notes-webapp/src/main/webapp/javascript/eXo/wiki/ckeditor/plugins/toc/toc.css b/notes-webapp/src/main/webapp/javascript/eXo/wiki/ckeditor/plugins/toc/toc.css index daa22d9b1c..58f551059c 100644 --- a/notes-webapp/src/main/webapp/javascript/eXo/wiki/ckeditor/plugins/toc/toc.css +++ b/notes-webapp/src/main/webapp/javascript/eXo/wiki/ckeditor/plugins/toc/toc.css @@ -38,9 +38,8 @@ cursor: default; } -.navigation-img-wrapper .cke_widget_selectImage { - margin-bottom: 0!important; - margin-right: 4px !important; +.navigation-img-wrapper .cke_widget_image { + margin: 0 0 0 10px !important; } #remove-treeview { @@ -57,7 +56,7 @@ display: none; } -.cke_widget_wrapper.cke_widget_inline.cke_widget_selectImage.cke_image_nocaption #remove-treeview { +.cke_widget_wrapper.cke_widget_inline.cke_widget_image.cke_image_nocaption #remove-treeview { top: -55px!important; right: -95px!important; diff --git a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue index 682e1f8fb3..7911341206 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes-rich-editor/components/NoteFullRichEditor.vue @@ -247,6 +247,7 @@ export default { instanceReady() { if (this.instanceReady) { this.$emit('editor-ready', this.editor); + this.bindNavigationRemoveListener(); } } }, @@ -484,20 +485,9 @@ export default { const treeviewParentWrapper = self.editor.window.$.document.getElementById('note-children-container'); if ( treeviewParentWrapper ) { - treeviewParentWrapper.contentEditable='false'; + treeviewParentWrapper.contentEditable = 'false'; } - const removeTreeviewBtn = evt.editor.document.getById( 'remove-treeview' ); - if ( removeTreeviewBtn ) { - evt.editor.editable().attachListener( removeTreeviewBtn, 'click', function() { - const treeviewParentWrapper = evt.editor.document.getById( 'note-children-container' ); - if ( treeviewParentWrapper) { - treeviewParentWrapper.remove(); - self.noteObject.content = evt.editor.getData(); - } - self.setFocus(); - }); - } window.setTimeout(() => self.setFocus(), 50); self.$root.$applicationLoaded(); self.instanceReady = true; @@ -623,6 +613,20 @@ export default { component.typingTimer = setTimeout(function () { component.isUserTyping = false; }, 1000); + }, + bindNavigationRemoveListener() { + const removeTreeviewBtn = this.editor.document.getById('remove-treeview'); + if (removeTreeviewBtn) { + const self = this; + this.editor.editable().attachListener(removeTreeviewBtn, 'click', function () { + const treeviewParentWrapper = self.editor.document.getById('note-children-container'); + if (treeviewParentWrapper) { + treeviewParentWrapper.remove(); + self.noteObject.content = self.editor.getData(); + } + self.setFocus(); + }); + } } } }; diff --git a/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue b/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue index 174ed65ae1..45d0515459 100644 --- a/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue +++ b/notes-webapp/src/main/webapp/vue-app/notes/components/NotesOverview.vue @@ -681,6 +681,8 @@ export default { noteArticle.published = publicationSettings?.publish; noteArticle.targets = publicationSettings?.selectedTargets; noteArticle.audience = publicationSettings?.selectedAudience; + noteArticle.isHomeDefaultContent = this.isHomeNoteDefaultContent; + noteArticle.hasChildren = this.hasChildren; this.isPublishing = true; if (note) { this.$notesService.updateNoteById(note).then(() => { diff --git a/pom.xml b/pom.xml index eb2123aff2..9a0d283c7b 100644 --- a/pom.xml +++ b/pom.xml @@ -111,6 +111,12 @@ ${project.version} pom + + ${project.groupId} + notes-webapp + ${project.version} + sources + ${project.groupId} notes-packaging