Hi Richard,
On Thu, Jun 6, 2013 at 9:02 AM, rhierlmeier <rhierlmeier(a)googlemail.com> wrote:
Hi,
we studied the source code of the gwt wysiwyg editor but we found no
official way to integrate an custom plugin.
Yes, right now all the plugins are written in Java (GWT) and adding a
new plugin requires rebuilding the editor. We've been wanting to add
support for (dynamic) JavaScript plugins for some time but we didn't
because we focused on other things.
We have the impression that it should be relatively easy to establish a
public API for registering customer plugins.
The customer plugin would be delivered as javascript code with a global
javascript function that implements PluginFactory interface.
The WysiwygEditorConfigClass would have an addition property
customerPlugins, containing a comma seperate list of strings of the
PluginFactory method names.
Do you think that this is doable?
Yes. I would write a generic JavaScriptPluginFactory (implementing
PluginFactory) and JavaScriptPlugin (implementing Plugin) to serve as
a bridge between GWT and plugins written in native JavaScript.
WysiwygEditorFactory would then iterate the list of JavaScript plugin
names and create a JavaScriptPluginFactory instance for each, passing
the name. The factory would simply create a new JavaScriptPlugin
instance, forwarding the name. The plugin would access the global
JavaScript variable with the given name and take from it the data
needed to implement the Plugin interface. Of course, you need to
define an "interface" for the JavaScript plugins, and they have to bee
able to add event listeners like a GWT plugin.
A contribution on this topic would be more than welcomed.
Thanks,
Marius
Regards
Richard
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Adding-a-customer-plugin-to-the-wysiwyg-e…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs