Yeap, building on WikiEditor stuff is always a good idea!
Though, in my experience with the InlineEditor extension, it's quite hard if you want
to build a totally different interface. It would be awesome to refactor EditPage sometime
to make this easier, and to provide a nice preference with a drop-down to select an
editing interface. The relevant bug is 26918 [1] (which has actually been created because
of a comment by yourself, Brion :))
The way I solved this was to create a subclass of EditPage with just enough code
copy/pasted to suit my needs ;) [2]. For the API some hacking in EditPage has been done,
and the class description also talks about a possible refactoring of EditPage [3].
Anyway, just a thought for the backend part of an alternate/remote editor API, for
extensions that want to do more than replacing the textbox. :)
Cheers, Jan Paul
[1]
On Fri, May 6, 2011 at 11:20 AM, Trevor Parscal
<tparscal(a)wikimedia.org>wrote;wrote:
The way the WikiEditor works right now, the
textbox can be replaced with
anything that can support a few methods, such as getSelection,
encapsulateSelection, etc. There are some modules that depend on specific
edit box implementations, such as the current and only alternative to the
textarea we called "iframe" since it's a contentEditable iframe.
If you take a look at jquery.wikiEditor.iframe.js, you will see what I
mean.
It should be pretty straightforward to drop anything in there, and be able
to take advantage of the toolbar. There are some things, like find and
replace that may need to be reworked or just turned off, but even things
like the link dialog should work just fine but just supporting a few
methods.
The API could be better documented, and re-factored a bit to be even more
generic, but the basic structure is there, and can be reused without much
hacking.
Spiffy... I'll play with it for CodeEditor, see if I can make the
special-char inserts for instance work on it (which would actually be useful
for some JS!).
-- brion
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l