Customizing the Editor
Per default, the Annotorious editor popup features two widgets:
- A comment widget for writing comments and replies
- A tag widget for adding tags, either freetext or supported by a pre-configured vocabulary and an autosuggest dropdown
You can can customize this setup when you initialize Annotorious/RecogitoJS using the
widgets
config option. The configuration below will give you the editor shown in the
image above.
var anno = Annotorious.init({
image: 'hallstatt',
widgets: [
'COMMENT',
{ widget: 'TAG', vocabulary: [ 'Animal', 'Building', 'Waterbody'] }
]
});
Alternatively, the configuration below will give you an editor with just a comment widget, but no tag widget.
var anno = Annotorious.init({
image: 'hallstatt',
widgets: [
'COMMENT'
]
});
Each item in the widgets
array can be one of the following:
- The name of a built-in widget - currently either
COMMENT
orTAG
- An editor plugin
- An object with a
widget
property that has the widget name or plugin as value, and additional configuration arguments for the widget
If you want to learn how to write your own extensions for the editor, start with this guide.
Tagging Vocabularies
Note: the tag widget also supports semantic vocabularies, where each term has a label and a URI.
var anno = Annotorious.init({
image: 'hallstatt',
widgets: [{
widget: 'TAG',
vocabulary: [
{ label: 'Place', uri: 'http://www.example.com/ontology/place' },
{ label: 'Person', uri: 'http://www.example.com/ontology/person' },
{ label: 'Event', uri: 'http://www.example.com/ontology/event' }
]
}]
});