Hi, @Vincent Thanks for the information!
@Marius I put down a rough design for this here http://dev.xwiki.org/xwiki/bin/view/Design/WYSIWYGPluginInterface <http://dev.xwiki.org/xwiki/bin/view/Design/WYSIWYGPluginInterface> . It includes some code-snippets of a prototype I got working. There are some comments/inline comments - hope it's handleable. I didn't go to far with the design proposal, because I wanted to come clear with you first, that this is the right way. Also I wanted to discuss the "interface" for the JavaScript plugins. What do you think a plugin should can do? Please let me also know what you think about the naming of the classes, etc. Thanks and regards, Josef vmassol wrote > Hi, > > Just FTR Marius is on holidays till the end of the week… ;) > > Thanks > -Vincent > > On Aug 23, 2013, at 1:24 PM, jhaimerl < > Josef.Haimerl@ > > wrote: > >> Hi Marius, >> >> I'm back on working on this. Maybe you can help me getting-in and tell me >> something about this mechanism (http://snag.gy/OVUoR.jpg). How are the >> plugins published at this point? >> >> I set up eclipse to debug the java code with the browser gwt dev plugin. >> Maybe it could be useful for someone, would you like that I document it >> somewhere? >> >> >> Marius Dumitru Florea wrote >>> Hi Richard, >>> >>> On Thu, Jun 6, 2013 at 9:02 AM, rhierlmeier < >> >>> rhierlmeier@ >> >>> > 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 > > _______________________________________________ > devs mailing list > devs@ > http://lists.xwiki.org/mailman/listinfo/devs -- View this message in context: http://xwiki.475771.n2.nabble.com/Adding-a-customer-plugin-to-the-wysiwyg-editor-tp7585599p7586853.html Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

