文本编辑器

文本编辑器之(KindEditor

1.下载

 官网下载: http://kindeditor.net/down.php
 本地下载: http://files.cnblogs.com/files/wupeiqi/kindeditor_a5.zip
 详细参数 : http://kindeditor.net/docs/option.html

2.下载后文件夹说明

3、基本使用

<textarea name="content" id="content"></textarea>
 
 <script src="/static/jquery-1.12.4.js"></script>
 <script src="/static/plugins/kind-editor/kindeditor-all.js"></script>
 <script>
    
    
   $(function () {
       initKindEditor();
   });
   
   
     
    function initKindEditor() {
        var kind = KindEditor.create('#content', {
            width: '100%',       // 文本框宽度(可以百分比或像素)
            height: '300px',     // 文本框高度(只能像素)
            minWidth: 200,       // 最小宽度(数字)
            minHeight: 400      // 最小高度(数字)
           
           uploadJson: '/kind/upload_img/',  //上传路径

           resizeType: 1, //文本框 是否可以调动 0不能 1 上下 2 随便
           allowPreviewEmoticons: false,           //图标展示  true
                  allowImageUpload: false,                 //支持本地上传true
           items: [
             'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
             'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
              'insertunorderedlist', '|', 'emoticons', 'image', 'link'] //各种功能按钮
 
          
        });
    }
 </script>
 

 

 
 
 
 
 
 

 

4.常用参数


filePostName

指定上传文件form名称。

    • 数据类型: String
    • 默认值: imgFile

Note

4.1.2版本开始支持。

 

uploadJson

指定上传文件的服务器端程序。

  • 数据类型: String
  • 默认值: basePath + ‘php/upload_json.php’

4、上传文件示例

 HTML
 View

5、XSS过滤特殊标签

处理依赖

pip3 install beautifulsoup4
 XSS示例
 基于__new__实现单例模式示例
posted @ 2017-04-05 15:36  红领巾下的大刀疤  阅读(118)  评论(0)    收藏  举报
/* 看板娘 */