I have managed to get imagepicker-6.x-2.x-dev module at http://drupal.org/project/imagepicker to work with module fckeditor-6.x-1.3 after a good look at the docs for FCKeditor API.

The code I use to catch the fckeditor instance and to insert some html into the body is as follows:
(this is javascript code)

myFCKeditor = win.FCKeditorAPI.GetInstance('oFCK_1');

myFCKeditor.InsertHtml(imgpInsertion);

However it does not work with fckeditor-6.x-2.x-dev. It does not seem to be able to find the FCKeditor instance. This may be due to fckeditor-6.x-2.x-dev using a different method to load itself at least judging from the source code in the browser.
Any pointers would be much appreciated, I would like to see imagepicker work with the latest FCKeditor.

Thanks

Comments

wwalc’s picture

well.. it could look more or less like this:

      if (isFCKeditor == 'yes') {
        myFCKeditor = win.FCKeditorAPI.GetInstance('oFCK_1');
        if (!myFCKeditor && typeof win.fckInstances != 'undefined') {
          //actually we should get here the right instance of FCKeditor, sometimes there might be more than one instance
          for (var i in win.fckInstances) {
            myFCKeditor = win.FCKeditorAPI.GetInstance(i);
          }
        }
      }

also you might want to set the "#wysiwyg" property to false to disable FCKeditor on textarea elements used by imagepicker (where imagepicker asks for image description).

hutch’s picture

Right, thank you, a hunt routine, of course!
I will experiment some more.

wwalc’s picture

Actually also take a look here: #445878: Add a "fckActiveId" variable for the active editor (note: this feature is currently available only in CVS). If you need anything else, let me know.

Jorrit’s picture

Status: Active » Closed (fixed)

Closed because of inactivity.