使用 KindEditor 的 单独调用组件
2013-11-15 14:57
260 查看
转载:http://hkstb.blog.163.com/blog/static/46096793201392313257298/
<script>
KindEditor.ready(function (K) {
var editor1 = K.create('#<%=Describe.ClientID%>', {
cssPath: '../kindeditor/plugins/code/prettify.css',
uploadJson: '../kindeditor/asp.net/upload_json.ashx',
fileManagerJson: '../kindeditor/asp.net/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function () {
var self = this;
K.ctrl(document, 13, function () {
self.sync();
K('form[name=form1]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function () {
self.sync();
K('form[name=form1]')[0].submit();
});
}
});
//注意:这里的editor1要和上面的editor1对应
K('#image1').click(function () {
editor1.loadPlugin('image', function () {
editor1.plugin.imageDialog({
imageUrl: K('#<%=SmallImg.ClientID%>').val(),
clickFn: function (url, title, width, height, border, align) {
K('#<%=SmallImg.ClientID%>').val(url);
editor1.hideDialog();
}
});
});
});
prettyPrint();
});
</script>
--------------------------------------
<tr>
<th>缩略图:</th><td><asp:TextBox ID="SmallImg" runat="server" EnableViewState="False"></asp:TextBox> <input type="button" id="image1" value="选择图片" /></td>
</tr>
<script>
KindEditor.ready(function (K) {
var editor1 = K.create('#<%=Describe.ClientID%>', {
cssPath: '../kindeditor/plugins/code/prettify.css',
uploadJson: '../kindeditor/asp.net/upload_json.ashx',
fileManagerJson: '../kindeditor/asp.net/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function () {
var self = this;
K.ctrl(document, 13, function () {
self.sync();
K('form[name=form1]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function () {
self.sync();
K('form[name=form1]')[0].submit();
});
}
});
//注意:这里的editor1要和上面的editor1对应
K('#image1').click(function () {
editor1.loadPlugin('image', function () {
editor1.plugin.imageDialog({
imageUrl: K('#<%=SmallImg.ClientID%>').val(),
clickFn: function (url, title, width, height, border, align) {
K('#<%=SmallImg.ClientID%>').val(url);
editor1.hideDialog();
}
});
});
});
prettyPrint();
});
</script>
--------------------------------------
<tr>
<th>缩略图:</th><td><asp:TextBox ID="SmallImg" runat="server" EnableViewState="False"></asp:TextBox> <input type="button" id="image1" value="选择图片" /></td>
</tr>
相关文章推荐
- 单独调用kindeditor的多图上传组件实现多图上传
- Kindeditor -单独调用组件,可以直接调用上传功能。
- Kindeditor -单独调用组件,可以直接调用上传功能。
- android 四大组件之Service两种调用方式使用详解
- 使用.NET2.0编写COM组件供VB调用
- 使用ajax调用含JQuery easyUI的组件需要重绘
- 使用rmi协议,基于cglib实现组件管理和远程方法调用
- 使用msscript.ocx组件的ScriptControl调用VBS脚本
- KindEditor单独上传图片、单独上传文件、编辑器的通用设置与调用
- KindEditor 单独调用图片插件
- 安卓Service组件使用系列4:绑定service并调用service中的方法返回结果
- android 使用include 调用内部组件
- 教你如何在SpringMVC项目中单独使用Feign组件(含源码分析)
- vue 使用ref 让父组件调用子组件的方法
- android使用include调用内部组件的方法
- Gallery单独使用,Gallery和ImageSwitcher组件结合使用的例子
- 使用Geoprocessor导出ArcSde中的数据,对COM 组件的调用返回了错误 HRESULT E_FAIL 的解决方法
- java使用jdic组件调用ie内核-实现调用本地操作系统文件
- js调用打印接口打印web页面之——使用lodop组件打印jsp web页面
- vue 使用ref 让父组件调用子组件的方法