【问题标题】:TinyMCE insert image - browse button does nothing when clickedTinyMCE 插入图像 - 单击时浏览按钮不执行任何操作
【发布时间】:2012-12-06 18:30:34
【问题描述】:

我正在使用 tinyMCE 编辑器,并且我在工具栏上包含了插入图像按钮,但是当我单击浏览按钮时没有任何反应!我刚刚收到此错误“TypeError:p 未定义”

这是 tinyMCE 的配置文件:

tinyMCE_GZ.init({
    // plugins: 'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras',
    themes: 'simple,advanced,searchreplace',
    languages: 'en',
    disk_cache: true,
    debug: false
});

tinyMCE.init({
    // General options
    mode: "textareas",
    theme: "advanced",
    skin: "o2k7",
    plugins: "autolink,lists,spellchecker,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: "newdocument,template,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect,|,undo,redo,|,image,media,|,forecolor,backcolor,|,print",
    theme_advanced_buttons1: "bold,italic,underline,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect,|,forecolor,|,image,media",
    theme_advanced_toolbar_location: "top",
    theme_advanced_toolbar_align: "left",
    theme_advanced_statusbar_location: "bottom",
    theme_advanced_resizing: true,

    file_browser_callback: "openBrowser",


    // Skin options
    skin: "o2k7",
    //skin_variant: "Blue",
    content_css: "../../Scripts/tiny_mce/themes/simple/skins/o2k7/content.css",

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

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

    //To prevent having new paragraph each line
    force_br_newlines: true,
    force_p_newlines: false,
    forced_root_block: '', // Needed for 3.x

    setup: function (ed) {
        ed.onActivate.add(function (ed) {
            cursorRange = ed.selection.getRng();
        });

        ed.onKeyUp.add(function (ed, e) {
            //To Update cursor location when arrows, PgUp , PgDwn , Home & End keys are pressed
            if (e.keyCode >= 33 && e.keyCode <= 40) {
                cursorRange = ed.selection.getRng();
            }
        });

        ed.onInit.add(function (ed) {
            ed.focus();
            cursorRange = ed.selection.getRng();
        });

        ed.onActivate.add(function (ed) {
            ed.focus();
            cursorRange = ed.selection.getRng();
        });

        ed.onClick.add(function (ed, e) {
            cursorRange = ed.selection.getRng();
        });
    },


    theme_advanced_statusbar_location: "none"

});

如何启用它?

谢谢。

【问题讨论】:

  • 不使用压缩器是否可以工作:tinyMCE_GZ ?
  • 我刚刚在没有 tinyMCE_GZ 的情况下尝试过,得到了相同的结果!
  • 我创建了一个 tinymce 小提琴,它可以工作:fiddle.tinymce.com/N3caab/1。你能包括 tiny_mce_dev.js 而不是 tiny_mce.js 吗? - 这会导致更好的调试消息(可读的 js 错误)
  • 我尝试运行小提琴,但没有成功!我收到“f not defined”错误!
  • 您使用的是什么浏览器和 tinymce 版本?

标签: c# javascript tinymce


【解决方案1】:

您使用的 tinymce 版本已经使用了五年多(!!!)并且已经过时了。它不适用于任何较新的浏览器。您需要下载更新版本的 tinymce 并使用该版本。

【讨论】:

  • 对不起!我使用的版本是 3.5.7 是错误的。
猜你喜欢
  • 1970-01-01
  • 2021-09-15
  • 1970-01-01
  • 2021-11-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多