From 7b75e597c5752d84db968aa93bd0621b5e7ad4a3 Mon Sep 17 00:00:00 2001 From: Sofien Haj Chedhli Date: Mon, 14 Oct 2024 16:17:08 +0100 Subject: [PATCH] feat: Update note editor config to hide unnecessary extensions in single note view - EXO-74712 - Meeds-io/MIPs#161 (#1164) --- .../src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js b/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js index 6231ce774..80a91a367 100644 --- a/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js +++ b/notes-webapp/src/main/webapp/WEB-INF/conf/wiki/ckeditor/config.js @@ -35,6 +35,7 @@ CKEDITOR.editorConfig = function (config) { if (webPageNote) { blocksToolbarGroup.splice(blocksToolbarGroup.indexOf('tagSuggester'), 1); blocksToolbarGroup.splice(blocksToolbarGroup.indexOf('InsertOptions'), 1); + blocksToolbarGroup.splice(blocksToolbarGroup.indexOf('attachFile'), 1); } const toolbar = [ {name: 'accessibility', items: ['A11ychecker']}, @@ -69,9 +70,12 @@ CKEDITOR.editorConfig = function (config) { }, { name: 'blocks', - items: ['Blockquote', 'attachFile'] + items: ['Blockquote'] }, ]; + if (!webPageNote) { + mobileToolbar[mobileToolbar.findIndex(item => item.name ==='blocks')].items.push('attachFile'); + } let extraPlugins = `a11ychecker,balloonpanel,indent,indentblock,indentlist,codesnippet,sharedspace,copyformatting,table,tabletools,embedsemantic,autolink,colordialog${!webPageNote && ',tagSuggester' || ''},emoji,link,font,justify,widget,${!webPageNote && ',insertOptions' || ''},contextmenu,tabletools,tableresize,toc,linkBalloon,suggester`; let removePlugins = `image,confirmBeforeReload,maximize,resize,autoembed${webPageNote && ',tagSuggester' || ''}`;