Hi,
real time syntax highlighting editors are still missing on the web and would be quite usefull sometimes e.g for wikis. The only editor I know is http://codepress.org/ which does not work correctly and is quite immature. Idea: Why not reuse some basic functionalty of FCK editor and develop also some syntax highlighting mode? Just a vague idea. But I think most of the code needed for such a project might be already there in FCK..
All the best!
Heinz
Thu, 01/31/2008 - 21:33
#1
Re: Enhance FCK-Editor to a real time syntax highlighting editor
see ticket http://dev.fckeditor.net/ticket/612
Re: Enhance FCK-Editor to a real time syntax highlighting editor
I was able to do this very quickly (and maybe a little bit dirty) by using editArea - http://www.cdolivet.net/editarea/
Here is what I did to get this to work with FCKEditor
Step One:
Modify your "<path to fckeditor>/fckconfig.js" file so that the following line is true. The embeded source code editor will not work for this method. There may be some way to get it to work, however, I didn't spend enough time to figure it out.
Re: Enhance FCK-Editor to a real time syntax highlighting editor
One note, for IE7 we had to change the WIDTH:100% in the textarea style near the bottom of fck_source.html to a fixed width.
Otherwise, it seems to work great!!
Thanks again!
- Bill
Re: Enhance FCK-Editor to a real time syntax highlighting editor
Hi All,
I evaluated CodePress and other 9 JavaScript source code editors and I posted the results at http://en.wikipedia.org/wiki/Comparison ... de_editors
At the moment, it seems that Codemirror is the most promising editor, because of its mixed mode syntax (the ability to handle more than one syntax per file, e.g. HTML + JavaScript + CSS) and because it can be extended with tokenizers for parsing other languages. I'm currently working on a PHP parser.
Hope that helps,
Dan Dascalescu
Re: Enhance FCK-Editor to a real time syntax highlighting editor
I basically just added two lines to the onload function that gets the size of the window and resizes the textarea appropriately.
The original code:
The changed code:
I have only tested this in FF 3.5 and IE 8, but they both appeared to work correctly and I have used something similar in other browsers, so I am confident enough to offer this up as an alternative to the fixed width issue.
didn't check to see if this was posted elsewhere, sorry if it is.