TinyMCE 5 color_map设置未显示自定义颜色

时间:2019-05-14 13:19:14

标签: javascript tinymce tinymce-5

我需要自定义TinyMCE 5颜色选择器中的颜色。在文档中,我发现:

color_map

但是我无法使其工作:

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

0 个答案:

没有答案