Fix TinyMCE plugings config [SCI-3679]

This commit is contained in:
Oleksii Kriuchykhin 2019-08-06 15:46:55 +02:00
parent eaf9d59819
commit f3849e2ece

View file

@ -21,6 +21,7 @@ var TinyMCE = (function() {
init: function(selector, onSaveCallback) { init: function(selector, onSaveCallback) {
var tinyMceContainer; var tinyMceContainer;
var tinyMceInitSize; var tinyMceInitSize;
var plugins;
if (typeof tinyMCE !== 'undefined') { if (typeof tinyMCE !== 'undefined') {
// Hide element containing HTML view of RTE field // Hide element containing HTML view of RTE field
tinyMceContainer = $(selector).closest('form').find('.tinymce-view'); tinyMceContainer = $(selector).closest('form').find('.tinymce-view');
@ -28,6 +29,8 @@ var TinyMCE = (function() {
$(selector).closest('.form-group') $(selector).closest('.form-group')
.before('<div class="tinymce-placeholder" style="height:' + tinyMceInitSize + 'px"></div>'); .before('<div class="tinymce-placeholder" style="height:' + tinyMceInitSize + 'px"></div>');
tinyMceContainer.addClass('hidden'); tinyMceContainer.addClass('hidden');
plugins = 'autosave autoresize customimageuploader link advlist codesample autolink lists charmap hr anchor searchreplace wordcount visualblocks visualchars insertdatetime nonbreaking save directionality paste textcolor colorpicker textpattern placeholder';
if (typeof (MarvinJsEditor) !== 'undefined') plugins += ' marvinjsplugin';
tinyMCE.init({ tinyMCE.init({
@ -35,7 +38,7 @@ var TinyMCE = (function() {
selector: selector, selector: selector,
menubar: 'file edit view insert format', menubar: 'file edit view insert format',
toolbar: 'undo redo restoredraft | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | forecolor backcolor | customimageuploader | codesample', toolbar: 'undo redo restoredraft | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | forecolor backcolor | customimageuploader | codesample',
plugins: 'autosave autoresize customimageuploader link advlist codesample autolink lists charmap hr anchor searchreplace wordcount visualblocks visualchars insertdatetime nonbreaking save directionality paste textcolor placeholder colorpicker textpattern', plugins: plugins,
autoresize_bottom_margin: 20, autoresize_bottom_margin: 20,
codesample_languages: [ codesample_languages: [
{ text: 'R', value: 'r' }, { text: 'R', value: 'r' },