我需要自定义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种颜色组成的颜色选择器,用于前景色和背景色,但是我看到的是标准颜色选择器。为什么呢