Archive for the ‘Solutions/Fixes’ Category

[FIXED] ib is null – ibrowser Plugin for TinyMCE

Friday, January 21st, 2011

I, like you, have run into the problem of ibrowser not working for Firefox (FF3). This is a pain as it seems like a great free image uploaded/manager for TinyMCE. The problem I kept running it is that after installing ibrowser and then testing it out, is that the icon to open up the popup for this plugin does nothing. Under further investigation I discovered I was getting a JavaScript error “ib is null“.

Well, so I search Google and found some people saying to add “var ib = null;” (no quotes) to the beginning of the editor_plugin.js. I opened my editor_plugin.js file and see that for my version this bug fix is already in there (aka ib = null; as already pasted into the beginning of this file). So back to square one, problem still not solved.

Then I looked through the code and found that the issue seems to be that on line 14 (of my version) which reads tinymce.ScriptLoader.load(url + ‘/interface/common.js’); this is not actually loading the script. So I just commented that line out and copied and pasted that whole script under that line.

That seemed to work and I got the ibrowser to open and upload images. But it would now not insert the image into the editor when you click the insert button. And I saw that I was getting the JavaScript error “opner.ibrowser_callback is not a function” now.

So this copy and paste method was not really working. I realized then that if the problem is that its just not loading the script then I should add in some code that will load the script for me.

[SOLUTION]

I’m luckly already using jQuery so I just did the following:

  1. In the file editor_plugin.js (located in ibrowser root plugin folder) commented out the line:
    tinymce.ScriptLoader.load(url + '/interface/common.js');
  2. Added the following line after that:
    $.getScript(url+'/interface/common.js'); // BUG FIX by Sean Gallagher www.GallagherWebsiteDesign.com
  3. Do the same as the above 2 steps for editor_plugin_src.js file as well
  4. That’s it! Upload editor_plugin.js and editor_plugin_src.js to your server and your done.

For non-iQuery users try the following solution – I’ve not tried this but others said it worked.

  1. In the file editor_plugin.js (located in ibrowser root plugin folder) commented out the line:
    tinymce.ScriptLoader.load(url + '/interface/common.js');
  2. Added the following line after that:
    tinymce.ScriptLoader.add(url + '/interface/common.js'); tinymce.ScriptLoader.loadQueue();
  3. Do the same as the above 2 steps for editor_plugin_src.js file as well
  4. That’s it… for more on this solution check out the TinyMCE forum thread for this (this solution is on the last page of that thread).

For more on jQUery script loading check out the getScript function.

To download ibrowser visit visions4net.com’s download page.

To download TinyMCE check out the TinyMCE home page.