[annotator-dev] Port of Factlink's paragraph icons to Annotator.js

Randall Leeds tilgovi at hypothes.is
Mon May 4 21:27:31 UTC 2015


Thanks, JP!

On Sun, May 3, 2015 at 10:36 PM, Jan Paul Posma <janpaul at factlink.com>
wrote:

> For those of you who are interested in icons next to paragraphs that
> automatically integrate with a host website (paragraph detection,
> colour/size adjustment, style/script isolation, etc), I ported our
> code from Factlink to Annotator.js.
>

Aside from getting jQuery from annotator.util, does this use Annotator at
all or implement its extension module pattern?

http://docs.annotatorjs.org/en/latest/module-development.html


> Code: https://github.com/Factlink/annotator-paragraph-icons
> Demo: http://factlink.github.io/annotator-paragraph-icons/
>
> Main advantages are that this interface is easier to discover, could
> be made to work well on mobile (show icon when touching a paragraph),
> and could be used to group annotations instead of highlights or a more
> complicated sidebar as Hypothes.is has (though this grouping is
> currently not implemented).
>
> Only thing missing is the actual saving of the annotation, that seemed
> a bit tricky for me to figure out, and not really documented. If
> someone from the Annotator team could fill this in, that would be
> awesome:
> https://github.com/Factlink/annotator-paragraph-icons/blob/784bf4c60db28e0612d2ae711abcb0c1b9f90972/app/icon_buttons.coffee#L136
>

The `start` hook receives the `App` as an argument.

It's probably reasonable to expect that instance to have a property,
`annotations` conforming to the Storage interface. The details of this are
not 100% settled and the robustness of using the application instance to
get these properties is not known yet, until we see more applications built.

The absolute best thing you can do to start with is to make sure your code
has a public interface. One should be able to instantiate it, likely given
a root element under which to act, and it should provide some way for the
user to be notified about events that your code handles, for instance by
providing an `onClick` option to the constructor.

>From there, wrapping it as an Annotator module and including it in an
application should be straightforward. However, crucially, the core of what
you've done becomes independent of Annotator or any other annotation
application/framework.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150504/44e4eddf/attachment-0004.html>


More information about the annotator-dev mailing list