Class ops.OpInsertText
Defined in: OpInsertText.js.
Constructor Attributes | Constructor Name and Description |
---|---|
This operation inserts the given text
at the specified position, and if
the moveCursor flag is specified and
is set as true, moves the cursor to
the end of the inserted text.
|
Method Attributes | Method Name and Description |
---|---|
execute(document)
|
|
init(data)
|
|
<inner> |
isNonTabWhiteSpace(character)
Returns true if the supplied character is a non-tab ODF whitespace character
|
<inner> |
requiresSpaceElement(text, index)
Returns true if the particular character in the text string is a space character that is immediately
preceded by another space character (or is the first or last space in the text block).
|
spec()
|
|
<inner> |
triggerLayoutInWebkit(textNode)
This is a workaround for a bug where webkit forgets to relayout
the text when a new character is inserted at the beginning of a line in
a Text Node.
|
Class Detail
ops.OpInsertText()
This operation inserts the given text
at the specified position, and if
the moveCursor flag is specified and
is set as true, moves the cursor to
the end of the inserted text.
Otherwise, the cursor remains at the
same position as before.
Method Detail
execute(document)
- Parameters:
- {!ops.Document} document
init(data)
- Parameters:
- {!ops.OpInsertText.InitSpec} data
<inner>
{!boolean}
isNonTabWhiteSpace(character)
Returns true if the supplied character is a non-tab ODF whitespace character
- Parameters:
- {!string} character
- Returns:
- {!boolean}
<inner>
{boolean}
requiresSpaceElement(text, index)
Returns true if the particular character in the text string is a space character that is immediately
preceded by another space character (or is the first or last space in the text block).
Logic is based on http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#element-text_s
- Parameters:
- {!string} text
- {!number} index
- Returns:
- {boolean}
{!ops.OpInsertText.Spec}
spec()
- Returns:
- {!ops.OpInsertText.Spec}
<inner>
{undefined}
triggerLayoutInWebkit(textNode)
This is a workaround for a bug where webkit forgets to relayout
the text when a new character is inserted at the beginning of a line in
a Text Node.
- Parameters:
- {!Node} textNode
- Returns:
- {undefined}