1.Toolbar的配置
在fckconfig.js中添加
FCKConfig.ToolbarSets["style"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
]
自定义的工具集。
使用:
<script type="text/javascript">
//第一种方法
var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath = "<%=request.getContextPath()%>/fckeditor/";
oFCKeditor.Width = "70%";
oFCKeditor.Height = "150";
oFCKeditor.Value = "default"
oFCKeditor.Config["CustomConfigurationsPath"] = "<%=request.getContextPath()%>/myconfig.js" ;
oFCKeditor.ToolbarSet = "style";
oFCKeditor.Create();
</script
2.添加常用字体
在fckconfig.js中的
FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
修改为
FCKConfig.FontNames = '宋体;楷体_GB2312;黑体;隶书;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
3.修改Enter和shift + Enter的换行行为
在fckconfig.js中的
FCKConfig.EnterMode = 'p' ; // p | div | br
FCKConfig.ShiftEnterMode = 'br' ; // p | div | br
改为:
FCKConfig.EnterMode = 'br' ; // p | div | br
FCKConfig.ShiftEnterMode = 'p' ; // p | div | br
此时效果:Enter换行,Shift + Enter新段落