On my site, the IMCE window opens using the following url:

http://mydomain.local/imce?app=tinymce%7Csendto%40myIMCESendTo

This was achieved by tweaking the IMCE Bridge module. I have also defined a function myIMCESendTo in the IMCE Bridge javascript file myimce_wysiwyg.js. This is the same file as used by the IMCE Bridge module where the IMCE window is open using win.open (only I changed the name).

However, it looks like IMCE does not find myIMCESendTo() function. Also in the browser debug window (I use Chrome) when checking the new IMCE window loaded scripts, there is no javascript file myimce_wysiwyg.js loaded at all (it is loaded in the parent window only)

More precisely, there is line 42 in imce_set_app.js checking for sendto function:
if (appFields.sendto && (func = isFunc(appFields.sendto)))
and isFunc(myIMCESendTo) returns false.

By the way, for testing purpose, myIMCESendTo is defined like this:
function myIMCESendTo (file, win) {
alert ("aa");
}

and no alert is displayed when a file is chosen in IMCE. That's another proof that this function is not found.

So, where to define this sendto function?

CommentFileSizeAuthor
#2 scr1.png7.69 KBraincloud
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ufku’s picture

IMCE looks for the sendto function in the opener window, which is the parent window that opens IMCE window.

raincloud’s picture

FileSize
7.69 KB

It is exactly as I have, but it's not working... :(

More precisely, this is what I consider a parent window, containing the IMCE browse button:

parent window

And looking at the scripts section, in this window, there is loaded script myimce_wysiwyg.js containing:
function imceImageBrowser(field_name, url, type, win) <- the original function that calls address http://mydomain.local/imce
var imceCkeditSendTo = function (file, win) <- an original function that I don't use (I have tinymce)
function myIMCESendTo (file, win) <- my function which just displays an alert for now

Is this the right location to define the myIMCESendTo function? I think this is the parent window.

thalles’s picture

Issue summary: View changes

Leave know if you solved this issue, please!

thalles’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.