fckeditor编辑器下的自定义分页符实现方法


当前第2页 返回上一页

代码如下:

var FCKPageBreakCommand=function(){this.Name='PageBreak';};
FCKPageBreakCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();
var e=FCK.EditorDocument.createElement('P');e.innerHTML='[jb51page]';

用的方法:

代码如下:

var FCKPageBreakCommand=function(){this.Name='PageBreak';};
FCKPageBreakCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();
FCK.EditorDocument.selection.createRange().text='[jb51page]';

注意:由于我们使用的版本,有FCKUndo.SaveUndoStep();如果不带出现了编辑器无法显示的情况。大家根据需要修改。

后面发现了dedecms增加的小功能,里面的函数不错可以参考下

var FCKLineBrCommand=function(){this.Name='LineBr';};
FCKLineBrCommand.prototype.Execute=function(){FCK.EditorDocument.selection.createRange().pasteHTML("<br/>");};
FCKLineBrCommand.prototype.GetState=function(){return 0;}

var FCKQuoteCommand=function(){this.Name='Quote';};
FCKQuoteCommand.prototype.Execute=function(){
	var quoteString = "<table style='border-right: #cccccc 1px dotted; table-layout: fixed; border-top: #cccccc 1px dotted; border-left: #cccccc 1px dotted; border-bottom: #cccccc 1px dotted' cellspacing=0 cellpadding=6 width='95%' align=center border=0>\r\n";
 quoteString += "<tr><td style='word-wrap: break-word' bgcolor='#fdfddf'>\r\n<font color='#FF0000'>以下为引用的内容:</font><br>\r\n";
 quoteString += "</td></tr></table>\r\n";
	FCK.EditorDocument.selection.createRange().pasteHTML(quoteString);
};
FCKQuoteCommand.prototype.GetState=function(){return 0;}

标签:织梦DedeCMS

返回前面的内容

相关阅读 >>

dedecms列表推荐文章默认为加粗的修改方法

dedecms修改后台编辑器参数geteditor的方法

织梦DedeCMS系统后台安全提示去除方法

dedecms频道,列表页,内容页中调用全站最新文章的方法

详解织梦DedeCMS自定义表单提交之后发送到邮箱的方法

织梦DedeCMS 去掉后台登陆验证码的方法

dedecms会员登录后跳转首页的简单实现方法

dedecms新增字段调用实例方法

dede搬家后路径变化批量替换图片路径避免图片不能正常显示

织梦DedeCMS网站建设栏目自动添加nofollow的方法介绍

更多相关阅读请进入《织梦DedeCMS》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...