ckeditor4.0以上使用行间距插件lineheight报错修改
①从百度上下载一个 ckeditor 行距包,解压放到ckeditor/plugins目录下。
②在config.js 中添加
config.extraPlugins += (config.extraPlugins ? ',lineheight' : 'lineheight');//行距③(转载)
config.allowedContent = true; //加这个是为了不让span标签被ckeditor过滤掉,如果加了的话就不需要再加
CKEDITOR.plugins.add('lineheight',
{
lang: ['zh-cn'], requires : [ 'richcombo', 'styles'], init : function( editor ) .......
中的requires: ['rechcombo', 'styles'] 改为: requires: ['rechcombo']
Uncaught TypeError: Cannot read property 'editor' of undefined
editor.ui.addRichCombo( comboName,
{label : lang.label,title: lang.panelTitle,className: 'cke_' + (styleType == 'size' ? 'fontSize' : 'font'),panel :{css : editor.skin.editor.css.concat( config.contentsCss ),multiSelect : false,attributes: { 'aria-label': lang.panelTitle }}, init : function(){ .......
css: [CKEDITOR.skin.getPath("editor")].concat( config.contentsCss ),
editor.ui.addRichCombo( comboName,{label : lang.label,title: lang.panelTitle,className: 'cke_' + (styleType == 'size' ? 'fontSize' : 'font'),panel :{css : [CKEDITOR.skin.getPath("editor")].concat( config.contentsCss ),multiSelect : false,attributes: { 'aria-label': lang.panelTitle }}, init : function(){this.startGroup( lang.panelTitle );
改为:
editor.ui.addRichCombo( comboName,{label : lang.lineheight.label,title: lang.lineheight.panelTitle,className: 'cke_' + (styleType == 'size' ? 'fontSize' : 'font'),panel :{css : [CKEDITOR.skin.getPath("editor")].concat( config.contentsCss ),multiSelect : false,attributes: { 'aria-label': lang.lineheight.panelTitle }}, init : function(){this.startGroup( lang.lineheight.panelTitle );
4.这样就完成了所有的配置了,当然如果想额外添加一些行距设置项,可以在/lineheight/plugin.js中添加,具体位置:
CKEDITOR.config.lineheight_sizes = 'normal;1.5em;1.75em;2em;3em;4em;5em;100%;120%;130%;150%;170%;180%;190%;200%;220%;250%;300%;400%;500%';
看到这个配置,你就会发现,这只是这个行距插件的默认配置值 ,那么如果要添加一些行距元素的话,可以在ckeditor的config.js中添加:
CKEDITOR.config.lineheight_sizes = CKEDITOR.config.lineheight_sizes + ’你添加的行距元素‘;
二、添加中文字体
打开CKeditor目录里的config.js,在
CKEDITOR.editorConfig = function( config )
{
};
里添加如下代码:
config.font_names='宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;'+ config.font_names;
以后使用的时候就可以用中文字体了。(注意,保存这个js文件的时候必须utf8,不然字体显示会是乱码)
文章转载自http://www.it610.com/article/4654053.htm
怕以后设置的时候忘记,故做个记录,希望能帮助到网友
ckeditor4.0以上使用行间距插件lineheight报错修改的更多相关文章
- eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context was:(...”
eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context ...
- tomcat maven插件启动报错tomcat-users.xml cannot be read
tomcat maven插件启动报错tomcat-users.xml cannot be read [ERROR] Failed to execute goal org.codehaus.mojo:t ...
- phpize命令在安装AMQP插件是报错phpize:Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF envir的解决方法
phpize命令在安装AMQP插件是报错phpize:Cannot find autoconf. Please check your autoconf installation and the $PH ...
- org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used.报错
org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default versio ...
- 将Xcode升级到10.0以上版本,Appium启动报错的问题
前言 现在的Xcode最新版本都是在10.1,原先使用的版本是9.4.1!结果今天手贱将其升级... 然后,跑IOS自动化时,出现“Xcode version '0.1'. Support for X ...
- django2.0+连接mysql数据库迁移时候报错
django2.0+连接mysql数据库迁移时候报错 情况一 错误信息 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 ...
- SpringBoot-使用lombok插件运行报错
SpringBoot-使用lombok插件运行报错 标签(空格分隔): java,SpringBoot 1.报错信息 2.解决方案 1.IDEA编辑器安装lombok插件 2.编译注解配置-Enabl ...
- cordova-ios 升级到4.4.0 无法真机跑iOS8 报错: dyld`dyld_fatal_error: -> 0x120085088 <+0>: brk #0x3
项目进入测试阶段,马上要上线了,同事拿了自己的iOS8系统5s跑真机,无缘无故报错,之前跑她的手机完全没有问题的.Xcode 8.x中最低部署版本是iOS8.0,按理说完全能够跑真机的. 但是报了一个 ...
- 【spring cloud】【IDEA】【maven】spring cloud多模块在idea上使用maven插件打包报错:程序包XXX不存在
>>>>spring cloud 多模块 >>>>在idea上使用maven插件打包,欲打包成jar包后 进行部署 >>>> 报 ...
随机推荐
- 记一次mysql数据库被勒索(上)
家里搞了台旧电脑做NAS,安装了nextcloud,选择了mysql做为数据库. 当时也没有想太多,mysql数据库密码随便设置了个123456,用的一切正常. 然后,听说可以找电信申请换个公网IP的 ...
- 【python接口自动化】- 使用requests库发送http请求
前言:什么是Requests ?Requests 是⽤Python语⾔编写,基于urllib,采⽤Apache2 Licensed开源协议的 HTTP 库.它⽐ urllib 更加⽅便,可以节约我们⼤ ...
- 【算法•日更•第三十二期】教你用出windows体验的Linux
▎前言 小编昨天闲的不行,就装了一个linux系统,linux的发行版很多,小编认为ubuntu很好用,于是就在使用ubuntu. 没错,我现在就在使用ubuntu来写博客. 刚才还装了一个QQ,不过 ...
- Elasticsearch聚合语句
聚合的范围是search query过滤出的数据 四种聚合类型: 一.Bucketing 桶聚合,常规的分类然后计算每个分类的文档数量 二.Metric 分类并对一组文档进行sum.avg等数学运算 ...
- VUE 中引入百度地图(vue-Baidu-Map)
1.安装 $ npm install vue-baidu-map --save 2.全局注册,在main.js中引入以下代码 import BaiduMap from 'vue-baidu-map' ...
- 第1章 RDD概念 弹性分布式数据集
第1章 RDD概念 弹性分布式数据集 1.1 RDD为什么会产生 RDD是Spark的基石,是实现Spark数据处理的核心抽象.那么RDD为什么会产生呢? Hadoop的MapReduce是一种基于 ...
- Discovering Reinforcement Learning Algorithms
郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! arXiv:2007.08794v1 [cs.LG] 17 Jul 2020 Abstract 强化学习(RL)算法根据经过多年研究手动发 ...
- 牛客网PAT练兵场-在霍格沃茨找零钱
题目地址:https://www.nowcoder.com/pat/6/problem/4063 题意:按照题目的进制计算即可 /** * *作者:Ycute *时间:2019-11-14-21.45 ...
- 启用valgrind的MPI支持
TL;DR sudo apt install valgrind-mpi 内存泄漏和越界问题,是C/C++程序常见问题.有一些工具提供了检测内存泄漏的功能,如 valgrind 的 memchecker ...
- 在使用postman中操作api接口测试403解决方法
在向Jenkins发送请求时收到了这样的403错误信息: No valid crumb was included in the request 后来通过google找到了解决方案. http://st ...