Question

I am using the tinyMCE library for my textareas but also for image uploads, however when have both of them on one page it doesn't work. It is fine when it is one of them alone but as soon as I put a tinyMCE textarea on a page and a button that launches the imagemanager dialog, the dialog loads up but the spinning loading icon just keeps going instead of loading the files from my rootpath.

In the head of my document i have:

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
});

Which is great for my textareas, then with jQuery on document.ready() I have the following for the uploads:

    $('.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;
  });

If I have an MCE textarea on the page and press my upload image button I get the following javascript errors:

Uncaught TypeError: Cannot set property 'innerHTML' of null - editor_plugin.js:1 Uncaught TypeError: Cannot call method 'getArgs' of undefined - index.php:1

I have tried the tinyMCE.init() after DOM ready, but no joy.

It feels like there might be some kind of path configuration conflict like the imagemanager. Does anybody know if there is a way of looking if the rootpath is getting screwed somehow on the imagemanager?

Cheers

Was it helpful?

Solution

If anybody comes across this... I fixed it by removing inlinepopups from the plugins list.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top