[annotator-dev] Lost in the "current" Annotator 1.2.9 - looking a "state-of-the-art" plugin

Ernesto Torresin (ML) ewk-ml at connettivo.net
Tue Jun 24 08:46:59 UTC 2014


Hi all

I'm trying to focus back on the Annotator but after some days, I think
that I'm in trouble. I have the strong impression that the doc is not
really in sync with the code; I've been reading the code of many
plugins, but I could not say which one can be taken as an example. I'm
stumbling on deprecated stuff at every few lines, and I cannot
understand how could it be so straightforward in the past, and so
twisted-up now.

So for instance, what is the "current" way to add callbacks to events,
"subscribe" or "listenTo"???
Then, when should I call this subscription in? in the constructor or in
the "pluginInit"? Is "pluginInit" still used by the way???

Another problem for me is that the code of most plugins imply calls to
plugins that the Annotator now discourages. It seems that such plugins
were built on foundations now superseded. Of course, one does not want
to start coding "legacy" code. Plus, AFAIK "deprecation" is not the same
as "accepting legacy code". When "deprecation" comes, a coder is warned.

IIRC, the Annotator allows selecting a text area wraps a selected text
area in a CSS class, thus highlighting it. So far, so good.
A plugin like Offline seems to allow storing annotations in a "cache"
object less convoluted than Annotator.Util.$.cache and use that object
when managing remote storage.
A plugin like "NullStore" is there for... who knows? being overwritten?
f***ing my brain up? :-)


So, I wonder whether is there a plugin that I could refer to as a sample
of good "current" coding. That would be a "lighthouse" for me and break
this bad feeling of "deprecation" that starts making me uncomfortable.

Thank you!

Ernesto Torresin





More information about the annotator-dev mailing list