Extends
Properties
getStore
#
Get a reference to the hash-value store used by the element.
- Inherited from:
- Source:
Methods
compareTo(annotation) → {boolean}
#
Compare two annotations using #getComparableObject
Parameters:
| Name | Type | Description |
|---|---|---|
annotation |
ve.dm.Annotation | Other annotation to compare against |
Returns:
Annotation is comparable
- Type
- boolean
- Inherited from:
- Source:
compareToForSerialization(annotation) → {boolean}
#
FIXME T126039: Compare to another annotation for serialization
Compares two annotations using #getComparableObjectForSerialization, unless they are both generated annotations, in which case they must be identical.
Parameters:
| Name | Type | Description |
|---|---|---|
annotation |
ve.dm.Annotation | Annotation to compare to |
Returns:
The other annotation is similar to this one
- Type
- boolean
- Inherited from:
- Source:
FIXME T126039: Compare to another annotation for serialization
Compares two annotations using #getComparableObjectForSerialization, unless they are both generated annotations, in which case they must be identical.
describeAdded() → {Array}
#
Describe the addition of this annotation to some text
Returns:
Descriptions, list of strings or Node arrays
- Type
- Array
- Inherited from:
- Source:
describeRemoved() → {Array}
#
Describe the removal of this annotation from some text
Returns:
Descriptions, list of strings or Node arrays
- Type
- Array
- Inherited from:
- Source:
getAttribute(key) → {any}
#
Get the value of an attribute.
Return value is by reference if array or object.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Name of attribute to get |
Returns:
Value of attribute, or undefined if no such attribute exists
- Type
- any
- Inherited from:
- Source:
getAttributes([prefix]) → {Object}
#
Get a copy of all attributes.
Values are by reference if array or object, similar to using the getAttribute method.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
prefix |
string |
optional |
Only return attributes with this prefix, and remove the prefix from them |
Returns:
Attributes
- Type
- Object
- Inherited from:
- Source:
getClonedElement() → {Object}
#
Get a clone of the model's linear model element.
The attributes object will be deep-copied.
Returns:
Cloned element object
- Type
- Object
- Inherited from:
- Source:
getComparableHtmlAttributes() → {Object}
#
getComparableObjectForSerialization() → {Object}
#
FIXME T126038: This method adds in HTML attributes so comparable objects aren't serialized together if they have different HTML attributes.
This method needs to be different from #getComparableObject which is still used for editing annotations.
Returns:
An object containing a subset of the annotation's properties and HTML attributes
- Type
- Object
- Inherited from:
- Source:
FIXME T126038: This method adds in HTML attributes so comparable objects aren't serialized together if they have different HTML attributes.
getElement() → {Object}
#
Get a reference to the linear model element.
Returns:
Linear model element passed to the constructor, by reference
- Type
- Object
- Inherited from:
- Source:
getHashObject() → {Object}
#
getOriginalDomElements() → {Array.<HTMLElement>}
#
Get the DOM element(s) this model was originally converted from, if any.
Returns:
DOM elements this model was converted from, empty if not applicable
- Type
- Array.<HTMLElement>
- Inherited from:
- Source:
getOriginalDomElementsHash() → {string|undefined}
#
undefined}
#
Get the DOM element(s) this model was originally converted from, if any.
Returns:
Store hash of DOM elements this model was converted from
- Type
-
string
|
undefined
- Inherited from:
- Source:
getType() → {string}
#
Get the symbolic name of this model's type.
Returns:
Type name
- Type
- string
- Inherited from:
- Source:
isDiffComparable(other) → {boolean}
#
Check if this element is of the same type as another element for the purposes of diffing.
Elements which aren't of the same type will always be shown as removal and an insertion, whereas comarable elements will be shown as an attribute change.
Parameters:
| Name | Type | Description |
|---|---|---|
other |
Object | Another element |
Returns:
Elements are of a comparable type
- Type
- boolean
- Inherited from:
- Source:
isEditable() → {boolean}
#
Check whether this node can be edited by a context item
The default implementation always returns true. If your node type is uneditable in certain cases, you should override this function.
Returns:
Whether this node is editable
- Type
- boolean
- Inherited from:
- Source:
Check whether this node can be edited by a context item
The default implementation always returns true.
isGenerated() → {boolean}
#
Check if the annotation was generated by the converter
Used by compareToForSerialization to avoid merging generated annotations.
Returns:
The annotation was generated
- Type
- boolean
- Inherited from:
- Source:
Check if the annotation was generated by the converter
Used by compareToForSerialization to avoid merging generated annotations.
isInspectable() → {boolean}
#
Check whether this node can be inspected by a context item.
The default implementation always returns true. If your node type is uninspectable in certain cases, you should override this function.
Returns:
Whether this node is inspectable
- Type
- boolean
- Inherited from:
- Source: