ckeditor(ckeditor5中文)(2)

http://www.itjxue.com  2023-02-19 05:05  来源:未知  点击次数: 

");

}

});

// alert('dedepage!');

// Register the toolbar button.

editor.ui.addButton( 'MyPage',

{

label : '插入分页符',

command : 'dedepage',

icon: 'images/dedepage.gif'

});

// alert(editor.name);

},

requires : [ 'fakeobjects' ],

requires : [ 'lineheight' ]

});

})();

4、修改/include/ckeditor/ckeditor.inc.php文件,在$toolbar['Basic'] 的最后一行添加元素Code,修改后代码如下:

$toolbar['Basic'] = array(

array( 'Source','-','Templates'),

array( 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'),

array( 'Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'),

array( 'ShowBlocks'),array('Image','Flash','Addon'),array('Maximize'),'/',

array( 'Bold','Italic','Underline','Strike','-'),

array( 'NumberedList','BulletedList','-','Outdent','Indent','Blockquote'),

array( 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'),

array( 'Table','HorizontalRule','Smiley','SpecialChar'),

array( 'Link','Unlink','Anchor'),'/',

array( 'Styles','Format','Font','FontSize'),

array( 'TextColor', 'BGColor', 'MyPage','MultiPic'),

array( 'lineheight')

);

至此OK!

ps,简单的自定义行距功能

1.修改该功能的语言,在lineheight(就是行距插件的目录)/lang目录下添加相应的语言包,修改plugin.js文件115行为相应的语言。

2.更改行距的功能按钮,修改plugin.js文件139行。

如何在网页中引用 ckeditor 富文本

ckeditor 是一款非常有名的富文本编辑器。它可以填写文字、插入图片、视频、Excel等富媒体信息,也可以在源码方式下填写内容,在各个网站中应用非常广泛。本文说一说如何在网页中引用我们已经下载好的 ckeditor 文件。

下载完成后将整个 ckeditor 文件包放在网站的目录结构下面,在需要引入 ckeditor 的网页中添加如下三句即可:

ckeditor.js 是 ckeditor 文件包中的 js 文件。

textarea name="content"/textarea

script type="text/javascript" src="ckeditor.js"/script

script type="text/javascript"

CKEDITOR.replace('content');

/script

这么三句即可成功引入 ckeditor 富文本编辑器,你可以试试哦,接下来只要在网页中添加 form 表单等等其它元素,即可实现富文本添加自己想要的内容。

(责任编辑:IT教学网)

更多

推荐思科认证文章