tinymce无法在工具栏上显示“插入文件”图标

时间:2018-05-21 09:42:36

标签: javascript insert tinymce

刚刚安装了系统,由于某种原因无法在工具栏上加载插入文件图标。

代码是:

<script language="javascript" type="text/javascript" src="/tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea",
plugins: [
"advlist autolink lists link image charmap print hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking save table contextmenu directionality emoticons template paste textcolor"
],
theme: "modern",
image_advtab: true,
toolbar: " undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons insertfile "

})
</script>

显示所有其他图标,但insertfile不显示。

任何建议都会受到赞赏......

3 个答案:

答案 0 :(得分:0)

在工具栏中添加“插入”。据我所知,没有“insertfile”插件,它由“插入”插件处理。

您可以在文档中看到完整的基本示例: https://www.tinymce.com/docs/demo/basic-example/

答案 1 :(得分:0)

您需要在编辑器中添加插件moxiemanager和工具栏insertfile

tinymce.init({
    selector: "textarea",
    plugins: "moxiemanager link image",
  external_plugins: {
        "moxiemanager": "https://www.moxiemanager.com/moxiemanager/plugin.min.js"
    },
    toolbar: "insertfile link image",
    menubar: false,
    moxiemanager_file_settings : {
        /* Only list txt files, and remove side navigation. */
        moxiemanager_extensions : 'txt',
        moxiemanager_leftpanel : false
    },
    moxiemanager_image_settings : {
        /* Scope to different folder, show thumbnails of selected extensions */
        moxiemanager_title : 'Images',
        moxiemanager_extensions : 'jpg,png,gif',
        moxiemanager_rootpath : '/testfiles/testfolder',
        moxiemanager_view : 'thumbs'
    }
});

它将添加一个新按钮,使您有机会插入多种类型的文件。

您可以在此处测试和检查结果:see images here

答案 2 :(得分:0)