富文本编辑器kindeditor配置

富文本编辑器kindeditor配置<!–富文本编辑器kindeditor配置↓–><linktype=”text/css”rel=”stylesheet”href=”kindeditor/themes/default/default.css”/><linkrel=”stylesheet”href=”kindeditor/plugins/code/prettify.cs…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

富文本编辑器kindeditor配置
富文本编辑器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配置↑--> 

View Code

富文本编辑器kindeditor配置
富文本编辑器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>

View Code

富文本编辑器kindeditor配置

转载于:https://www.cnblogs.com/hsw-2013/p/3698554.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/182961.html原文链接:https://javaforall.net

赞 (0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • chrome调试appweb_调试应用是什么意思

    chrome调试appweb_调试应用是什么意思googleDevice使用

    2022年10月26日
  • Java代码生成器[通俗易懂]

    Java代码生成器[通俗易懂]项目说明本项目基于是基于renren-generator定制的代码生成器文章目录**项目说明**不同点:效果原理分析如何定制开发?更多可能存在的坑代码地址不同点:因为本人的公司使用的是tkmyabtis+swagger构建restapi,而renren-generator用的是mybatis-plus,而且不支持swagger,所以有了本项目效果…

    2022年4月27日
  • python 报错: unindent does not match any outer indentation level

    python 报错: unindent does not match any outer indentation level

    2021年11月11日
  • 数据结构面试常见问题总结怎么写_前端数据结构与算法面试题

    数据结构面试常见问题总结怎么写_前端数据结构与算法面试题数据结构面试常见问题总结写在前面本文记录了一些数据结构面试常见问题,本意用于考研复试,以下面试题为网上整理的问题以及自己加入的一些问题,答案仅供参考!Q:数据结构三要素A:逻辑结构、物理结构、数据运算Q:数组与链表有什么区别?A:数组静态分配内存,链表动态分配内存数组在内存中连续,链表不连续数组利用下标定位,时间复杂度为O(1),链表定位元素时间复杂度O(n)数组插入或删除元素的时间复杂度O(n),链表的时间复杂度O(1)Q:线性表的存储结构?A:顺序存储(内

    2022年9月15日
  • java.lang.AbstractMethodError: org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.cho

    java.lang.AbstractMethodError: org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.chojava.lang.AbstractMethodError:org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.choose(Ljava/lang/String;Lorg/springframework/cloud/client/loadbalancer/Request;)Lorg/springframework/cloud/client/ServiceInstance; atorg.springframework.clo

    2022年6月2日
  • 迭代法求行列式(线性代数公式)

    线性代数行列式计算之迭代法声明与简介线性代数行列式计算之迭代法是利用行列式逐阶展开式会发现或总结出n阶和n-1阶、n-2阶以及剩余阶的关系式,进而推算出整个行列式的最终结果。比如可以由或反过来(),总之能找出一个逐级演变的推导关系式。迭代法又称之为递推法。迭代法正向迭代根据给的行列式可以直观的找出n阶和n-1阶的关系式,这种方法叫做直接迭代法。详见如下示例:计算n阶行列式:#1思路Step1先观察行列式的特点,再整理思路Step2如果我们对第…

    2022年4月11日

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号