Skip to content

Commit b1fef03

Browse files
matthiasMewel
authored andcommitted
replace ckeditor with tinymce
1 parent 03d931f commit b1fef03

File tree

9 files changed

+47
-85
lines changed

9 files changed

+47
-85
lines changed

mir-module/GruntFile.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ module.exports = function(grunt) {
2020
},
2121
files : {
2222
'bootstrap/js' : 'bootstrap/dist/js',
23-
'ckeditor4' : 'ckeditor4/',
24-
'ckeditor4/plugins/notification/' : 'ckeditor-notification-plugin',
25-
'ckeditor4/plugins/wordcount/' : 'ckeditor-wordcount-plugin/wordcount',
23+
24+
'tinymce' : 'tinymce',
25+
'tinymce/langs' : 'tinymce-i18n/langs7',
2626

2727
'font-awesome/css' : '@fortawesome/fontawesome-free/css',
2828
'font-awesome/webfonts' : '@fortawesome/fontawesome-free/webfonts',
@@ -78,19 +78,18 @@ module.exports = function(grunt) {
7878

7979
'<%= 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',
8080
'<%= globalConfig.moduleDirectory %>/target/classes/META-INF/resources/js/epusta.min.js': '<%= globalConfig.moduleDirectory %>/src/main/resources/META-INF/resources/js/epusta.js',
81-
'<%= globalConfig.moduleDirectory %>/target/classes/META-INF/assets/ckeditor4/config.min.js': '<%= globalConfig.moduleDirectory %>/src/main/resources/META-INF/resources/js/ckeditor-config.js'
8281
}
8382
}
8483
},
8584
});
8685
grunt.registerTask('copy', function() {
87-
const source = getAbsoluteDir(grunt.option('moduleDirectory'))+'/src/main/resources/META-INF/resources/js/ckeditor-config.js';
88-
const target = getAbsoluteDir(grunt.option('assetsDirectory')) + '/ckeditor4/config.js';
86+
const source = getAbsoluteDir(grunt.option('moduleDirectory'))+'/src/main/resources/META-INF/resources/js/tinymce-config.js';
87+
const target = getAbsoluteDir(grunt.option('assetsDirectory')) + '/tinymce/config.js';
8988
fs.copyFile(source, target, (err) => {
9089
if (err) {
9190
throw err;
9291
}
93-
grunt.log('ckeditor config copied!');
92+
grunt.log('tinymce config copied!');
9493
});
9594
});
9695
grunt.registerTask('none', function() {

mir-module/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
"video.js": "7.14.3"
3434
},
3535
"dependencies": {
36-
"ckeditor-notification": "^4.11.2",
37-
"ckeditor-wordcount-plugin": "^1.17.12",
38-
"ckeditor4": "~4.22.0",
36+
"tinymce": "^7.6.0",
37+
"tinymce-i18n": "^24.12.9",
3938
"vue": "3.2.13",
4039
"vue3-openlayers": "^1.0.0"
4140
}

mir-module/src/main/resources/META-INF/resources/editor/editor-includes.xed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,8 @@
23212321
src="{$WebApplicationBaseURL}assets/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js"></script>
23222322
<script type="text/javascript" src="{$WebApplicationBaseURL}assets/moment/min/moment.min.js"></script>
23232323
<script type="text/javascript" src="{$WebApplicationBaseURL}js/mir/xeditor-form.min.js"></script>
2324-
<script type="text/javascript" src="{$WebApplicationBaseURL}assets/ckeditor4/ckeditor.js"></script>
2324+
<script type="text/javascript" src="{$WebApplicationBaseURL}assets/tinymce/tinymce.js"></script>
2325+
<script type="text/javascript" src="{$WebApplicationBaseURL}assets/tinymce/config.js"></script>
23252326
<link rel="stylesheet" type="text/css" href="{$WebApplicationBaseURL}assets/select2/css/select2.min.css"/>
23262327
<script type="text/javascript" src="{$WebApplicationBaseURL}assets/select2/js/select2.min.js"/>
23272328
<script type="text/javascript" src="{$WebApplicationBaseURL}assets/select2/js/i18n/{$MCR.Metadata.DefaultLang}.js"/>

mir-module/src/main/resources/META-INF/resources/js/ckeditor-config.js

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
tinymce.init({
3+
selector: "textarea.tinymce",
4+
license_key: "gpl",
5+
promotion: false,
6+
language: currentLang,
7+
plugins: [
8+
"advlist", "anchor", "autolink", "code", "fullscreen", "help",
9+
"lists", "preview",
10+
"searchreplace", "table", "visualblocks", "wordcount"
11+
],
12+
menubar: false,
13+
toolbar: "undo redo | styles | bold italic underline | remove | code | indent outdent |" +
14+
" alignleft aligncenter alignright alignjustify | bullist numlist | table | hr",
15+
toolbar_mode: "wrap",
16+
entity_encoding: "raw",
17+
valid_elements: JSON.parse(window["MIR.WebConfig.Editor.TinyMCE.HTML.Elements"] || "{}"),
18+
convert_urls: false,
19+
verify_html: false
20+
});

mir-module/src/main/resources/config/mir/mycore.properties

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -137,34 +137,11 @@ MIR.Editor.HTML.Elements=%MIR.Editor.HTML.Elements% %MIR.Editor.MathML.Elements%
137137
# WebConfig #
138138
#############################################################################
139139

140-
MIR.WebConfig.Editor.CKEditor.Toolbar="[\
141-
{\\"name\\": \\"document\\", \\"items\\": [\\"Source\\"]},\
142-
{\\"name\\": \\"clipboard\\", \\"items\\": [\\"Paste\\", \\"PasteText\\", \\"PasteFromWord\\", \\"-\\", \\"Undo\\", \\"Redo\\"]},\
143-
{\\"name\\": \\"basicstyles\\", \\"items\\": [\\"Bold\\", \\"Italic\\", \\"Underline\\", \\"Strike\\", \\"Subscript\\", \\"Superscript\\", \\"-\\", \\"CopyFormatting\\", \\"RemoveFormat\\"]},\
144-
{\\"name\\": \\"insert\\", \\"items\\": [\\"Table\\", \\"HorizontalRule\\", \\"SpecialChar\\"]},\
145-
{\\"name\\": \\"paragraph\\", \\"items\\": [\\"NumberedList\\", \\"BulletedList\\", \\"-\\", \\"Outdent\\", \\"-\\", \\"Blockquote\\", \\"CreateDiv\\", \\"-\\", \\"JustifyBlock\\", \\"-\\"]},\
146-
{\\"name\\": \\"styles\\", \\"items\\": [\\"Styles\\", \\"Format\\", \\"FontSize\\"]},\
147-
{\\"name\\": \\"about\\", \\"items\\": [\\"About\\"]}\
148-
]"
149-
150-
MIR.WebConfig.Editor.CKEditor.AllowedContent="%MIR.Editor.HTML.Elements%"
151-
MIR.WebConfig.Editor.CKEditor.AutoParagraph=false
152-
153-
MIR.WebConfig.Editor.CKEditor.Wordcount.ShowRemaining=false
154-
MIR.WebConfig.Editor.CKEditor.Wordcount.ShowParagraphs=true
155-
MIR.WebConfig.Editor.CKEditor.Wordcount.ShowWordCount=true
156-
MIR.WebConfig.Editor.CKEditor.Wordcount.ShowCharCount=false
157-
MIR.WebConfig.Editor.CKEditor.Wordcount.CountBytesAsChars=false
158-
MIR.WebConfig.Editor.CKEditor.Wordcount.CountSpacesAsChars=false
159-
MIR.WebConfig.Editor.CKEditor.Wordcount.CountHTML=false
160-
MIR.WebConfig.Editor.CKEditor.Wordcount.CountLineBreaks=false
161-
MIR.WebConfig.Editor.CKEditor.Wordcount.HardLimit=true
162-
MIR.WebConfig.Editor.CKEditor.Wordcount.WarnOnLimitOnly=false
163-
MIR.WebConfig.Editor.CKEditor.Wordcount.MaxParagraphs=-1
164-
MIR.WebConfig.Editor.CKEditor.Wordcount.MaxWordCount=-1
165-
MIR.WebConfig.Editor.CKEditor.Wordcount.MaxCharCount=-1
166-
MIR.WebConfig.Editor.CKEditor.Wordcount.PasteWarningDuration=0
140+
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
141+
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
142+
MIR.WebConfig.Editor.TinyMCE.HTML.Elements=%MIR.WebConfig.Editor.TinyMCE.HTML.Elements%,%MIR.WebConfig.Editor.TinyMCE.MathML.Elements%
167143

