Posted
on 2012-9-16, 19:57,
by
tmser,
under
web前端
.
Kindeditor 自定义了一个插件想将其添加为自定义右键菜单。按官方文档试了好久没有成功。决定自己看下源代码。
看了半天,终于找到原因,原来是官方文档在误导我们:
这是官方说明:
editor.addContextmenu({
title : 'test',
click : function() {
alert('clicked');
},
cond : true,
width : 150,
});
// 插入分割线
editor...
阅读全文>>
Posted
on 2012-8-30, 11:28,
by
tmser,
under
web前端
.
KindEditor 4.2.1 增加了code 插件,使用的是开源的 prettify 解析器。但是没有使用到其所有功能多少有点浪费。
比如最常见的 行号的显示就没有加到插件里。
这里教大家如何增加这个功能。
-
找到editor 下面的 plugins / code 文件夹下的code.js用文本编辑器打开。
-
在html 后添加'<input type="checkbox" name="hasLineNum" style="margin-left:60px;" class="ke-inline-block" value="y" checked="checked" />'+ lang.hasLineNumber,
-
yesBtn 事件的click 事件中 添加 hasLineNum = ...
阅读全文>>
Posted
on 2012-8-26, 20:48,
by
tmser,
under
web前端
.
KindEditor4 插件的编写与 3 有很大的不同。官方文档也不多。
摸索了一下午终于弄了一个出来。
可运行程序插件
先贴代码。
KindEditor.plugin('run_code', function(K){
var self = this, name = 'run_code';
self.clickToolbar(name, function() {
var lang = self.lang(name + '.'),
html = ['<div style="padding:10px 20px;">',
'<textarea class="ke-textarea" style="width:408px;height:260px;"></textarea>',...
阅读全文>>