SwellRT / swellrt

SwellRT main project. Server, JavaScript and Java clients
http://swellrt.org/
Apache License 2.0
233 stars 34 forks source link

How to activate annotations from the current caret positions #245

Closed emcodemall closed 6 years ago

emcodemall commented 6 years ago

Hi Pablo,

thanks for all the efforts you invest to here... i write this using the ticket system instead of email to avoid watsting your time for users questions.

What i plan to do is to activate annotations from the current caret position (e.g. write red from here).

The problem is getting the range i should set for it. I was not able to get the current pos (range) using typical javascript methods. So i planned to use the event onSelectioNChanged and possibly store the latest position of the caret (if it is provided by the event), anyway, when using this after setting the ediors text in the configEditor function, it says there is no such function.
The event was documented in the lastest wiki: https://github.com/SwellRT/swellrt/wiki/Collaborative-Text-Editor

Any clue that could help me please?

pablojan commented 6 years ago

Sorry, that documentation is outdated. Please check out https://github.com/SwellRT/swellrt/blob/master/wave/doc/swellrt/Editor.md#caret-and-selections (wave/doc folder in the project's source code)