【问题标题】:Tinymce 4 image upload is not working as it should beTinymce 4 图像上传无法正常工作
【发布时间】:2014-04-15 02:09:20
【问题描述】:

我正在尝试使用 Tiny mce4,但它无法正常工作。

我阅读了文档,然后使用了 tinymce 网站上提供的示例。

脚本已经在运行,但我的元素有点没有格式化,如下图所示,例如在插入/编辑图像时,我没有搜索按钮来选择图像。

您知道为什么会发生这种情况吗?因为我使用的是 you can see here 的 tinymce 示例,并且在 tinymce 网站上工作正常,但对我来说效果不太好!

我使用的代码与该示例相同,并且是这样的:

我在这里调用 tinymce.min.jse 并启动 tinymce:

<script type="text/javascript" src="tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
        selector: "textarea",
        plugins: [
                "advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
                "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
                "table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
        ],

        toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
        toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
        toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",

        menubar: false,
        toolbar_items_size: 'small',

        style_formats: [
                {title: 'Bold text', inline: 'b'},
                {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
                {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
                {title: 'Example 1', inline: 'span', classes: 'example1'},
                {title: 'Example 2', inline: 'span', classes: 'example2'},
                {title: 'Table styles'},
                {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
        ],

        templates: [
                {title: 'Test template 1', content: 'Test 1'},
                {title: 'Test template 2', content: 'Test 2'}
        ]
});</script>

</head>

然后我有我的表格:

<form method="post" action="somepage">
    <textarea name="content" style="width:100%"></textarea>
</form>

【问题讨论】:

标签: javascript jquery tinymce tinymce-4


【解决方案1】:

您在site 中看到的是moxiemanager 插件,与tinymce editor 一起用于图片上传。它不是免费提供的。

有很多用于上传图片的插件 - php + tinymce 在你正在实施的路上做一些研究。

对于图片上传 - rails + tinymce 最好的方法是 PerfectlyNormal,更多信息我已经实现了 check this out

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-20
    • 2023-03-29
    • 1970-01-01
    • 1970-01-01
    • 2023-03-31
    • 2013-03-11
    • 1970-01-01
    相关资源
    最近更新 更多