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版本

  • 相关阅读:
    当 Messaging 遇上 Jepsen
    Dubbo 在跨语言和协议穿透性方向的探索:支持 HTTP/2 gRPC
    MongoDB与阿里云达成战略合作,最新数据库独家上线阿里云!
    新网银行微服务转型实践
    微服务架构四大金刚利器
    揭秘2019 双11背后的阿里巴巴超强网络
    揭秘2019双11背后的云网络 – 双11网络架构和洛神系统
    小程序的餐饮之路:从流量捕手到流量塘主的进阶秘籍
    备忘录(Memento)模式
    状态(state)模式
  • 原文地址:https://www.cnblogs.com/ch94/p/14718539.html
Copyright © 2011-2022 走看看