-
Notifications
You must be signed in to change notification settings - Fork 3
GenericObjects

These are objects that are unlikely to be used directly when working with the original intended use cases of Polyanno, however they may be used by those wishing to adapt the package for more experimental applications. They define the shared features of the other Polyanno objects that inherit from them.
These are the important urls used if using any of the in-built AJAX REST API support to connect a Polyanno application to a REST back end, with defaults defined to support basic default usage of the Polyanno Storage Node package. These are used to define the URIs needed for the id properties of the annotation model components.
// Changing the value of the URL used for generating Polyanno.vector ids:
Polyanno.urls.vector = "https://myexample.com/vectors";
// So now if a new vector is created the id will use the new url:
var defaultVec = new Polyanno.vector(opts);
//// --> defaultVec.id = "https://myexample.com/vectors/23984729562893659"| Property | Type | Default | Description |
|---|---|---|---|
| vector | String |
window.location.host + "/api/vectors/" | |
| transcription | String |
window.location.host + "/api/transcriptions/" | |
| translation | String |
window.location.host + "/api/translations/" | |
| annotation | String |
window.location.host + "/api/annotations/" |
None.
None.
Because there are various situations where the colours change throughout use of the package, rather than leaving users to manually override the defaults in each situation, the colours used are defined in one object, Polyanno.colours, which can be redefined for more effective adaption.
// Changing the colour of the vectors during the highlighting process:
Polyanno.colours.highlight.vector = "white";
| Property | Type | Default | Description |
|---|---|---|---|
| highlight | Object |
NA | |
| default | Object |
NA | |
| processing | Object |
NA |
Polyanno.colours.highlight Properties
| Property | Type | Default | Description |
|---|---|---|---|
| editor | String |
"#EC0028" |
HTML colour |
| vector | String |
"#EC0028" |
HTML colour |
| span | String |
"#EC0028" |
HTML colour |
Polyanno.colours.default Properties
| Property | Type | Default | Description |
|---|---|---|---|
| editor | String |
"buttonface" |
HTML colour |
| vector | String |
"#03f" |
HTML colour |
| span | String |
"transparent" |
HTML colour |
Polyanno.colours.processing Properties
| Property | Type | Default | Description |
|---|---|---|---|
| editor | String |
"yellow" |
HTML colour |
| vector | String |
"yellow" |
HTML colour |
| span | String |
"yellow" |
HTML colour |
| Method | Returns | Description |
|---|---|---|
| connectColours( object, type, action ) | this |
For a given object of type vector, editor, or span, the "equivalent" objects of the other types (those sharing a common annotation model feature) are all highlighted to their Polyanno.colours.process colours. |
| highlightThis.vector( chosenVector, colourChange ) | this |
Changes the chosen vector to the chosen HTML colour. |
| highlightThis.editor( chosenEditor, colourChange ) | this |
Changes the chosen editor to the chosen HTML colour. |
| highlightThis.span( chosenSpan, colourChange ) | this |
Changes the chosen span highlight to the chosen HTML colour. |
None.
These are the objects containing the variables that contain the HTML (as strings) used to dynamically generate the DOM.
// Changing the symbol for the transcriptions:
The symbol used on the add new transcription button is defined in the Polyanno.HTML.symbols.transcription property
Polyanno.HTML.symbols Properties
| Property | Type | Default | Description |
|---|---|---|---|
| transcription | String |
HTML stored as String | |
| translation | String |
HTML stored as String | |
| discussion | String |
HTML stored as String | |
| newAnnotation | String |
HTML stored as String | |
| textHighlightingCut | String |
HTML stored as String | |
| textHighlightingOthers | String |
HTML stored as String | |
| textHighlighting.transcription | String |
HTML stored as String | |
| textHighlighting.translation | String |
HTML stored as String | |
| buildingParents | String |
HTML stored as String | |
| buildingParent.transcription | String |
HTML stored as String | |
| buildingParent.translation | String |
HTML stored as String | |
| connectingEquals.transcription | String |
HTML stored as String | |
| connectingEquals.translation | String |
HTML stored as String | |
| showAlternatives | String |
HTML stored as String |
Polyanno.HTML.popups Properties
| Property | Type | Default | Description |
|---|---|---|---|
| connectingEquals | String |
"" | HTML stored as String |
| textHighlighting | String |
"" | HTML stored as String |
| children | String |
"" | HTML stored as String |
Polyanno.HTML.buildingParents Properties
| Property | Type | Default | Description |
|---|---|---|---|
| Transcriptions | String |
"" | HTML stored as String |
| Translations | String |
"" | HTML stored as String |
None.
None.
This is the information relating to the handling of the image itself.
| Method | Returns | Description |
|---|---|---|
| generateRegionURL( coordinates ) | String |
Generates the URL parameters for the region of the image given the coordinates. |
| outerRectangle( coordinates ) | String |
Generates the coordinates of the outer rectangle containing the region - simplified. |
| getIIIFURL( imageJSON, coordinates, format ) | String |
Generates the IIIF API URL for the given image and parameters. |
| findTitle( metadata ) | String |
Identifies the document title from the given metadata. |
| findDescription( metadata ) | String |
Identifies the document description from the given metadata. |
None.
The properties of this object are used to define the JS and CSS effect functions used to animate the DOM during default Polyanno behaviour.
The spans of the transcriptions being added (in the editor on the right) during the buildingParents process are animated using the callbacks defined in the Polyanno.intEffects.buildingParents.transcription property
//
| Property | Type | Default | Description |
|---|---|---|---|
| editor | Function |
null |
Animation callback for the editor UI whilst the buildingParents process is live. |
| buildingParents | Object |
See the BuildingParents Effects Object below for more information. |
intEffects.buildingParents Object Properties
Not to be confused the Polyanno.buildingParents object (sorry for this)!
| Property | Type | Default | Description |
|---|---|---|---|
| transcription | Function |
null |
The callback for the animation of the transcriptions corresponding to the vectors being linked. |
| translation | Function |
null |
The callback for the animation of the translations corresponding to the vectors being linked. |
| vector.mouseover | Object |
undefined |
Dictionary where the animation callback for mouseover are stored using the Leaflet._id of the vectors as their key |
| vector.mouseout | Object |
undefined |
Dictionary where the animation callback for mouseout are stored using the Leaflet._id of the vectors as their key |
| Method | Returns | Description |
|---|---|---|
| buildingParents.span_mouseover( span_id, text_type ) | this |
Function to animate the chosen span defined by the DOM span id and text_type during the buildingParents process. |
None.