Hi David,
You can create a JavaScript extension [1] that listens to the
xwiki:wysiwyg:loaded event [2] and sets the content of the
corresponding rich text area using the WYSIWYG editor API [3],
precisely:
editor.getCommandManager().execute('reset', 'some HTML fragment');
Hope this helps,
Marius
[1]
http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial#HMinimalJavaScripteXtension
[2]
http://extensions.xwiki.org/xwiki/bin/view/Extension/WYSIWYG+Editor+Module#HCustomevents
[3]
http://extensions.xwiki.org/xwiki/bin/view/Extension/WYSIWYG+Editor+Module#HWysiwygEditor
On Sun, Mar 18, 2012 at 7:48 AM, du du <[email protected]> wrote:
> Hi, Andrey, Thanks for your response, so just think it as taking an image
> url from another site or a database table and you need to insert the image
> into the inline form of the blog post inline editor programmatically when
> the inline form shows up, how would you do that? I checked the
> XWikiwysiwyg.js file, it will be called before the inline form editor shows
> up, so this could be a good place to add code, if you have any idea, please
> let me know.
>
> Thanks again
>
> David
>
>
> On Sat, Mar 17, 2012 at 6:15 PM, Andrey Mavrin
> <[email protected]>wrote:
>
>> 2012/3/17 du du <[email protected]>
>>
>> > Hi, all,
>> > I am playing around with the blog post application, when users click the
>> > create post button, it brings up the inline form for users to put text
>> in,
>> > I have another requirement, we need to write some velocity code somewhere
>> > to retrieve an image url from a database, so when the inline form shows
>> up
>> > after users click create post button, the image automatically shows up in
>> > the inline form, users then type in more text, my question is where
>> should
>> > I put the code in? also the BlogPostClass and BlogPostTemplate have
>> > TextArea objects, which create GWT inline form, this is where I need to
>> put
>> > image in programmatically, so I am thinking about accessing the GWT code
>> to
>> > insert image, could anybody point me to the right direction about how to
>> > approach this to put image into the inline form programmatically?
>> > Thanks
>> > David
>> > _______________________________________________
>> > devs mailing list
>> > [email protected]
>> > http://lists.xwiki.org/mailman/listinfo/devs
>> >
>>
>> I really like the idea, and I would like to undertake it, as I think about
>> what the user chose the location for pictures and text
>>
>> well I'm wondering whether your application to take the results from
>> another site? For example, if two sites have the same polls, if they can
>> share information?
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users