Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotator storage plug in - callbacks / customization #609

Open
TomThak opened this issue May 4, 2016 · 2 comments
Open

Annotator storage plug in - callbacks / customization #609

TomThak opened this issue May 4, 2016 · 2 comments

Comments

@TomThak
Copy link

TomThak commented May 4, 2016

Hello guys,
is there any way, how to call any functions right after using some methods in storage plug in?
I would like to show the people some notice div, that their annotation has been succesfully saved, which means to call function right after ajax request has finished.
The same for deleting.

It would be also nice to have possbility to modify the plug in. For example if the annotation has empty text I would like to add current date, when it was created instead of just "no comment" placeholder.

Any suggestions? The documentation is not so good. There are just descriptions about how to storage, but nothing else.

@tilgovi
Copy link
Member

tilgovi commented May 4, 2016

Which version of Annotator?

@TomThak
Copy link
Author

TomThak commented May 5, 2016

1.2.x the stable one.

I found, that there is possible to use .subscribe() method to catch major events of the annotator plug in.
it is fine! So, now I understand, that I can use some functions on triggers of some major evets, but only one is missing to me - when I select the text, there is no event on "range" select. However the plug in has to know about this event, because it shows "annotator-adder" button. I found, that inside the plugin, there is method this.publish('nameofevent',options) and this creates the triggers, but for "text select" event there is no such a trigger. Maybe it will be added in the future version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants