Ok, I'm using the editor and have already created custom tags that are interpreted in the editor to display an image. This works perfect in IE but for some reason not in firefox. Unfortunately I'm not sure why and I'm not completely sure what the FCKDocumentProcessor_CreateFakeImage() function does. I basically copied the function from the anchor interpretation function but there should never be any innerHTML so I took that part out. Here's the code:
Unfortunately I don't necessarily see anything wrong with this. Does anyone have any suggestions or think they ran into the same problem? Thanks in advance.
// Link Anchors if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera ) { var FCKAnchorsProcessor = FCKDocumentProcessor.AppendNew() ; FCKAnchorsProcessor.ProcessDocument = function( document ) { var aLinks = document.getElementsByTagName( 'A' ) ; var oLink ; var i = aLinks.length - 1 ; while ( i >= 0 && ( oLink = aLinks[i--] ) ) { // If it is anchor. Doesn't matter if it's also a link (even better: we show that it's both a link and an anchor) if ( oLink.name.length > 0 ) { //if the anchor has some content then we just add a temporary class if ( oLink.innerHTML !== '' ) { if ( FCKBrowserInfo.IsIE ) oLink.className += ' FCK__AnchorC' ; } else { var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oLink.cloneNode(true) ) ; oImg.setAttribute( '_fckanchor', 'true', 0 ) ; oLink.parentNode.insertBefore( oImg, oLink ) ; oLink.parentNode.removeChild( oLink ) ; } } } } } // Custom Content var FCKCustomContentProcessor = FCKDocumentProcessor.AppendNew() ; FCKCustomContentProcessor.ProcessDocument = function( document ) { var aLinks = document.getElementsByTagName( 'CUSTOMCONTENT' ) ; var oLink ; var i = aLinks.length - 1 ; while ( i >= 0 && ( oLink = aLinks[i--] ) ) { var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__CustomContent', oLink.cloneNode(true) ) ; oImg.setAttribute( '_fckcustomcontent', 'true', 0 ) ; oImg.src = FCKConfig.FullBasePath+'plugins/structuredData/customContent.gif'; oImg.style.width = '80px'; oImg.style.height = '16px'; oLink.parentNode.insertBefore( oImg, oLink ) ; oLink.parentNode.removeChild( oLink ) ; } }
Unfortunately I don't necessarily see anything wrong with this. Does anyone have any suggestions or think they ran into the same problem? Thanks in advance.
Re: fck document processor and FCKDocumentProcessor_CreateFakeIm
Re: fck document processor and FCKDocumentProcessor_CreateFakeIm
Re: fck document processor and FCKDocumentProcessor_CreateFakeIm
Thanks in advance
Re: fck document processor and FCKDocumentProcessor_CreateFakeIm
Re: fck document processor and FCKDocumentProcessor_CreateFakeIm
I looked into it and the tag name is actually converted to fck:customcontent so I tried getElementsByTagName( 'fck:customcontent' ) and that didn't work either.
Anyone have any idea why this is?
Thanks in advance
Re: fck document processor and FCKDocumentProcessor_CreateFakeIm