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

These are the objects that are used to handle the processes to build and devlop the annotation models.
This handles the process of generating a new text annotation component through use of a textbox.
- Methods inherited from Polyanno.collections
| Method | Returns | Description |
|---|---|---|
| new( editor ) | this |
Finds the relevant information and builds the annotation model components for the new text. |
These are the properties used in the process of textHighlighting - when the user selects text within a transcription or translation in order to offer an alternative.
| Property | Type | Default | Description |
|---|---|---|---|
| selected | Selection Object |
null | The JavaScript Selection Object of the text that has been highlighted by the user. |
| DOM | DOM |
null | The HTML object, normally a span, wrapped around just the highlighted text. |
| parentDOM | DOM |
null | The HTML object, normally a span, wrapped around the text containing the highlighted text's DOM. |
| oldContent | String |
null | The original text content inside the highlighted text location. |
| newContent | String |
null | The new text content to replace the original in the highlighted text location |
| DOMid | String |
null | The id of the textHighlighting.DOM object. |
| URI | String |
null | The URI generated from the Polyanno.urls, setup storage options, and the DOMid - to be used as the id in the Polyanno.baseTextObject. |
| fragment | String |
null | The formatted string version of the selected object. |
| Method | Returns | Description |
|---|---|---|
| getSelected() | Selection Object |
Identifies and returns the text the user has selected. |
| findSpanClass( startParentClass ) | String |
Identifies and returns the relevant HTML DOM classes to be used for hte span enclosing the selected text. |
| strangeTrimmingFunction( text ) | String |
Formats the Selection object into an appropriate String. |
| menu.newText() | this |
Sets up the event listeners to trigger the relevant menus for the text currently selected and under consideration. |
| menu.oldText() | this |
Sets up the event listeners to trigger the relevant menus for the text currently selected once the user has confirmed the need to isolate it to add more information. |
| setOESC( outerElementHTML, previousSpanContent, previousSpan ) | String |
Generates the first part of the HTML string of the new elements to wrap around the selected text. |
| setOEEC( outerElementHTML, nextSpanContent, nextSpan ) | String |
Generates the end part of the HTML string of the new elements to wrap around the selected text. |
| extractProperties( selection, classCheck ) | this |
Identifies and generates all the relevant metadata and properties to build the annotation model(s) around the selected text. |
| new( base ) | this |
Creates the annotation model components for the selected text. |
This handles the information relating to the process of adding existing Polyanno objects as bodies and targets to annotation models, typically by drawing the shared canvas vector for an existing textual object.
| Property | Type | Default | Description |
|---|---|---|---|
| status | Boolean |
false | If true then the process is live. |
| type | String |
undefined | Type of textual object currently being handled e.g. "transcription". |
| parent_anno | String |
undefined | The id of the parent of the textual annotation being handled, if it exists. |
| parent_vector | String |
undefined | The id of the parent of the vector being handled, if it exists. |
| siblings | Array |
undefined | The array of all the Polyanno objects that also bodies of the same annotation model as the object currrently being handled. |
| vector | String |
undefined | The vector that has been selected to link to the current textual object being handled. |
| leafletControl | Leaflet Draw Control Object |
Defining the control options allowed whilst the process is live |
This handles the process of linking vectors to identify or create a common parent and annotation model target. In the UI this is normally done by selecting the shapes in order of the text reading, then the common parent shape and text annotations are automatically generated by the Polyanno package.
| Property | Type | Default | Description |
|---|---|---|---|
| status | Boolean |
false | If true then the process is live. |
| vectors | Array |
[] | The vectors being linked together in order. |
| transcriptions | Array |
[] | The transcriptions being linked together in order. |
| translations | Array |
[] | The translations being linked together in order. |
| parent | Object |
See the parent object properties below. | |
| vector | Object |
See the vector object properties below. | |
| annos | Object |
See the anno object properties below. | |
| numbers | Object |
See the numbers object properties below. |
Parent Object Properties
| Property | Type | Default | Description |
|---|---|---|---|
| vectors | `` | false | The new vector parent generated. |
| transcriptions | `` | false | The new transcription parent generated. |
| translations | `` | false | The new translation parent generated. |
| Method | Returns | Description |
|---|---|---|
| btn_events() | this |
Sets up listeners for the buttons needed to activate and interact with the buildingParents process. |
| activated() | this |
Enables the buildingParents process. |
| deactivated() | this |
Disables the buildingParents process. |
| listeners() | this |
Sets up event listeners active whilst the buildingParents process is undergoing. |
| clicked( vector ) | this |
Implements result of a shape being selected whilst the buildingParents process is undergoing. |
| submitted( vector ) | this |
Triggered when the user submits the final children selection. |
| addParentLayer() | this |
Adds the new parent vector to the Leaflet map. |
| vector.calculateNewParent( shape1, shape2, merge_array ) | Array |
Function to calculate the suggested coordinates for the new parent vector. |
| vector.new( shapeToCopy ) | this |
Starts building the new suggested parent annotation model vector components given the first child vector to be included. |
| vector.update( temp_shape_layer, new_vec_layer, merge_array ) | this |
Updates the suggested annotation model components to include the new child vector selected. |
| vector.remove( vec_removed, merge_shape ) | this |
Updates the suggested annotation model components to remove the child vector selected. |
| vector.submitted( merged_vector ) | this |
Develops and implements the final parent vector annotation model components built. |
| numbers.add( new_vec, number ) | this |
Updates the number labels of the ordering of the child vectors to include the new child vector selected. |
| numbers.remove( vec_removed, merge_array, array_index ) | this |
Updates the number labels of the ordering of the child vectors to remove the child vector selected. |
| numbers.rearrange( old_array_index, new_array_index ) | this |
Rearranges the numbers to accomodate for changes. |
| annos.addSpan( this_json, text_type ) | this |
Adds the text components of the annotation models of the new child included to the suggested parent model texts. |
| annos.addJSON( new_vec, textType ) | this |
Adds the text components of the annotation models of the new child included to the suggested parent model texts. |
| annos.addText( merged_vector, textType ) | this |
Adds the text components of the annotation models of the new child included to the suggested parent model texts. |
| annos.add( new_vector ) | this |
Adds the text components of the annotation models of the new child included to the suggested parent model texts. |
| annos.remove( vectorRemoved ) | this |
Removes the text components of the annotation models of the child included from the suggested parent model texts. |
| annos.removeText( text_type, children_array, vec ) | this |
Removes the text components of the annotation models of the child included from the suggested parent model texts. |
| annos.updateChildren( merged_vector, merged_text, textType ) | this |
Updates the children text components of the annotation models to include information about the new parent components generated. |
| annos.submitted( merged_vector ) | this |
Triggered once the user has confirmed the final parent, and starts necessary relevant processes. |