zoukankan      html  css  js  c++  java
  • 百度富文本编辑器

    <!-- https://mvnrepository.com/artifact/com.baidu.ueditor/ueditor -->
            <dependency>
                <groupId>com.baidu</groupId>
                <artifactId>ueditor</artifactId>
                <version>1.1.2</version>
            </dependency>
    <script id="container" type="text/plain" style="100%;height:600px;"></script>
    <script type="text/javascript">
    //初始化
    var ue = UE.getEditor('container', {
        autoHeightEnabled: false,
        //图表多行显示 对应参考http://fex.baidu.com/ueditor/#start-toolbar
    //     toolbars: [
    //         [
    //             'anchor', 'undo',  'redo', 'bold', 'indent','snapscreen','italic', 'underline', 'strikethrough',  'subscript', 'fontborder','superscript','formatmatch', 'source', 'blockquote', 'pasteplain', 'selectall','print', 'mergedown',  'deleterow', 'deletecol',
    //         ],
    //         [
    //             'splittorows','splittocols','splittocells','deletecaption', 'inserttitle', 'mergecells','deletetable', 'cleardoc','insertparagraphbeforetable', 'insertcode', 'fontfamily',  'fontsize',  'paragraph','simpleupload','insertimage','edittable',  'edittd','link','emotion','spechars','searchreplace','map', 'gmap', 'insertvideo',  'help',  'justifyleft','justifyright', 'justifycenter', 'justifyjustify',  'forecolor','backcolor', 
    //         ],
    //         [
    //             'insertorderedlist', 'insertunorderedlist','fullscreen','directionalityltr','directionalityrtl','rowspacingtop', 'rowspacingbottom', 'pagebreak', 'insertframe', 'imagenone', 'imageleft',  'imageright','attachment', 'imagecenter','wordimage', 'lineheight','edittip ',  'customstyle','autotypeset','webapp','touppercase', 'tolowercase','background','template','scrawl','music', 'inserttable','drafts',  'charts', // 图表
    //         ]
    //     ]
    });
    
    // var ue = UE.getContent();
    // //对编辑器的操作最好在编辑器ready之后再做
    // ue.ready(function() {
    //     //设置编辑器的内容
    //     ue.setContent('hello');
    //     //获取html内容,返回: <p>hello</p>
    //     var html = ue.getContent();
    //     console.log(html)
    //     //获取纯文本内容,返回: hello
    //     var txt = ue.getContentTxt();
    // });
    </script>
    后台获取内容直接用editorValue接受
    public String save(String editorValue) {}

    注意:出版本为jsp版本

  • 相关阅读:
    平台
    重构之践
    Linux.NET
    系统分析员级下午试题II(论文)解答方法
    通用泛型存储接口的设计
    .NET平台4.0 发布网站流程及出错总结
    在IIS上发布基于Windows Azure Service Bus的WCF服务
    epoll + 多线程实现并发网络连接处理
    Linux进程地址空间之初探:一
    排序、搜索
  • 原文地址:https://www.cnblogs.com/ch94/p/14718539.html
Copyright © 2011-2022 走看看