There is an .Net Framework MVC web App that uses tinyMCE Rict Text Editor 4.5.4 NuGet package.
Since it is velnerable, need to update to latest verion 7.2.1 or find alternate.Please find the init part and it is not working if I update or use cdn reference.Please advise which cuases issue. the control itself not appear.
tinymce.init({ selector: 'textarea.dataEditor', content_style: ".mce-content-body {font-size:9pt;font-family:Segoe UI;}", height: 300, theme: 'modern', menubar: 'edit', force_br_newlines: false, force_p_newlines: false, forced_root_block: '', invalid_styles: {'*': 'margin' }, plugins: ['advlist autolink lists link image charmap print preview hr anchor pagebreak','searchreplace wordcount visualblocks visualchars code fullscreen','insertdatetime media nonbreaking save table contextmenu directionality','emoticons template paste textcolor colorpicker textpattern imagetools codesample toc' ], fullpage_default_font_family: "Segoe UI;", fullpage_default_font_size: "9pt", contextmenu: "paste", paste_create_paragraphs: false, paste_create_linebreaks: false, paste_auto_cleanup_on_paste: true, paste_convert_middot_lists: false, paste_unindented_list_class: "unIndentedList", paste_convert_headers_to_strong: true, paste_retain_style_properties: "margin, padding, width, height, font-weight, color, text-align, text-decoration, border, background, float, display", paste_remove_styles_if_webkit: false, paste_preprocess: function (pl, o) { o.content = o.content.replace(/”/g, "\""); o.content = o.content.replace(/“/g, "\""); o.content = o.content.replace(/’/g, "\'"); }, toolbar: 'undo redo | fontselect fontsizeselect | numlist bullist checklist | outdent indent | preview', font_formats: 'Segoe UI=segoe ui',//;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats', fontsize_formats: "9pt",//"8pt 9pt 10pt 10.5pt 11pt 12pt 14pt 18pt 24pt 36pt", image_advtab: true, init_instance_callback: function myCustomInitInstance(inst) { var editor = $(inst.getContainer())[0]; var readonly = $(editor).parents(".Details").find("input[name*='IsCompleted']").val() == "True"; if (readonly) { inst.setMode('readonly'); } }, setup: function (ed) { ed.on('init', function (ed) { this.getDoc().body.style.fontSize = "9pt"; ed.target.editorCommands.execCommand("fontName", false, "Segoe UI"); //ed.target.editorCommands.execCommand("fontSize", false, "17.5"); }); } });
I create new mvc project and added the following. it display the rich text editor but it is not editable.
document.addEventListener('DOMContentLoaded', function () { tinymce.init({ selector: '#myEditor', height: 300, menubar: false, plugins: ['advlist autolink lists link image charmap preview anchor','searchreplace visualblocks code fullscreen','insertdatetime media table paste code help wordcount' ], toolbar: 'undo redo | formatselect | bold italic backcolor | \ alignleft aligncenter alignright alignjustify | \ bullist numlist outdent indent | removeformat | help', content_css: '//www.tiny.cloud/css/codepen.min.css' });
Please advise which properties is not compatible to latest version and what is best way to migrate to latest or advise on alternate.
if I create new MVC and add TinyMCE then Rich Text editor works but if I udate the existing NuGet from 4.5.4 to 7.2.1 then it is not working.Please advise if I have to anything since there is major change.