首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >微型MCE图像上载终结点

微型MCE图像上载终结点
EN

Stack Overflow用户
提问于 2013-03-14 05:06:56
回答 1查看 850关注 0票数 1

我正在尝试弄清楚如何在TinyMCE中设置我自己的图像上传端点。我似乎在文档中找不到它,我宁愿不使用MCImageManager,因为它有太多我想要完成的功能。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-03-15 01:05:11

我建议的解决方案是去掉advimage按钮,指定您自己的上传图像按钮。适用于使用jquery插件的用户。

代码语言:javascript
复制
    $('textarea.tinymce').tinymce({
        // Location of TinyMCE script
        script_url : '../../../js/vendor/tiny_mce/tiny_mce.js',

        // General options
        theme : "advanced",
        skin : "bootstrap",
        plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "uploadimageCustom, save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "lists/template_list.js",
        external_link_list_url : "lists/link_list.js",
        external_image_list_url : "lists/image_list.js",
        media_external_list_url : "lists/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
            username : "Some User",
            staffid : "991234"
        },

        setup: function (fn) {
            fn.addButton('uploadimageCustom', {
                title : 'Upload Image',
                onclick : function () {
                    // pop open your own upload modal.
                            $(selector).modal('show')
                                                           // modal has fine uploader or other plugin.

                            // after xhr for image uploading is done or on 'complete' event for fineuploader
                            // insert your image html to the textarea with 

                  $('#content').tinymce().execCommand('mceInsertContent',false,'<img src="<your newly uploaded image src>" />');"
                }
            });
        }
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15396478

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档