[xwiki-devs] GWT RichTextArea questions
Hello, I'm experimenting with the RichTextArea (RTA) in a separate application, not in XWiki. I checked out the xwiki-gwt-dom and xwiki-gwt-user, and RTA seems to work well. (Until now I've created only a small demo application, with an RTA and some buttons to execute various commands.) My questions are: 1. Pressing ENTER creates a BR element by default, is it possible to create a P instead? (The behaviour of the ENTER key inside a P can be set by executing the insertbronreturn command, but the default document always contains a BR, and if I set the initial content to <p></p>, I cannot navigate the cursor inside the P...) 2. Is there a way to listen to selection events? (I want to enable/disable some buttons based on the current selection.) 3. Are there any extensions to the default RTA in the other parts of XWiki? (I mean for example commands and controls for editing TABLEs visually, toolbars that are enabled/disabled based on the content of the RTA, etc. - I haven't looked at all the source code yet, it's huge :) That's for a starter :) Thanks for your help in advance! Best regards: -- Norbert Sándor http://jvminside.blogspot.com/
On 01/29/2010 09:46 PM, Norbert Sándor wrote:
Hello,
I'm experimenting with the RichTextArea (RTA) in a separate application, not in XWiki.
Hi Norbert, That is great, we've been waiting for other applications to try and integrate the editor, since so far only in theory can it be reused by external applications, nobody tried it. We hope that this goes smoothly and nothing serious prevents the integration, and we'll help each other to fix any issues.
I checked out the xwiki-gwt-dom and xwiki-gwt-user, and RTA seems to work well. (Until now I've created only a small demo application, with an RTA and some buttons to execute various commands.)
We'd appreciate some feedback for this, like how much time did you spend so far, do you think it was easy or not to go this far, is the documentation good enough? I'm not a developer of the WYSIWYG, so I won't be able to answer your questions, but Marius will help you as soon as he can.
My questions are:
1. Pressing ENTER creates a BR element by default, is it possible to create a P instead? (The behaviour of the ENTER key inside a P can be set by executing the insertbronreturn command, but the default document always contains a BR, and if I set the initial content to<p></p>, I cannot navigate the cursor inside the P...)
2. Is there a way to listen to selection events? (I want to enable/disable some buttons based on the current selection.)
3. Are there any extensions to the default RTA in the other parts of XWiki? (I mean for example commands and controls for editing TABLEs visually, toolbars that are enabled/disabled based on the content of the RTA, etc. - I haven't looked at all the source code yet, it's huge :)
That's for a starter :) Thanks for your help in advance!
Best regards: -- Norbert Sándor
I looked at your blog, and I saw this entry which I think we could benefit from in our build, since compiling the GWT code is the most resource consuming step in the build, except for running the integration tests. Marius, could you take a look at http://jvminside.blogspot.com/2010/01/gwt-2-debugging-and-compiling-faq.html I think that -XdisableCastChecking will improve runtime performance, and -draftCompile could be used in the default build profile for faster compile.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi Sergiu, Sergiu Dumitriu wrote:
On 01/29/2010 09:46 PM, Norbert Sándor wrote:
Hello,
I'm experimenting with the RichTextArea (RTA) in a separate application, not in XWiki.
Hi Norbert,
That is great, we've been waiting for other applications to try and integrate the editor, since so far only in theory can it be reused by external applications, nobody tried it. We hope that this goes smoothly and nothing serious prevents the integration, and we'll help each other to fix any issues.
I checked out the xwiki-gwt-dom and xwiki-gwt-user, and RTA seems to work well. (Until now I've created only a small demo application, with an RTA and some buttons to execute various commands.)
We'd appreciate some feedback for this, like how much time did you spend so far, do you think it was easy or not to go this far, is the documentation good enough?
I'm not a developer of the WYSIWYG, so I won't be able to answer your questions, but Marius will help you as soon as he can.
My questions are:
1. Pressing ENTER creates a BR element by default, is it possible to create a P instead? (The behaviour of the ENTER key inside a P can be set by executing the insertbronreturn command, but the default document always contains a BR, and if I set the initial content to<p></p>, I cannot navigate the cursor inside the P...)
2. Is there a way to listen to selection events? (I want to enable/disable some buttons based on the current selection.)
3. Are there any extensions to the default RTA in the other parts of XWiki? (I mean for example commands and controls for editing TABLEs visually, toolbars that are enabled/disabled based on the content of the RTA, etc. - I haven't looked at all the source code yet, it's huge :)
That's for a starter :) Thanks for your help in advance!
Best regards: -- Norbert Sándor
I looked at your blog, and I saw this entry which I think we could benefit from in our build, since compiling the GWT code is the most resource consuming step in the build, except for running the integration tests.
Marius, could you take a look at http://jvminside.blogspot.com/2010/01/gwt-2-debugging-and-compiling-faq.html
I think that -XdisableCastChecking will improve runtime performance, and
2.2M2 release was built with -XdisableCastChecking on. The result is that the size of the generated code is a bit smaller and the number of method calls triggered by each key press is reduced (still around 6500 though with all the plugins enabled, which take up to 50 milliseconds).
-draftCompile could be used in the default build profile for faster compile.
I haven't noticed any compilation speed improvements with this flag when building only one permutation (e.g. FF3+en). Still around 50 seconds. Marius
Hello,
We'd appreciate some feedback
I worked with the trunk versions of xwiki-gwt-dom and xwiki-gwt-user. After checking them out, I slightly modified their poms (eg. removed the parent declaration), then I could use them in my small example project without problems. I have much more difficulties with xwiki-web-wysiwyg, it seems to be more tightly coupled with xwiki functionalities. It's sad because the RichTextEditor and the plugin system would be very useful in external projects as well. If you would split it to two projects, with the RichTextEditor and the plugin system in one of them, the resulting code base would be very well usable in external project as well. And seeing what you have already developed, it's a waste (in the good sense of meaning of course :) that this great editor is used only in xwiki. For example I think that many Java projects that use fckeditor (some of my projects as well) would happily switch to a gwt-based editor (and a cleaner Java-based plugin system). But I understand that it would need much work to support additional external requirements... Best regards: Norbi 2010.01.30. 6:03 keltezéssel, Sergiu Dumitriu írta:
On 01/29/2010 09:46 PM, Norbert Sándor wrote:
Hello,
I'm experimenting with the RichTextArea (RTA) in a separate application, not in XWiki.
Hi Norbert,
That is great, we've been waiting for other applications to try and integrate the editor, since so far only in theory can it be reused by external applications, nobody tried it. We hope that this goes smoothly and nothing serious prevents the integration, and we'll help each other to fix any issues.
I checked out the xwiki-gwt-dom and xwiki-gwt-user, and RTA seems to work well. (Until now I've created only a small demo application, with an RTA and some buttons to execute various commands.)
We'd appreciate some feedback for this, like how much time did you spend so far, do you think it was easy or not to go this far, is the documentation good enough?
I'm not a developer of the WYSIWYG, so I won't be able to answer your questions, but Marius will help you as soon as he can.
My questions are:
1. Pressing ENTER creates a BR element by default, is it possible to create a P instead? (The behaviour of the ENTER key inside a P can be set by executing the insertbronreturn command, but the default document always contains a BR, and if I set the initial content to<p></p>, I cannot navigate the cursor inside the P...)
2. Is there a way to listen to selection events? (I want to enable/disable some buttons based on the current selection.)
3. Are there any extensions to the default RTA in the other parts of XWiki? (I mean for example commands and controls for editing TABLEs visually, toolbars that are enabled/disabled based on the content of the RTA, etc. - I haven't looked at all the source code yet, it's huge :)
That's for a starter :) Thanks for your help in advance!
Best regards: -- Norbert Sándor
I looked at your blog, and I saw this entry which I think we could benefit from in our build, since compiling the GWT code is the most resource consuming step in the build, except for running the integration tests.
Marius, could you take a look at http://jvminside.blogspot.com/2010/01/gwt-2-debugging-and-compiling-faq.html
I think that -XdisableCastChecking will improve runtime performance, and -draftCompile could be used in the default build profile for faster compile.
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2655 - Release Date: 01/29/10 10:08:00
On 01/31/2010 04:32 PM, Norbert Sándor wrote:
Hello,
We'd appreciate some feedback
I worked with the trunk versions of xwiki-gwt-dom and xwiki-gwt-user. After checking them out, I slightly modified their poms (eg. removed the parent declaration), then I could use them in my small example project without problems.
I have much more difficulties with xwiki-web-wysiwyg, it seems to be more tightly coupled with xwiki functionalities. It's sad because the RichTextEditor and the plugin system would be very useful in external projects as well. If you would split it to two projects, with the RichTextEditor and the plugin system in one of them, the resulting code base would be very well usable in external project as well. And seeing what you have already developed, it's a waste (in the good sense of meaning of course :) that this great editor is used only in xwiki. For example I think that many Java projects that use fckeditor (some of my projects as well) would happily switch to a gwt-based editor (and a cleaner Java-based plugin system). But I understand that it would need much work to support additional external requirements...
Well, external usage was a goal from the start, so we tried to make it as easy as possible (and as allowed by time constrains) to reuse all or just parts of the editor. Some plugins are tightly linked to XWiki, like the macro or link dialogs, while others could be generic, like the improved handling of basic formatting. So far, since XWiki was the only user and developer of the editor, the main goal was to make it work for our needs, while the reusability was left as a secondary goal. The larger the community around the editor, the better it would be. So spreading the word about it to other projects would be good, something we haven't been doing so well so far. By the way, how did you find out about it? -- Sergiu Dumitriu http://purl.org/net/sergiu/
By the way, how did you find out about it?
I was looking for range and selection API support for the GWT RTA. If I remember well then I found the XWiki SVN by googling around, but it wasn't easy :) (rocket-gwt has some selection support as well (http://code.google.com/p/rocket-gwt/wiki/Selections), but that project does not seem to be as active as XWiki.) I plan to write a blog entry about my experiences with the XWiki RTA - if you don't mind. -- Norbi 2010.01.31. 17:35 keltezéssel, Sergiu Dumitriu írta:
On 01/31/2010 04:32 PM, Norbert Sándor wrote:
Hello,
We'd appreciate some feedback
I worked with the trunk versions of xwiki-gwt-dom and xwiki-gwt-user. After checking them out, I slightly modified their poms (eg. removed the parent declaration), then I could use them in my small example project without problems.
I have much more difficulties with xwiki-web-wysiwyg, it seems to be more tightly coupled with xwiki functionalities. It's sad because the RichTextEditor and the plugin system would be very useful in external projects as well. If you would split it to two projects, with the RichTextEditor and the plugin system in one of them, the resulting code base would be very well usable in external project as well. And seeing what you have already developed, it's a waste (in the good sense of meaning of course :) that this great editor is used only in xwiki. For example I think that many Java projects that use fckeditor (some of my projects as well) would happily switch to a gwt-based editor (and a cleaner Java-based plugin system). But I understand that it would need much work to support additional external requirements...
Well, external usage was a goal from the start, so we tried to make it as easy as possible (and as allowed by time constrains) to reuse all or just parts of the editor. Some plugins are tightly linked to XWiki, like the macro or link dialogs, while others could be generic, like the improved handling of basic formatting. So far, since XWiki was the only user and developer of the editor, the main goal was to make it work for our needs, while the reusability was left as a secondary goal. The larger the community around the editor, the better it would be. So spreading the word about it to other projects would be good, something we haven't been doing so well so far. By the way, how did you find out about it?
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2659 - Release Date: 01/31/10 07:39:00
Hi Norbert, Norbert Sándor wrote:
Hello,
We'd appreciate some feedback
I worked with the trunk versions of xwiki-gwt-dom and xwiki-gwt-user. After checking them out, I slightly modified their poms (eg. removed the parent declaration), then I could use them in my small example project without problems.
I have much more difficulties with xwiki-web-wysiwyg, it seems to be more tightly coupled with xwiki functionalities. It's sad because the RichTextEditor and the plugin system would be very useful in external projects as well. If you would split it to two projects, with the RichTextEditor and the plugin system in one of them, the resulting code base would be very well usable in external project as well. And seeing what you have already developed, it's a waste (in the good sense of meaning of course :) that this great editor is used only in xwiki. For example I think that many Java projects that use fckeditor (some of my projects as well) would happily switch to a gwt-based editor (and a cleaner Java-based plugin system). But I understand that it would need much work to support additional external requirements...
I'll send a proposal for splitting the wysiwyg module in order to make the editor reusable outside XWiki. Thanks a lot for your feedback! Marius
Best regards: Norbi
2010.01.30. 6:03 keltezéssel, Sergiu Dumitriu írta:
On 01/29/2010 09:46 PM, Norbert Sándor wrote:
Hello,
I'm experimenting with the RichTextArea (RTA) in a separate application, not in XWiki.
Hi Norbert,
That is great, we've been waiting for other applications to try and integrate the editor, since so far only in theory can it be reused by external applications, nobody tried it. We hope that this goes smoothly and nothing serious prevents the integration, and we'll help each other to fix any issues.
I checked out the xwiki-gwt-dom and xwiki-gwt-user, and RTA seems to work well. (Until now I've created only a small demo application, with an RTA and some buttons to execute various commands.)
We'd appreciate some feedback for this, like how much time did you spend so far, do you think it was easy or not to go this far, is the documentation good enough?
I'm not a developer of the WYSIWYG, so I won't be able to answer your questions, but Marius will help you as soon as he can.
My questions are:
1. Pressing ENTER creates a BR element by default, is it possible to create a P instead? (The behaviour of the ENTER key inside a P can be set by executing the insertbronreturn command, but the default document always contains a BR, and if I set the initial content to<p></p>, I cannot navigate the cursor inside the P...)
2. Is there a way to listen to selection events? (I want to enable/disable some buttons based on the current selection.)
3. Are there any extensions to the default RTA in the other parts of XWiki? (I mean for example commands and controls for editing TABLEs visually, toolbars that are enabled/disabled based on the content of the RTA, etc. - I haven't looked at all the source code yet, it's huge :)
That's for a starter :) Thanks for your help in advance!
Best regards: -- Norbert Sándor
I looked at your blog, and I saw this entry which I think we could benefit from in our build, since compiling the GWT code is the most resource consuming step in the build, except for running the integration tests.
Marius, could you take a look at http://jvminside.blogspot.com/2010/01/gwt-2-debugging-and-compiling-faq.html
I think that -XdisableCastChecking will improve runtime performance, and -draftCompile could be used in the default build profile for faster compile.
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2655 - Release Date: 01/29/10 10:08:00
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi Norbert, Norbert Sándor wrote:
Hello,
I'm experimenting with the RichTextArea (RTA) in a separate application, not in XWiki. I checked out the xwiki-gwt-dom and xwiki-gwt-user, and RTA seems to work well. (Until now I've created only a small demo application, with an RTA and some buttons to execute various commands.)
Cool!
My questions are:
1. Pressing ENTER creates a BR element by default, is it possible to create a P instead?
AFAIK there's no built-in command (like insertbronreturn) to trigger this behavior. We have written a RTA plugin for this, which you can find at http://tinyurl.com/yacr2l8 . All RTA plugins are for the moment in platform/web/wysiwyg module. The line plugin is pretty much generic so you could try to reuse it.
(The behaviour of the ENTER key inside a P can be set by executing the insertbronreturn command, but the default document always contains a BR, and if I set the initial content to <p></p>, I cannot navigate the cursor inside the P...)
You can place the caret inside the empty paragraph using the selection API but you have to make sure the user can't leave the body element empty (e.g. in Firefox if the user selects all content and deletes it you're back to the initial BR).
2. Is there a way to listen to selection events? (I want to enable/disable some buttons based on the current selection.)
Unfortunately no. AFAIK only IE has a native event for selection change. We overcome this by listening to key up, mouse up and command events on the RTA. You can take a look at http://tinyurl.com/yas4fxn . AbstractStatefulPlugin listens to this events and schedules updates of its state using a DeferredUpdater (only the most recent update is executed). In our editor we adopted this strategy: each plugin is responsible for updating its state (e.g. detect bold style) and the editor is responsible to enabling/disabling features based on some rules.
3. Are there any extensions to the default RTA in the other parts of XWiki? (I mean for example commands and controls for editing TABLEs visually, toolbars that are enabled/disabled based on the content of the RTA, etc. - I haven't looked at all the source code yet, it's huge :)
platform/web/wysiwyg module contains plugins built on top of the RTA (from xwiki-gwt-user module) and they use the DOM and Selection API from xwiki-gwt-dom module. Some of the plugins overwrite the default RTA commands with their improved version. For instance TextPlugin ( http://tinyurl.com/y8eoh2f ) registers custom executables for default RTA command like bold and italic. In the same way FormatPlugin overwrites the removeformat command. Most of this plugins are generic. Some are XWiki specific: link, image, import and macro. We have a table plugin, but it offers basic features like insert row after or delete column. Hope this helps. Marius
That's for a starter :) Thanks for your help in advance!
Best regards: -- Norbert Sándor http://jvminside.blogspot.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Thanks for the answers! Regards: Norbi 2010.01.30. 11:46 keltezéssel, Marius Dumitru Florea írta:
Hi Norbert,
Norbert Sándor wrote:
Hello,
I'm experimenting with the RichTextArea (RTA) in a separate application, not in XWiki. I checked out the xwiki-gwt-dom and xwiki-gwt-user, and RTA seems to work well. (Until now I've created only a small demo application, with an RTA and some buttons to execute various commands.)
Cool!
My questions are:
1. Pressing ENTER creates a BR element by default, is it possible to create a P instead?
AFAIK there's no built-in command (like insertbronreturn) to trigger this behavior. We have written a RTA plugin for this, which you can find at http://tinyurl.com/yacr2l8 . All RTA plugins are for the moment in platform/web/wysiwyg module. The line plugin is pretty much generic so you could try to reuse it.
(The behaviour of the ENTER key inside a P can be set by executing the insertbronreturn command, but the default document always contains a BR, and if I set the initial content to<p></p>, I cannot navigate the cursor inside the P...)
You can place the caret inside the empty paragraph using the selection API but you have to make sure the user can't leave the body element empty (e.g. in Firefox if the user selects all content and deletes it you're back to the initial BR).
2. Is there a way to listen to selection events? (I want to enable/disable some buttons based on the current selection.)
Unfortunately no. AFAIK only IE has a native event for selection change. We overcome this by listening to key up, mouse up and command events on the RTA. You can take a look at http://tinyurl.com/yas4fxn . AbstractStatefulPlugin listens to this events and schedules updates of its state using a DeferredUpdater (only the most recent update is executed). In our editor we adopted this strategy: each plugin is responsible for updating its state (e.g. detect bold style) and the editor is responsible to enabling/disabling features based on some rules.
3. Are there any extensions to the default RTA in the other parts of XWiki? (I mean for example commands and controls for editing TABLEs visually, toolbars that are enabled/disabled based on the content of the RTA, etc. - I haven't looked at all the source code yet, it's huge :)
platform/web/wysiwyg module contains plugins built on top of the RTA (from xwiki-gwt-user module) and they use the DOM and Selection API from xwiki-gwt-dom module. Some of the plugins overwrite the default RTA commands with their improved version. For instance TextPlugin ( http://tinyurl.com/y8eoh2f ) registers custom executables for default RTA command like bold and italic. In the same way FormatPlugin overwrites the removeformat command. Most of this plugins are generic. Some are XWiki specific: link, image, import and macro.
We have a table plugin, but it offers basic features like insert row after or delete column.
Hope this helps. Marius
That's for a starter :) Thanks for your help in advance!
Best regards: -- Norbert Sándor http://jvminside.blogspot.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2655 - Release Date: 01/29/10 10:08:00
participants (3)
-
Marius Dumitru Florea -
Norbert Sándor -
Sergiu Dumitriu