144+
MIR.WebConfig.Editor.TinyMCE.ValidElements=%MIR.WebConfig.Editor.TinyMCE.HTML.Elements%
168145

169146
#############################################################################
170147
# Configure Owner Strategy #

mir-module/src/main/resources/xsl/editor/mir2xeditor.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
</xed:bind>
229229
</xsl:when>
230230
<xsl:otherwise>
231-
<textarea class="form-control ckeditor">
231+
<textarea class="form-control tinymce">
232232
<xsl:copy-of select="@rows" />
233233
<xsl:copy-of select="@placeholder" />
234234
</textarea>
@@ -252,7 +252,7 @@
252252
<xed:output i18n="{@label}" />
253253
</label>
254254
<div class="col-md-6">
255-
<textarea class="form-control ckeditor">
255+
<textarea class="form-control tinymce">
256256
<xsl:copy-of select="@rows" />
257257
<xsl:copy-of select="@placeholder" />
258258
</textarea>

mir-module/yarn.lock

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -561,21 +561,6 @@ chalk@~0.4.0:
561561
has-color "~0.1.0"
562562
strip-ansi "~0.1.0"
563563

564-
ckeditor-notification@^4.11.2:
565-
version "4.11.2"
566-
resolved "https://registry.yarnpkg.com/ckeditor-notification/-/ckeditor-notification-4.11.2.tgz#6f37c1d5e7489d346fd725a3e96d40743588fe6b"
567-
integrity sha512-bQ0lrx8DUkEuZ1vfCSOIcoYPK8R7ozL0baypqu/VLcrmByu8D6cWLjk5yXOA84q/64EhQxfIR4lmHk+PO/5DbA==
568-
569-
ckeditor-wordcount-plugin@^1.17.12:
570-
version "1.17.12"
571-
resolved "https://registry.yarnpkg.com/ckeditor-wordcount-plugin/-/ckeditor-wordcount-plugin-1.17.12.tgz#09452308b460398d7b045efb69b240242a5150f5"
572-
integrity sha512-UU6ZpNoJvo6TQ7LoiV1hcEWboHKwqoLKK0CW951ZXH2QywMX+b4FkYNk3ajdrkCWbe2jVT2kbyMHf/H4FK+u8w==
573-
574-
ckeditor4@~4.22.0:
575-
version "4.22.1"
576-
resolved "https://registry.yarnpkg.com/ckeditor4/-/ckeditor4-4.22.1.tgz#a4e79db1bac2ccb9a672c47e601ba4882afaf455"
577-
integrity sha512-Yj4vTHX5YxHwc48gNqUqTm+KLkRr9tuyb4O2VIABu4oKHWRNVIdLdy6vUNe/XNx+RiTavMejfA1MVOU/MxLjqQ==
578-
579564
cliui@^2.1.0:
580565
version "2.1.0"
581566
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
@@ -2817,6 +2802,16 @@ throttleit@^1.0.0:
28172802
resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c"
28182803
integrity sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=
28192804

