调用百度富文本

Posted 大咸菜

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了调用百度富文本相关的知识,希望对你有一定的参考价值。

1、修改内容
 <div class="form-group">
            <label for="post-content">文章内容</label>
            <script id="post-content" name="content" type="text/plain">{$post.content|htmlspecialchars_decode}</script>
        </div>
<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor(‘post-content‘,{
        toolbars: [
            [‘fullscreen‘, ‘source‘, ‘undo‘, ‘redo‘,‘bold‘, ‘italic‘, ‘underline‘,‘fontborder‘, ‘strikethrough‘, ‘|‘,‘simpleupload‘, ‘insertimage‘,‘attachment‘,‘emotion‘,‘link‘,‘unlink‘, ‘|‘, ‘removeformat‘, ‘formatmatch‘, ‘autotypeset‘, ‘blockquote‘,‘searchreplace‘, ‘pasteplain‘, ‘|‘, ‘forecolor‘, ‘backcolor‘, ‘insertorderedlist‘, ‘insertunorderedlist‘, ‘selectall‘, ‘cleardoc‘],
            [‘inserttable‘,‘insertrow‘, ‘insertcol‘,‘mergeright‘, ‘mergedown‘,‘deleterow‘, ‘deletecol‘,‘splittorows‘,‘splittocols‘, ‘splittocells‘,‘deletecaption‘,‘inserttitle‘, ‘mergecells‘, ‘deletetable‘,‘insertparagraphbeforetable‘, ‘paragraph‘,‘fontsize‘,‘fontfamily‘]
        ],
        initialFrameHeight:500,
        zIndex:100
    });
</script>

2、添加内容
        <div class="form-group">
            <label for="post-content">文章内容</label>
            <script id="post-content" name="content" type="text/plain"></script>
        </div>

<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor(‘post-content‘,{
        toolbars: [
            [‘fullscreen‘, ‘source‘, ‘undo‘, ‘redo‘,‘bold‘, ‘italic‘, ‘underline‘,‘fontborder‘, ‘strikethrough‘, ‘|‘,‘simpleupload‘, ‘insertimage‘,‘attachment‘,‘emotion‘,‘link‘,‘unlink‘, ‘|‘, ‘removeformat‘, ‘formatmatch‘, ‘autotypeset‘, ‘blockquote‘,‘searchreplace‘, ‘pasteplain‘, ‘|‘, ‘forecolor‘, ‘backcolor‘, ‘insertorderedlist‘, ‘insertunorderedlist‘, ‘selectall‘, ‘cleardoc‘],
            [‘inserttable‘,‘insertrow‘, ‘insertcol‘,‘mergeright‘, ‘mergedown‘,‘deleterow‘, ‘deletecol‘,‘splittorows‘,‘splittocols‘, ‘splittocells‘,‘deletecaption‘,‘inserttitle‘, ‘mergecells‘, ‘deletetable‘,‘insertparagraphbeforetable‘, ‘paragraph‘,‘fontsize‘,‘fontfamily‘]
        ],
        initialFrameHeight:500,
        zIndex:100
    });
</script>




以上是关于调用百度富文本的主要内容,如果未能解决你的问题,请参考以下文章

springmvc怎么使用百度富文本编辑器

百度的富文本编辑器Ueditor兼容问题

我用百度富文本插入网络视频,插入后不能播放,如何解决?

百度富文本编辑器

Tinkphp 百度富文本 应用

百度富文本Ueditor总结