Hello all,
I am working on upgrading from 2.x to 3.x for our web application (http://archon.org), and I had previously edited FCKEditor to string replace BBCode and update the related textarea before we submitted via Ajax (using a jQuery form plugin).
Now, the relevant code that I found before was:
for (var i = 0; i < parent.frames.length; ++i ) if ( parent.frames[i].FCK ) parent.frames[i].FCK.UpdateLinkedField();
I can't seem to figure out how to do this now. Is there an equivalent for UpdateLinkedField()?
Also, as for the BBCode, I created a custom config file that redefined the FCK.DataProcessor. Here's an excerpt:
FCK.DataProcessor = { ConvertToHtml : function( data ) { ... // [url] data = data.replace( /\[url\](.+?)\[\/url]/gi, '<a href="$1">$1</a>' ) ; data = data.replace( /\[url\=([^\]]+)](.+?)\[\/url]/gi, '<a href="$1">$2</a>' ) ; ... return '<html><head><title></title></head><body>' + data + '</body></html>' ; }, ConvertToDataFormat : function( rootNode, excludeRoot, ignoreIfEmptyParagraph, format ) { ... // [url] data = data.replace( /<a .*?href=(["'])(.+?)\1.*?>(.+?)<\/a>/gi, '[url=$2]$3[/url]') ; ... return data ; }, ... } ;
I was looking into where I could re-implement this, and I think I would need to edit the CKEDITOR.htmlParser() but I don't know how I would go about doing this within the CKEDITOR code.
Can anyone point me in the right direction?
Thanks,
Paul
Re: Need help with equivalent to updateLinkedEditor and BBCode
This is run right before submitting the form via ajax. So now the only remaining issue is where to edit the CKEditor to add the BBCode support.