富文本编辑器kindeditor配置

<!--富文本编辑器kindeditor配置↓ -->
<link type="text/css" rel="stylesheet" href="kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" />
<script type="text/javascript" charset="utf-8" src="kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript" charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript">
KindEditor.ready(function (K) {
var editor1 = K.create(‘#content1‘, {
items: [
‘fontname‘, ‘fontsize‘, ‘|‘, ‘forecolor‘, ‘hilitecolor‘, ‘bold‘, ‘italic‘, ‘underline‘,
‘removeformat‘, ‘strikethrough‘, ‘lineheight‘, ‘|‘, ‘justifyleft‘, ‘justifycenter‘, ‘justifyright‘, ‘insertorderedlist‘,
‘insertunorderedlist‘, ‘|‘, ‘emoticons‘, ‘link‘, ‘insertfile‘, ‘media‘, ‘|‘, ‘image‘, ‘multiimage‘, ‘map‘, ‘baidumap‘, ‘|‘, ‘preview‘, ‘fullscreen‘,
],
cssPath: ‘kindeditor/plugins/code/prettify.css‘,
uploadJson: ‘kindeditor/asp.net/upload_json.ashx‘,
fileManagerJson: ‘kindeditor/asp.net/file_manager_json.ashx‘,
allowFileManager: true,
afterChange : function() {
$(‘.word_count1‘).html(this.count()); //字数统计包含HTML代码
$(‘.word_count2‘).html(this.count(‘text‘)); //字数统计包含纯文本、IMG、EMBED,不包含换行符,IMG和EMBED算一个文字
//////////
//限制字数
var limitNum = 40000; //设定限制字数
var pattern = ‘还可以输入‘ + limitNum + ‘字‘;
$(‘.word_surplus‘).html(pattern); //输入显示
if(this.count(‘text‘) > limitNum) {
pattern = (‘字数超过限制,请适当删除部分内容‘);
//超过字数限制自动截取
var strValue = editor.text();
strValue = strValue.substring(0,limitNum);
editor.text(strValue);
} else {
//计算剩余字数
var result = limitNum - this.count(‘text‘);
pattern = ‘还可以输入‘ + result + ‘字‘;
}
$(‘.word_surplus‘).html(pattern); //输入显示
////////
} ,

pasteType: 1,
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();
});
}
});
prettyPrint();
});
</script>
<!--富文本编辑器kindeditor配置↑-->

            <dt><span class="red">*</span> 职位描述:</dt>
<dd >
您当前输入了 <span class="word_count1">0</span> 个文字。(字数统计包含HTML代码。)<span class="word_surplus"></span>

</dd>
<dd >
<textarea id="content1" name="content1" style="width:700px;height:300px;visibility:hidden;"></textarea>

</dd>

富文本编辑器kindeditor配置,码迷,mamicode.com

时间: 2024-08-25 09:54:12

富文本编辑器kindeditor配置的相关文章

MVC富文本编辑器CKEditor配置CKFinder

富文本编辑器CKEditor的使用 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin:

富文本编辑器KindEditor的使用

       富文本编辑器KindEditor,是一种可内嵌于浏览器,所见即所得的文本编辑器.它是一种解决可一般的用户不同html等网页标记但是需要在网页上设置字体的颜色.大小.样式等信息问题一个文本编辑器 第一步 引入三个文件(一个css,两个js) 第二步 创建textarea控件 第三步 创建初始化方法createEditor (1) (2)select代表textarea对象,return返回一个富文本编辑对象,也就是(1)中的itemAddEditor (3) 至此初始化完成 当需要提

富文本编辑器 CKeditor 配置使用 (带附件)

Ckeditor下载地址:http://ckeditor.com/download 1.CKeditor的基本配置 var textval=CKEDITOR.instances.TextArea1.getData(); //获取带HTML的值 var stemTxt=CKEDITOR.instances.TextArea1.document.getBody().getText();//获取纯文本 CKEDITOR.instances.TextArea1.setData(data.content)

富文本编辑器 CKeditor 配置使用

作者:Tyler Ning出处:http://www.cnblogs.com/tylerdonet/本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,如有问题,可以通过以下邮箱地址[email protected] 联系我,非常感谢. Ckeditor下载地址:http://ckeditor.com/download 一.使用方法:1.在页面<head>中引入ckeditor核心文件ckeditor.js script type="

百度开源富文本编辑器 UEditor配置:图片上传和文件上传独立使用方法

使用UEditor编辑器自带的插件实现图片上传和文件上传功能,这里通过配置UEditor单独使用其内置的第三方插件swfupload来实现图片和文件的上传,通过对UEditor配置轻松实现图片批量上传,文件披批量上传 第一步:先配置UEditor <script src="ueditor/ueditor.config.js"></script> <script src="ueditor/ueditor.all.min.js">&l

优秀的富文本编辑器 Kindeditor

<textarea name="txtbody" style="width:100%;height:320px;" > {$article.txt} </textarea> <script charset="utf-8" src="__STATIC__/kindeditor/kindeditor.js"></script> <script charset="utf

BBS(仿博客园系统)项目05(后台管理功能实现:文章添加、富文本编辑器使用、xss攻击、BeautifulSoup4模块、富文本编辑器上传图片、修改头像)

摘要 布局框架搭建 随笔添加 后台管理富文本编辑器KindEditor xss攻击 文章简介的截取,BeautifulSoup4模块 富文本编辑器上传图片 头像修改 一.后台管理框架布局搭建 后台管理布局框架分析:导航条.左侧功能区.右侧主要功能显示和实现区 实现: 导航条:使用bootstrap模板:JavaScript>>导航条 左侧:使用bootstrap模板:组件>>列表组 右侧:使用bootstrap模板:JavaScript>>标签页 新建后台管理路由(注意

ASP.NET网站使用Kindeditor富文本编辑器配置步骤

1. 下载编辑器 下载 KindEditor 最新版本,下载页面: http://www.kindsoft.net/down.php 2. 部署编辑器 解压 kindeditor-x.x.x.zip 文件,将editor文件夹复制到web目录下  3.在网页中加入(ValidateRequest="false") 1 <%@ Page Language="C#" AutoEventWireup="true" ValidateRequest=

KindEditor 一款好用的HTML可视化编辑器(富文本编辑器)

KindEditor使用JavaScript编写,可以无缝的于Java..NET.PHP.ASP等程序接合. KindEditor非常适合在CMS.商城.论坛.博客.Wiki.电子邮件等互联网应用上使用,2006年7月首次发布2.0以来,KindEditor依靠出色的用户体验和领先的技术不断扩大编辑器市场占有率,目前在国内已经成为最受欢迎的编辑器之一. ---以上内容来自百度百科 怎么用呢? 下载kindeditor 官网下载地址在这里 下载完成后,解压完并放入自己的项目中,目录结构如图: 初始