代码如下:
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();
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]';
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网站建设栏目自动添加nofollow的方法介绍
更多相关阅读请进入《织梦DedeCMS》频道 >>
相关推荐
评论
管理员已关闭评论功能...
- 欢迎访问木庄网络博客
- 可复制:代码框内的文字。
- 方法:Ctrl+C。