JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.5.12

Need help with a WYSIWYG-editor in Joomla! 1.0.x? This is the place to be.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Corrie Sloot
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Oct 29, 2008 4:07 am
Location: Canada
Contact:

JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.5.12

Post by Corrie Sloot » Sat Sep 18, 2010 1:59 am

On September 7th, Firefox released version 3.6.9 and 3.5.12. Since then, I am unable to easily add images using JCE's Image Manager (Insert / Edit Image).

Whenever I try, the image is broken. When I look at the HTML source, the IMG tag is missing a SRC attribute.

The only way I have found around this is to select the same image, click "Insert / Edit Image" again, select the same image, and "Update."

This affects at least JCE 1.0.4, with Image Manager 1.0.4 in Firefox 3.6.9 and above, as well as Firefox 3.5.12 and above. I have confirmed the problem in these browsers under Windows, Ubuntu and OSX.

If you look at the changelog for Firefox, there is an entry called "Paste image into Compose window broken with Shredder" which I think might be related to this problem.

Has anyone else experienced this problem? Does anyone know of a fix, or a better work around?

Corrie

Teessider
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Tue Sep 13, 2005 10:55 am
Location: Teesside, UK
Contact:

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by Teessider » Mon Sep 20, 2010 7:20 pm

I'm having exactly the same issue. I'm running Firefox 3.6.10 and it is stripping the src="link" part of the image link when I click 'insert'.

I'm using tinyMCE 2.0 as an editor. My only workaround so far has been to use IE8 *spit* :D

Corrie Sloot
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Oct 29, 2008 4:07 am
Location: Canada
Contact:

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by Corrie Sloot » Tue Sep 21, 2010 12:57 am

I have a hack that may fix the JCE / tinyMCE image upload problem.

Download and open this file:
/mambots/editors/jce/jscripts/tiny_mce/tiny_mce.js

Search for this code:

Code: Select all

value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);
Immediatley after that add:

Code: Select all

alert(value);
Clear your cache, login to Joomla and try to insert an image. Take a look at what JavaScipt pops up for the HTML. In my case there were some weird attributes, like xsrc="". My proposal is doing a search-replace on this HTML to make the proper src attribute show up.

Re-open the tiny_mce.js, and replace your alert(value); with the following:

Code: Select all

value=value.replace("xsrc=","src=");
It might not be xsrc, but mce_tsrc or something like that, so change the code as needed.

Upload, clear cache again (JCE is hard to remove from cache), and your images should be corrected.

This may be difficult, but it is way better than using IE8. :)

CPSI
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Sep 21, 2010 8:03 pm

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by CPSI » Tue Sep 21, 2010 10:43 pm

That fixed the insert image issue, but what about the File Manager insert link (linking to PDF)? Any ideas on that one?

Corrie Sloot
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Oct 29, 2008 4:07 am
Location: Canada
Contact:

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by Corrie Sloot » Tue Sep 21, 2010 11:34 pm

This is the same type of problem. If you are using JCE's "Insert File Link", it will popup the File Manager.

Download this file via FTP (or however): /mambots/editors/jce/jscripts/tiny_mce/tiny_mce.js

Search for this:

Code: Select all

value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);
Immediatley after that add this:

Code: Select all

value=value.replace("xsrc=","src=");value=value.replace("xhref=","href=");
Re-upload the file, clear your cache, and try again.

If that doesn't work, use the alert() method above to find out what the href should be.

This should help if inserting images or inserting files doesn't work in Joomla 1.0 JCE editor.

CPSI
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Sep 21, 2010 8:03 pm

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by CPSI » Wed Sep 22, 2010 1:59 am

Thank you so much!! For mine it was:

Code: Select all

value=value.replace("mce_tsrc=","src=");value=value.replace("mce_thref=","href=");

CPSI
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Sep 21, 2010 8:03 pm

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by CPSI » Wed Sep 22, 2010 12:51 pm

Insert HTML Template is also messed up (at least any hyperlinks in it). Do you know if that is the same type of fix. I tried the

Code: Select all

alert(value);
code and could not come up with anything on that one as of yet. Thanks.

archer001
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Sep 26, 2010 7:49 am

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by archer001 » Sun Sep 26, 2010 7:54 am

i have the same problem, thank for your hack, i resolved my problem in half.
i have a site in / directory and another one in /en/
with this hack, i have no problem in firest site, but in second one i have another problem, which is, when i insert an image, the src attribute shows as "/images/stories/..." instead of "/en/images/stories/..." in other words, the subdirectory will be lost.

archer001
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Sep 26, 2010 7:49 am

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by archer001 » Sun Sep 26, 2010 2:20 pm

after a few hours i found a hack myself to solve the problem.

search for

Code: Select all

try{if(value.indexOf('<')==-1&&!value.match(/(&|&#160;|<|>)/g)){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2)}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand('inserthtml',false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value)}}catch(ex){insertHTMLFailed=true}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return}
and delet all this code

by doing this, the code works perfec except that if there is nothing else than the inserted image in the editor, you can not delete the image by pressing DEL key on keyborad.
i solved this problem by adding an empty <span> tag in the editor creator function. to do this, open the mambot php file of the editor and search for somthing like

Code: Select all

<textarea id="<?php echo $hiddenField;?>" name="<?php echo $hiddenField;?>" cols="<?php echo $col;?>" rows="<?php echo $row;?>" style="width:<?php echo $width;?>px; height:<?php echo $height;?>px;" mce_editable="true" class="mceEditor"><?php echo $content;?></textarea>
and replace it with:

Code: Select all

<textarea id="<?php echo $hiddenField;?>" name="<?php echo $hiddenField;?>" cols="<?php echo $col;?>" rows="<?php echo $row;?>" style="width:<?php echo $width;?>px; height:<?php echo $height;?>px;" mce_editable="true" class="mceEditor"><?php echo $content?$content:'<span> </span>';?></textarea>

User avatar
julianoaso
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Wed Aug 13, 2008 12:38 pm
Location: Ribeirão Preto/SP
Contact:

Re: JCE 1.0 Image Manager Firefox >= 3.6.9 and Firefox >= 3.

Post by julianoaso » Thu Oct 14, 2010 7:31 pm

Cool, its works to me. But to remove cache from JCE in Joomla is very hard d:-)

Thanks mates


Locked

Return to “WYSIWYG Editors - 1.0.x”