Try the fastest and simplest way to install ONLYOFFICE

Plugin: Insert text at cursor position

Integration questions/issues

Plugin: Insert text at cursor position

Postby mmeyer » Fri Feb 23, 2018 8:28 am

I am writing a plugin that allows the user to insert an address.

When the user selects an address it should be inserted at the current cursor position.
The address is an array of strings. Each string should be placed on a new line.

How can this be accomplished?

When trying the oParagraph.addText() approach from the helloworld example the text is always inserted flush left.
(https://api.onlyoffice.com/plugin/example)

The symboltable example seems to consider the cursor position but uses an un-documented function called "PasteHtml".
(https://github.com/ONLYOFFICE/sdkjs-plu ... oltable.js)

Regards,
M. Meyer
mmeyer
 
Posts: 9
Joined: Fri Feb 23, 2018 8:21 am

Re: Plugin: Insert text at cursor position

Postby Maxim » Mon Mar 05, 2018 9:45 am

Hello mmeyer!
When trying the oParagraph.addText() approach from the helloworld example the text is always inserted flush left.

Please use oParagraph.addText() but it's not necessary to add whole text via one command.
The symboltable example seems to consider the cursor position but uses an un-documented function called "PasteHtml".

Yes, it's not documented yet. We will but you can use it - insert content in html format "PasteHtml".
Maxim
 
Posts: 1747
Joined: Tue Oct 11, 2016 2:34 pm

Re: Plugin: Insert text at cursor position

Postby tommycrestanello » Tue Sep 18, 2018 10:48 am

I post here another answer for the same topic:

Insert text at cursor position is possible via API with drag & drop event?
tommycrestanello
 
Posts: 4
Joined: Tue Sep 18, 2018 10:40 am

Re: Plugin: Insert text at cursor position

Postby Carl » Fri Sep 21, 2018 11:58 am

Hello,

unfortunately, text insertion via drag&drop is not supported.
Carl
 
Posts: 92
Joined: Thu Apr 12, 2018 10:00 am


Return to Plugins

Who is online

Users browsing this forum: No registered users and 0 guests

cron