相同页面上的tinyMCE textarea和imagemanager冲突

时间:2012-04-28 23:38:43

标签: javascript tinymce mcimagemanager

我正在使用tinyMCE库来处理我的textareas,但也用于图片上传,但是当它们在一个页面上都不能使用时。当它是其中一个时它很好但是只要我在页面上放置一个tinyMCE文本区域和一个启动图像管理器对话框的按钮,对话框就会加载,但旋转加载图标只是继续运行而不是从我的文件加载ROOTPATH。

在我的文件的头部,我有:

tinyMCE.init({

  // General options
  mode : "textareas",
  theme : "advanced",
    editor_selector : "mceEditor",
  editor_deselector : "mceNoEditor",
  plugins : "style,advlink,inlinepopups,preview,contextmenu,paste,directionality,fullscreen,noneditable,imagemanager,media",

  // Theme options
  theme_advanced_buttons1 : "cut,copy,paste,pastetext,pasteword,|,undo,redo,|,link,unlink,code,|,fullscreen",
  theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_toolbar_location : "bottom",
  theme_advanced_toolbar_align : "center",
  theme_advanced_resizing : false,
    media_strict: false
});

这对我的textareas来说很棒,然后使用jQuery on document.ready()我有以下内容用于上传:

    $('.add_image_button').click(function(){

      mcImageManager.open(''{

          rootpath : '{0}/',
          oninsert:function(o){
              var location = o.focusedFile.path;
              location = location.substr(4);
      location = '_uploads/'+location;
      var preview_image = '../' + location;

      $('#selected_image > img').attr('src', preview_image);
      $('#image_path').val(location);
          }
      });
      return false;
  });

如果我在页面上有一个MCE textarea并按下我的上传图片按钮,我会收到以下javascript错误:

Uncaught TypeError:无法设置null的属性'innerHTML' - editor_plugin.js:1 未捕获的TypeError:无法调用未定义的方法'getArgs' - index.php:1

在DOM准备好之后我尝试了tinyMCE.init(),但没有快乐。

感觉可能存在某种路径配置冲突,如imagemanager。 有没有人知道是否有办法查看根路径是否在图像管理器上被搞砸了?

干杯

1 个答案:

答案 0 :(得分:1)

如果有人遇到这个...我通过从插件列表中删除inlinepopup来修复它。

相关问题