diff --git a/mir-module/GruntFile.js b/mir-module/GruntFile.js index cea4ec2c9c..e56b9d0bc1 100644 --- a/mir-module/GruntFile.js +++ b/mir-module/GruntFile.js @@ -20,9 +20,9 @@ module.exports = function(grunt) { }, files : { 'bootstrap/js' : 'bootstrap/dist/js', - 'ckeditor4' : 'ckeditor4/', - 'ckeditor4/plugins/notification/' : 'ckeditor-notification-plugin', - 'ckeditor4/plugins/wordcount/' : 'ckeditor-wordcount-plugin/wordcount', + + 'tinymce' : 'tinymce', + 'tinymce/langs' : 'tinymce-i18n/langs7', 'font-awesome/css' : '@fortawesome/fontawesome-free/css', 'font-awesome/webfonts' : '@fortawesome/fontawesome-free/webfonts', @@ -78,19 +78,18 @@ module.exports = function(grunt) { '<%= globalConfig.moduleDirectory %>/target/classes/META-INF/resources/js/jquery.search-entity.min.js': '<%= globalConfig.moduleDirectory %>/src/main/resources/META-INF/resources/js/jquery.search-entity.js', '<%= globalConfig.moduleDirectory %>/target/classes/META-INF/resources/js/epusta.min.js': '<%= globalConfig.moduleDirectory %>/src/main/resources/META-INF/resources/js/epusta.js', - '<%= globalConfig.moduleDirectory %>/target/classes/META-INF/assets/ckeditor4/config.min.js': '<%= globalConfig.moduleDirectory %>/src/main/resources/META-INF/resources/js/ckeditor-config.js' } } }, }); grunt.registerTask('copy', function() { - const source = getAbsoluteDir(grunt.option('moduleDirectory'))+'/src/main/resources/META-INF/resources/js/ckeditor-config.js'; - const target = getAbsoluteDir(grunt.option('assetsDirectory')) + '/ckeditor4/config.js'; + const source = getAbsoluteDir(grunt.option('moduleDirectory'))+'/src/main/resources/META-INF/resources/js/tinymce-config.js'; + const target = getAbsoluteDir(grunt.option('assetsDirectory')) + '/tinymce/config.js'; fs.copyFile(source, target, (err) => { if (err) { throw err; } - grunt.log('ckeditor config copied!'); + grunt.log('tinymce config copied!'); }); }); grunt.registerTask('none', function() { diff --git a/mir-module/package.json b/mir-module/package.json index a5a3d4036c..cab4706538 100644 --- a/mir-module/package.json +++ b/mir-module/package.json @@ -33,9 +33,8 @@ "video.js": "7.14.3" }, "dependencies": { - "ckeditor-notification": "^4.11.2", - "ckeditor-wordcount-plugin": "^1.17.12", - "ckeditor4": "~4.22.0", + "tinymce": "^7.6.0", + "tinymce-i18n": "^24.12.9", "vue": "3.2.13", "vue3-openlayers": "^1.0.0" } diff --git a/mir-module/src/main/resources/META-INF/resources/editor/editor-includes.xed b/mir-module/src/main/resources/META-INF/resources/editor/editor-includes.xed index b2ce523933..0de6bdd59a 100644 --- a/mir-module/src/main/resources/META-INF/resources/editor/editor-includes.xed +++ b/mir-module/src/main/resources/META-INF/resources/editor/editor-includes.xed @@ -2321,7 +2321,8 @@ src="{$WebApplicationBaseURL}assets/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js"> - + + diff --git a/mir-module/src/main/resources/META-INF/resources/js/ckeditor-config.js b/mir-module/src/main/resources/META-INF/resources/js/ckeditor-config.js deleted file mode 100644 index c6fc1f0a36..0000000000 --- a/mir-module/src/main/resources/META-INF/resources/js/ckeditor-config.js +++ /dev/null @@ -1,29 +0,0 @@ -CKEDITOR.editorConfig = function( config ) { - - config.versionCheck = false; - - config.extraPlugins = 'notification,wordcount'; - - config.toolbar = JSON.parse(window["MIR.WebConfig.Editor.CKEditor.Toolbar"] || "{}"); - - config.allowedContent = window["MIR.WebConfig.Editor.CKEditor.AllowedContent"] || "*"; - config.autoParagraph = window["MIR.WebConfig.Editor.CKEditor.AutoParagraph"] || false; - - config.wordcount = { - showRemaining: window["MIR.WebConfig.Editor.CKEditor.Wordcount.ShowRemaining"] || false, - showParagraphs: window["MIR.WebConfig.Editor.CKEditor.Wordcount.ShowParagraphs"] || true, - showWordCount: window["MIR.WebConfig.Editor.CKEditor.Wordcount.ShowWordCount"] || true, - showCharCount: window["MIR.WebConfig.Editor.CKEditor.Wordcount.ShowCharCount"] || false, - countBytesAsChars: window["MIR.WebConfig.Editor.CKEditor.Wordcount.CountBytesAsChars"] || false, - countSpacesAsChars: window["MIR.WebConfig.Editor.CKEditor.Wordcount.CountSpacesAsChars"] || false, - countHTML: window["MIR.WebConfig.Editor.CKEditor.Wordcount.CountHTML"] || false, - countLineBreaks: window["MIR.WebConfig.Editor.CKEditor.Wordcount.CountLineBreaks"] || false, - hardLimit: window["MIR.WebConfig.Editor.CKEditor.Wordcount.HardLimit"] || true, - warnOnLimitOnly: window["MIR.WebConfig.Editor.CKEditor.Wordcount.WarnOnLimitOnly"] || false, - maxParagraphs: window["MIR.WebConfig.Editor.CKEditor.Wordcount.MaxParagraphs"] || -1, - maxWordCount: window["MIR.WebConfig.Editor.CKEditor.Wordcount.MaxWordCount"] || -1, - maxCharCount: window["MIR.WebConfig.Editor.CKEditor.Wordcount.MaxCharCount"] || -1, - pasteWarningDuration: window["MIR.WebConfig.Editor.CKEditor.Wordcount.PasteWarningDuration"] || 0 - }; - -}; diff --git a/mir-module/src/main/resources/META-INF/resources/js/tinymce-config.js b/mir-module/src/main/resources/META-INF/resources/js/tinymce-config.js new file mode 100644 index 0000000000..32160def76 --- /dev/null +++ b/mir-module/src/main/resources/META-INF/resources/js/tinymce-config.js @@ -0,0 +1,20 @@ + +tinymce.init({ + selector: "textarea.tinymce", + license_key: "gpl", + promotion: false, + language: currentLang, + plugins: [ + "advlist", "anchor", "autolink", "code", "fullscreen", "help", + "lists", "preview", + "searchreplace", "table", "visualblocks", "wordcount" + ], + menubar: false, + toolbar: "undo redo | styles | bold italic underline | remove | code | indent outdent |" + + " alignleft aligncenter alignright alignjustify | bullist numlist | table | hr", + toolbar_mode: "wrap", + entity_encoding: "raw", + valid_elements: JSON.parse(window["MIR.WebConfig.Editor.TinyMCE.HTML.Elements"] || "{}"), + convert_urls: false, + verify_html: false +}); diff --git a/mir-module/src/main/resources/config/mir/mycore.properties b/mir-module/src/main/resources/config/mir/mycore.properties index f12ab5d90e..4dafe7a1a5 100644 --- a/mir-module/src/main/resources/config/mir/mycore.properties +++ b/mir-module/src/main/resources/config/mir/mycore.properties @@ -137,34 +137,11 @@ MIR.Editor.HTML.Elements=%MIR.Editor.HTML.Elements% %MIR.Editor.MathML.Elements% # WebConfig # ############################################################################# -MIR.WebConfig.Editor.CKEditor.Toolbar="[\ - {\\"name\\": \\"document\\", \\"items\\": [\\"Source\\"]},\ - {\\"name\\": \\"clipboard\\", \\"items\\": [\\"Paste\\", \\"PasteText\\", \\"PasteFromWord\\", \\"-\\", \\"Undo\\", \\"Redo\\"]},\ - {\\"name\\": \\"basicstyles\\", \\"items\\": [\\"Bold\\", \\"Italic\\", \\"Underline\\", \\"Strike\\", \\"Subscript\\", \\"Superscript\\", \\"-\\", \\"CopyFormatting\\", \\"RemoveFormat\\"]},\ - {\\"name\\": \\"insert\\", \\"items\\": [\\"Table\\", \\"HorizontalRule\\", \\"SpecialChar\\"]},\ - {\\"name\\": \\"paragraph\\", \\"items\\": [\\"NumberedList\\", \\"BulletedList\\", \\"-\\", \\"Outdent\\", \\"-\\", \\"Blockquote\\", \\"CreateDiv\\", \\"-\\", \\"JustifyBlock\\", \\"-\\"]},\ - {\\"name\\": \\"styles\\", \\"items\\": [\\"Styles\\", \\"Format\\", \\"FontSize\\"]},\ - {\\"name\\": \\"about\\", \\"items\\": [\\"About\\"]}\ - ]" - -MIR.WebConfig.Editor.CKEditor.AllowedContent="%MIR.Editor.HTML.Elements%" -MIR.WebConfig.Editor.CKEditor.AutoParagraph=false - -MIR.WebConfig.Editor.CKEditor.Wordcount.ShowRemaining=false -MIR.WebConfig.Editor.CKEditor.Wordcount.ShowParagraphs=true -MIR.WebConfig.Editor.CKEditor.Wordcount.ShowWordCount=true -MIR.WebConfig.Editor.CKEditor.Wordcount.ShowCharCount=false -MIR.WebConfig.Editor.CKEditor.Wordcount.CountBytesAsChars=false -MIR.WebConfig.Editor.CKEditor.Wordcount.CountSpacesAsChars=false -MIR.WebConfig.Editor.CKEditor.Wordcount.CountHTML=false -MIR.WebConfig.Editor.CKEditor.Wordcount.CountLineBreaks=false -MIR.WebConfig.Editor.CKEditor.Wordcount.HardLimit=true -MIR.WebConfig.Editor.CKEditor.Wordcount.WarnOnLimitOnly=false -MIR.WebConfig.Editor.CKEditor.Wordcount.MaxParagraphs=-1 -MIR.WebConfig.Editor.CKEditor.Wordcount.MaxWordCount=-1 -MIR.WebConfig.Editor.CKEditor.Wordcount.MaxCharCount=-1 -MIR.WebConfig.Editor.CKEditor.Wordcount.PasteWarningDuration=0 +MIR.WebConfig.Editor.TinyMCE.HTML.Elements=p,br,i,strong,em,u,s,sub,sup,table,thead,tr,th,tbody,td,hr,ol,ul,li,blockquote,pre,address,h1,h2,h3,h4,h5,h6,div,q,big,small,code,del +MIR.WebConfig.Editor.TinyMCE.MathML.Elements=math,maction,maligngroup,malignmark,menclose,merror,mfenced,mfrac,mglyph,mi,mlabeledtr,mlongdiv,multiscripts,mn,mo,mover,mpadded,mphantom,mroot,mrow,ms,mscarries,mscarry,msgroup,mstack,msline,mspace,msqrt,msrow,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover +MIR.WebConfig.Editor.TinyMCE.HTML.Elements=%MIR.WebConfig.Editor.TinyMCE.HTML.Elements%,%MIR.WebConfig.Editor.TinyMCE.MathML.Elements% +MIR.WebConfig.Editor.TinyMCE.ValidElements=%MIR.WebConfig.Editor.TinyMCE.HTML.Elements% ############################################################################# # Configure Owner Strategy # diff --git a/mir-module/src/main/resources/xsl/editor/mir2xeditor.xsl b/mir-module/src/main/resources/xsl/editor/mir2xeditor.xsl index a9d3a7f758..efaa60a67c 100644 --- a/mir-module/src/main/resources/xsl/editor/mir2xeditor.xsl +++ b/mir-module/src/main/resources/xsl/editor/mir2xeditor.xsl @@ -228,7 +228,7 @@ - + @@ -252,7 +252,7 @@ - + diff --git a/mir-module/yarn.lock b/mir-module/yarn.lock index c58c16cb0d..bbc3268494 100644 --- a/mir-module/yarn.lock +++ b/mir-module/yarn.lock @@ -561,21 +561,6 @@ chalk@~0.4.0: has-color "~0.1.0" strip-ansi "~0.1.0" -ckeditor-notification@^4.11.2: - version "4.11.2" - resolved "https://registry.yarnpkg.com/ckeditor-notification/-/ckeditor-notification-4.11.2.tgz#6f37c1d5e7489d346fd725a3e96d40743588fe6b" - integrity sha512-bQ0lrx8DUkEuZ1vfCSOIcoYPK8R7ozL0baypqu/VLcrmByu8D6cWLjk5yXOA84q/64EhQxfIR4lmHk+PO/5DbA== - -ckeditor-wordcount-plugin@^1.17.12: - version "1.17.12" - resolved "https://registry.yarnpkg.com/ckeditor-wordcount-plugin/-/ckeditor-wordcount-plugin-1.17.12.tgz#09452308b460398d7b045efb69b240242a5150f5" - integrity sha512-UU6ZpNoJvo6TQ7LoiV1hcEWboHKwqoLKK0CW951ZXH2QywMX+b4FkYNk3ajdrkCWbe2jVT2kbyMHf/H4FK+u8w== - -ckeditor4@~4.22.0: - version "4.22.1" - resolved "https://registry.yarnpkg.com/ckeditor4/-/ckeditor4-4.22.1.tgz#a4e79db1bac2ccb9a672c47e601ba4882afaf455" - integrity sha512-Yj4vTHX5YxHwc48gNqUqTm+KLkRr9tuyb4O2VIABu4oKHWRNVIdLdy6vUNe/XNx+RiTavMejfA1MVOU/MxLjqQ== - cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -2817,6 +2802,16 @@ throttleit@^1.0.0: resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" integrity sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw= +tinymce-i18n@^24.12.9: + version "24.12.9" + resolved "https://registry.yarnpkg.com/tinymce-i18n/-/tinymce-i18n-24.12.9.tgz#1303caffa9c151073dfb628c9a3c224da781b29b" + integrity sha512-G4FTRiyrHLL+YSGAWuuxGsEYvx4WONFpgRkOnVgB2AQbPpJcqyu4IabC2OWLqe9vAmcZs/kE1PJu32aj7qawSg== + +tinymce@^7.6.0: + version "7.6.0" + resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.6.0.tgz#476069a3e98f46f3f6e7875ca878313d6b3345b9" + integrity sha512-kUrklnD7H8JbpSDEGRh51GKK6Mrf+pR9neSDzUHvXKV+2oRtMB7sqfAtEOnM0/WKdstwaX0qoNCZNo2H1Y0EFA== + tmp@0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" diff --git a/mir-wizard/src/main/java/org/mycore/mir/wizard/MIRWizard.java b/mir-wizard/src/main/java/org/mycore/mir/wizard/MIRWizard.java index 3ddcc25363..4b168c7329 100644 --- a/mir-wizard/src/main/java/org/mycore/mir/wizard/MIRWizard.java +++ b/mir-wizard/src/main/java/org/mycore/mir/wizard/MIRWizard.java @@ -8,7 +8,7 @@ * This program is free software; you can use it, redistribute it * and / or modify it under the terms of the GNU General Public License * (GPL) as published by the Free Software Foundation; either version 2 - * of the License or (at your option) any later version.MIR.Editor.HTML.Elements + * of the License or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of