Hi, Marius,

Thanks very much, I will follow your instruction.

Dave

On Sat, Apr 28, 2012 at 5:28 AM, Marius Dumitru Florea <
mariusdumitru.flo...@xwiki.com> wrote:

> On Sat, Apr 28, 2012 at 5:23 AM, Geo Du <ddd...@gmail.com> wrote:
> > Hi, Marius,
> >
>
> > I looked at the source code, and downloaded the whole 4.1 source code zip
>
> You should clone/fork https://github.com/xwiki/xwiki-platform instead
> and then create a branch based on the tag corresponding to the version
> of XWiki Enterprise you're using (i.e. checkout xwiki-platform-3.5 tag
> and then create a branch from it where you make your changes).
>
> Unfortunately you can't add your new feature without modifying a bit
> the code of the WYSIWYG editor, but it should be pretty easy to merge
> your changes automatically with Git when you upgrade to a new version
> of XWiki Enterprise.
>
> In your branch, you can either modify the existing image plugin or
> extend it in a new plugin (kept inside
>
> xwiki-platform/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-client
> under org.xwiki.gwt.wysiwyg.client.plugin package).
>
> > file, it seems like I need to change the source code in the plugin.image
> > package, but I am using the 3.5 version stable release, I can see these
> two
> > jar files have WYSIWYG editor:
> > xwiki-platform-wysiwyg-client-3.5-shared.jar,
> > xwiki-platform-legacy-oldcore-3.5.jar, so I have to either change code
> for
>
> Note that the editor has a client side and a server side. If you
> modify the server side it's enough to rebuild the
> xwiki-platform-wysiwyg-server jar and overwrite the one from your XE's
> WEB-INF/lib folder. If you modify the client side then you must
> rebuild xwiki-platform-wysiwyg-client and then
> xwiki-platform-wysiwyg-war and replace resources/js/xwiki/wysiwyg/xwe
> folder from XE with the one from the generated war.
>
> > 3.5 version, or upgrade my deployment to 4.1 with my new image handling
>
> The editor version should match the XE version.
>
> > code for addComment tool, also If I change the original source code, in
> the
> > future if we need upgrade to new xwiki release, we need to merge the
> > addComment tool again, so what is the best way to do that? is there a way
>
> As I said above, using Git you should be able to automatically merge
> your changes most of the time.
>
> > to add the tool by coding in javascript without touching the gwt plugin
>
> You could try, see the JavaScript API exposed by the WYSIWYG editor
>
> http://extensions.xwiki.org/xwiki/bin/view/Extension/WYSIWYG+Editor+Module#HJavaScriptAPI
> .
>
> > java code, or write java code by extending ImagePlugin with new method to
>
> It's not that easy because when we wrote the image plugin we didn't
> thought to much of how it could be extended. Some methods are private
> and some are hard to extends. But still, you can try.
>
> Hope this helps,
> Marius
>
> > add comment, and then built into a new Jar.
> >
> > Thanks for your response again.
> >
> > Dave
> >
> > On Fri, Apr 6, 2012 at 7:17 PM, du du <ddd...@gmail.com> wrote:
> >
> >> Ok, thanks very much for your help.
> >> Dave
> >>
> >>
> >> On Fri, Apr 6, 2012 at 6:50 AM, Marius Dumitru Florea <
> >> mariusdumitru.flo...@xwiki.com> wrote:
> >>
> >>> On Fri, Apr 6, 2012 at 1:49 AM, du du <ddd...@gmail.com> wrote:
> >>> > Hi, all,
> >>> >
> >>> > I am trying to add an addComments sub-menu item to image button from
> the
> >>> > menu bar of WYSIWYG editor, what it does is to add comments for an
> image
> >>> > inserted in the editor because I need to explain what each image is
> >>> about
> >>> > after I put it in the editor, I checked the
> >>> > class:XWiki.WysiwygEditorConfigClass and the wysiwyg.js, I added a
> >>> > sub-menu in
> >>> > the WysiwygEditorConfigClass for image menu, but after that, I got
> lost,
> >>> > this sub-menu button is supposed to connect to a plugin to trigger
> java
> >>> to
> >>> > run I believe since it is a plugin and each sub-menu like
> >>> > imageInsertAttached, imageInsertURL is a plugin, but I could not find
> >>> the
> >>> > code where it calls a plugin, so how is the sub-menu button hooked to
> >>> the
> >>> > plugin? when a user clicks on the submenu button in the editor
> (inline
> >>> > form) page, which javascript function gets called?
> >>>
> >>> You can find here
> >>>
> >>>
> https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-wysiwyg
> >>> the code of the WYSIWYG content editor. For instance, the image
> >>> plugin, which handles the image menu, is located here
> >>>
> >>>
> https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-client/src/main/java/org/xwiki/gwt/wysiwyg/client/plugin/image
> >>> . The actual code that fills the image menu is
> >>>
> >>>
> https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-client/src/main/java/org/xwiki/gwt/wysiwyg/client/plugin/image/ImageMenuExtension.java
> >>> .
> >>>
> >>> You should know that the WYSIWYG content editor is written using
> >>> Google WebToolkit (GWT). The Java code is compiled into JavaScript at
> >>> build time.
> >>>
> >>> Hope this helps,
> >>> Marius
> >>>
> >>> >
> >>> > Thanks very much in advance!!
> >>> >
> >>> > Dave
> >>> > _______________________________________________
> >>> > users mailing list
> >>> > users@xwiki.org
> >>> > http://lists.xwiki.org/mailman/listinfo/users
> >>> _______________________________________________
> >>> users mailing list
> >>> users@xwiki.org
> >>> http://lists.xwiki.org/mailman/listinfo/users
> >>>
> >>
> >>
> > _______________________________________________
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to