-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharacterData.cljs
176 lines (129 loc) · 5.15 KB
/
CharacterData.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
(ns web.CharacterData
"The CharacterData abstract interface represents a `web.Node`
that contains characters. This is an abstract interface, meaning
aren't any object of type CharacterData: it is implemented by
interfaces, like `web.Text`, `web.Comment`, or `web.ProcessingInstruction`
aren't abstract."
(:refer-clojure :exclude [remove]))
(defn append-data
"Method.
Appends the given DOMString to the CharacterData.data string;
this method returns, data contains the concatenated DOMString."
[this & args]
(-> this .-appendData (.apply this (clj->js args))))
(defn delete-data
"Method.
Removes the specified amount of characters, starting at the specified
from the CharacterData.data string; when this method returns,
contains the shortened DOMString."
[this & args]
(-> this .-deleteData (.apply this (clj->js args))))
(defn insert-data
"Method.
Inserts the specified characters, at the specified offset, in
CharacterData.data string; when this method returns, data contains
modified DOMString."
[this & args]
(-> this .-insertData (.apply this (clj->js args))))
(defn remove
"Method.
The ChildNode.remove() method removes the object from the tree
belongs to.
`node.remove();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove`"
[this ]
(-> this (.remove)))
(defn replace-data
"Method.
Replaces the specified amount of characters, starting at the
offset, with the specified DOMString; when this method returns,
contains the modified DOMString."
[this & args]
(-> this .-replaceData (.apply this (clj->js args))))
(defn substring-data
"Method.
Returns a DOMString containing the part of CharacterData.data
the specified length and starting at the specified offset."
[this & args]
(-> this .-substringData (.apply this (clj->js args))))
(defn after
"Method.
The ChildNode.after() method inserts a set of `web.Node` or `web.dom.DOMString`
in the children list of this ChildNode's parent, just after this
`web.dom.DOMString` objects are inserted as equivalent `web.Text`
`[Throws, Unscopable]
void ChildNode.after((Node or DOMString)... nodes);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/after`"
[this & args]
(-> this .-after (.apply this (clj->js args))))
(defn before
"Method.
The ChildNode.before() method inserts a set of `web.Node` or
objects in the children list of this ChildNode's parent, just
this ChildNode. `web.dom.DOMString` objects are inserted as equivalent
nodes.
`[Throws, Unscopable]
void ChildNode.before((Node or DOMString)... nodes);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/before`"
[this & args]
(-> this .-before (.apply this (clj->js args))))
(defn replace-with
"Method.
The ChildNode.replaceWith() method replaces this ChildNode in
children list of its parent with a set of `web.Node` or `web.dom.DOMString`
`web.dom.DOMString` objects are inserted as equivalent `web.Text`
`[Throws, Unscopable]
void ChildNode.replaceWith((Node or DOMString)... nodes);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/replaceWith`"
[this & args]
(-> this .-replaceWith (.apply this (clj->js args))))
(defn data
"Property.
Is a DOMString representing the textual data contained in this"
[this]
(-> this (.-data)))
(defn set-data!
"Property.
Is a DOMString representing the textual data contained in this"
[this val]
(aset this "data" val))
(defn length
"Property.
Returns an unsigned long representing the size of the string
in CharacterData.data."
[this]
(-> this (.-length)))
(defn set-length!
"Property.
Returns an unsigned long representing the size of the string
in CharacterData.data."
[this val]
(aset this "length" val))
(defn next-element-sibling
"Property.
The NonDocumentTypeChildNode.nextElementSibling read-only property
the element immediately following the specified one in its parent's
list, or null if the specified element is the last one in the
`var nextNode = elementNodeReference.nextElementSibling;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode/nextElementSibling`"
[this]
(-> this (.-nextElementSibling)))
(defn set-next-element-sibling!
"Property.
The NonDocumentTypeChildNode.nextElementSibling read-only property
the element immediately following the specified one in its parent's
list, or null if the specified element is the last one in the
`var nextNode = elementNodeReference.nextElementSibling;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode/nextElementSibling`"
[this val]
(aset this "nextElementSibling" val))
(defn previous-element-sibling
"Property.
The NonDocumentTypeChildNode.previousElementSibling read-only
returns the `web.Element` immediately prior to the specified
in its parent's children list, or null if the specified element
the first one in the list.
`prevNode = elementNodeReference.previousElementSibling;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode/previousElementSibling`"
[this]
(-> this (.-previousElementSibling)))