2805+
tinymce-i18n@^24.12.9:
2806+
version "24.12.9"
2807+
resolved "https://registry.yarnpkg.com/tinymce-i18n/-/tinymce-i18n-24.12.9.tgz#1303caffa9c151073dfb628c9a3c224da781b29b"
2808+
integrity sha512-G4FTRiyrHLL+YSGAWuuxGsEYvx4WONFpgRkOnVgB2AQbPpJcqyu4IabC2OWLqe9vAmcZs/kE1PJu32aj7qawSg==
2809+
2810+
tinymce@^7.6.0:
2811+
version "7.6.0"
2812+
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.6.0.tgz#476069a3e98f46f3f6e7875ca878313d6b3345b9"
2813+
integrity sha512-kUrklnD7H8JbpSDEGRh51GKK6Mrf+pR9neSDzUHvXKV+2oRtMB7sqfAtEOnM0/WKdstwaX0qoNCZNo2H1Y0EFA==
2814+
28202815
tmp@0.0.31:
28212816
version "0.0.31"
28222817
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7"

mir-wizard/src/main/java/org/mycore/mir/wizard/MIRWizard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* This program is free software; you can use it, redistribute it
99
* and / or modify it under the terms of the GNU General Public License
1010
* (GPL) as published by the Free Software Foundation; either version 2
11-
* of the License or (at your option) any later version.MIR.Editor.HTML.Elements
11+
* of the License or (at your option) any later version.
1212
*
1313
* This program is distributed in the hope that it will be useful, but
1414
* WITHOUT ANY WARRANTY; without even the implied warranty of

0 commit comments

Comments
 (0)