Поскольку оно уязвимо, необходимо обновить его до последней версии 7.2.1 или найдите альтернативу.
Пожалуйста, найдите часть инициализации, и она не работает, если я обновляю или использую ссылку cdn.
Пожалуйста, сообщите, что вызывает проблему . Сам элемент управления не отображается.
Код: Выделить всё
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");
});
}
});
Код: Выделить всё
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'
});
Если я создам новый ASP.NET MVC и добавьте TinyMCE, тогда редактор форматированного текста будет работать, но если я обновлю существующий NuGet с 4.5.4 до 7.2.1, он не будет работать.
Пожалуйста, сообщите если мне что-то понадобится, так как произошли серьезные изменения.
Подробнее здесь: https://stackoverflow.com/questions/788 ... e-on-updat