[annotator-dev] Plugin Development Question

Ulrike Schmidt ulrike at gol.com
Tue Oct 8 21:58:57 UTC 2013


The first problematic line is:

plugin.pluginInit:  function  ()  {


Firebug says: " invalid label"

So I changed it to:

plugin.pluginInit = function () {


Firebug says: " annotator is not defined"


Am 08.10.13 19:11, schrieb Randall Leeds:
>
> Looks like it should be "this.annotator".
>
> Do you get a stack trace? Console errors?
>

With this I get no Console errors, but also no message if I add the 
plugin according to the wiki instructions and make an annotation:

$('body').annotator().annotator('addPlugin', 'Message', 'Hello World!')


> On Oct 8, 2013 8:43 AM, "Ulrike Schmidt" <ulrike at gol.com 
> <mailto:ulrike at gol.com>> wrote:
>
>     Hello,
>
>     I am trying to develop a plugin for annotator that adds fields to
>     the viewer and had a close look at
>     https://github.com/okfn/annotator/wiki/Plugin-Development.
>     Unfortunately the following example code from the wiki does not work:
>
>     Annotator.Plugin.Message  =  function  (element,  message)  {
>        var  plugin  =  {};
>
>        plugin.pluginInit:  function  ()  {
>            annotator.viewer.addField({
>              load:  function  (field,  annotation)  {
>                field.innerHTML  =  message;
>              }
>            })
>        };
>
>        return  plugin;
>     }
>
>
>     Could someone enlighten me on how to get this working?
>
>     Thanks!
>
>     Ulrike
>
>
>
>     _______________________________________________
>     annotator-dev mailing list
>     annotator-dev at lists.okfn.org <mailto:annotator-dev at lists.okfn.org>
>     http://lists.okfn.org/mailman/listinfo/annotator-dev
>     Unsubscribe: http://lists.okfn.org/mailman/options/annotator-dev
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20131008/60ff91f8/attachment-0002.html>


More information about the annotator-dev mailing list