This is part of my series of posts about the PolyAnno project – more here
Separating PolyAnno from “The Polyglot Project”
I then intended to release the PolyAnno package separately from the project specifically for the University of Edinburgh. I felt that it was important to create reusable code specifically for the providing the combination of:
- Leaflet IIIF + Leaflet Draw + OAM JSON-LD annotations
- the voting and verification system
- vectors + transcription + translation + metadata
- capability for adding both Hypothesis commentary, and a userbase system on top
Firstly I needed to separate out the essential options for this package into the polyanno_setup function.
polyanno_setup(opts);
The function that takes one input, opts, a JSON object of the following format :
{
"highlighting": Boolean,
"minimising": Boolean,
"voting": Boolean,
"users": Object,
"storage": Object
}
Highlighting Option
If false then this disables the highlighting functionality that enables any annotation targets present on the page to be ‘highlighted’ whenever a cursor hovers over an annotation.
The default, non-highlighted colours of objects can be defined by setting the variable polyanno_default_colours_array before running the setup. This is an array of three HTML colours in the format [editor_box, vector, span]. The default values are:
//[editor_box, vector, span]
polyanno_default_colours_array = ["buttonface","#03f","transparent"];
The highlighted colours that the objects change to are similarly defined by polyanno_highlight_colours_array with the defaults as follows:
//[editor_box, vector, span]
polyanno_highlight_colours_array = ["#EC0028","#EC0028","#EC0028"];
Storage Option
The storage field takes format:
{
"base_url": String,
"transcription": String,
"translation": String,
"vector": String,
"annotation": String
}
If nothing is specified other than base_url then it simply assumes base_url + “/transcriptions”, “/translations”, “/vectors”, and “/annotations”. The storage assumes you are using polyanno_storage and the URLs mapping to the storage functions are assumed to be:
I never quite finished separating the two packages and so the users functionality was never implemented before the end of 2016, nor was Polyanno released as a separate package. However, within the Polyglot project, I began a more clear cut of the code.
Additionally I successfully separated out the PolyAnno Storage functionality into a separate package, as detailed in the next post.
Next: Polyanno Storage
This is part of my series of posts about the PolyAnno project – more here