Class: types.String
Defined in: | lib/Types/TextTypes.coffee |
Inherits: | types.Array |
Overview
Handles a String-like data structures with support for insert/delete at a word-position.
Variables Summary
- type =
-
"String"
Identifies this class. Use it to check whether this is a word-type or something else.
Examples:
var x = yatta.val('unknown') if (x.type === "String") { console.log JSON.stringify(x.toJson()) }
Variable inherited from types.Array
Instance Method Summary
- # (String) val() Get the String-representation of this word.
- # (void) toString() Same as String.val
- # (Array Type) insert(position, content, options) Inserts a string into the word.
- # (void) bind(textfield, dom_root) Bind this String to a textfield or input field.
- # (void) _encode() Private Encode this operation in such a way that it can be parsed by remote peers.
Inherited Method Summary
Methods inherited from
types.Array
#applyDelete #cleanup #toJson #val #push #insertAfter #insert #delete #_encode
Constructor Details
#
(void)
constructor(uid)
Private
Instance Method Details
#
(String)
val()
Get the String-representation of this word.
#
(void)
toString()
Same as String.val
#
(Array Type)
insert(position, content, options)
Inserts a string into the word.
#
(void)
bind(textfield, dom_root)
Bind this String to a textfield or input field.
Examples:
var textbox = document.getElementById("textfield");
yatta.bind(textbox);
#
(void)
_encode()
Private
Encode this operation in such a way that it can be parsed by remote peers.