Hi,
I am developing an IDE for XUL applications and am in the process of
developing a syntax colored editor for javascript. I was wondering if
there is any way to re-use the editor component? I don't want to do any
development in C++, only Javascript.
I tokenize the Javascript into reserved words, operators etc. and then
build a DOM using html div and span elements with appropriate class
attributes to supply token color.
I can display this quite nicely in an XUL box. However, no editing!
I would like to use the editor component but I can find no way to
initialize the editor with an existing DOM, The only load method I can
find in EditorShell only takes a url parameter and the nsDOMDocument
attribute is readonly. A hook to re-serialize the DOM on exit would also
be useful.
I would have to deal with DOM restructuring as the user types. I think
this aspect is already covered. I believe the current hard coded html
rules would suffice as I would not introduce any new element types.
Eventually I would like to display breakpoints from the within the
editor and to have live links in the source code as a documentation aid.
This approach, if it can be made to work, could be used by any document
type.
I understand that an generalized XML editor is under contemplation - any
information on how/when etc.?
Regards
Peter Wilson