我需要自定义 TinyMCE 5 颜色选择器中的颜色。在我发现的文档中:
但我不能让它工作:
tinymce.init({
selector: '#textarea_id',
height: 500,
menubar: true,
relative_urls : false,
remove_script_host : false,
plugins: [
'advlist autolink lists link image charmap print preview anchor textcolor colorpicker',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table contextmenu paste code'
],
toolbar: 'undo redo | insert | styleselect | bold italic | strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link paste',
style_formats: [
{ title: 'Badge', inline: 'span', styles: { display: 'inline-block', border: '1px solid #2276d2', 'border-radius': '5px', padding: '2px 5px', margin: '0 2px', color: '#2276d2' } }
],
color_map: [
"000000", "Black",
"993300", "Burnt orange",
"333300", "Dark olive"
],
paste_as_text: true,
content_css: '//www.tinymce.com/css/codepen.min.css'
});
我的期望是看到一个颜色选择器,它仅由前景文本颜色和背景文本颜色的 3 种颜色组成,但我看到的是标准颜色选择器。为什么 ?