关于tinymce的一些记事
之前能看的懂一部分英文,但是总是没有全局观,以至于我之前使用tinymce一直都有一些疑问:那就是为什么我在tinymce初始化中添加了比如字体,字体大小等设置按钮,但是为什么在前
台没有办法现实出来,原来错误的根源是我没有将元素在工具栏或者菜单栏中的设置属性中设置其显示出来,单单只是将该设置放扔到 tinymce.init()中,没有在 toolbar或者menubar中添
加进去。
我的tinymce设置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | tinymce.init({ selector: "textarea#elm1" , language : "zh_CN" , width: 600 , height: 300 , plugins: [ "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker" , "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking" , "save table contextmenu directionality emoticons template paste textcolor" ] , toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons | fontsizeselect | fontselect" , style_formats: [ {title: 'Bold text' , inline: 'b' }, {title: 'Red text' , inline: 'span' , styles: {color: '#ff0000' }}, {title: 'Red header' , block: 'h1' , styles: {color: '#ff0000' }}, {title: 'Example 1' , inline: 'span' , classes: 'example1' }, {title: 'Example 2' , inline: 'span' , classes: 'example2' }, {title: 'Table styles' }, {title: 'Table row 1' , selector: 'tr' , classes: 'tablerow1' } ] , fontsize_formats: "8px 10px 12px 14px 18px 24px 36px" , font_formats: "宋体=宋体;" + "微软雅黑=Microsoft YaHei;" + "黑体=黑体;" + "仿宋=仿宋;" + "楷体=楷体;" + "隶书=隶书;" + "幼圆=幼圆;" + "Arial=arial,helvetica,sans-serif;" + "Comic Sans MS=comic sans ms,sans-serif;" + "Courier New=courier new,courier;" + "Tahoma=tahoma,arial,helvetica,sans-serif;" + "Times New Roman=times new roman,times;" + "Verdana=verdana,geneva;" + "Webdings=webdings;" + "Wingdings=wingdings,zapf dingbats" }); |
Demo下载 : https://files.cnblogs.com/files/xxjudfc/demo.rar
参考说明
谢谢: http://bbs.csdn.net/topics/390845082给我的提示
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现