[annotator-dev] Add custom field in my demo.html(how to add editor more fields)

Randall Leeds tilgovi at hypothes.is
Thu Jul 25 06:58:11 UTC 2013


The third parameter to annotator('addPlugin' 'Tags', {}) is an object of
options *for the Tags plugin*.

The "addField" method is on the editor and viewer objects which are
attributes of the annotator.

Using Annotator as a jQuery plugin the annotator object itself is not
public.

However, you can use it directly:

var annotator = new Annotator(getElementById('airlock'), {});
annotator.addPlugin('Tags', {});
annotator.editor.addField({
      label: 'Name',
      type: 'input',
      load: this.updateField,
      submit: this.setAnnotationTags
})

Another approach is to make your own plugin. Plugins are given access to
the annotator instance. It is passed to their constructors. See the source
of any of the built-in plugins for an example.


On Wed, Jul 24, 2013 at 7:14 AM, dilip kumar <dskd.s01 at gmail.com> wrote:

> Hi,
>
> I am trying to add multiple fields add in editor,  when text to select and
> then click annotate button to annotate there are one fields showing in
> "Editor" but i want to add more fields in "Editor" without change any code
> in "annotator-full.mini.js", Please see below code what i am write:
>
> *var content=$('#airlock').annotator();
> content.annotator('addPlugin', 'Tags',{
>  editor.addField({
>       label: 'Name',
> *
> *      type: 'input',
> *
> *      load: this.updateField,
>       submit: this.setAnnotationTags
>     });
>
>     viewer.addField({
>       load: this.updateViewer
>     });
> });*
>
>
> Please help me.
>
> --
> Thanks & Regards,
> Dilip Kumar ( Sr.PHP Programmer)
> 91+9958513919
>
>
>
> _______________________________________________
> annotator-dev mailing list
> 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/20130724/bc259d3b/attachment-0002.html>


More information about the annotator-dev mailing list