-
Notifications
You must be signed in to change notification settings - Fork 0
/
StaticRange.cljs
162 lines (112 loc) · 4.72 KB
/
StaticRange.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
(ns web.StaticRange
"The StaticRange interface provides attributes that track the
and end position of a range, and a boolean attribute indicating
the current range is collapsed into a single position."
(:refer-clojure :exclude []))
(def constructor
"Constructor.
The StaticRange() constructor creates a new `web.StaticRange` object which provides attributes that track the start and end position of a range, and a boolean attribute indicating whether the current range is collapsed into a single position.
options
Options are as follows:
startContainer: The start `web.Node` for the range.
startOffset: The offset into the start node of the range's start position.
endContainer: The end `web.Node` for the range.
endOffset: The offset into the start node of the range's start position.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/StaticRange`"
js/StaticRange)
(defn to-range
"Method.
The toRange() property of the `web.StaticRange` interface converts
StaticRange object to a `web.Range` object.
`var range = staticRange.toRange()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/toRange`"
[this ]
(-> this (.toRange)))
(defn start-container
"Property.
The startContainer property of the `web.StaticRange` interface
the start `web.Node` for the range.
`var node = staticNode.startContainer
staticNode.startContainer = startContainer`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/startContainer`"
[this]
(-> this (.-startContainer)))
(defn set-start-container!
"Property.
The startContainer property of the `web.StaticRange` interface
the start `web.Node` for the range.
`var node = staticNode.startContainer
staticNode.startContainer = startContainer`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/startContainer`"
[this val]
(aset this "startContainer" val))
(defn start-offset
"Property.
The startOffset property of the `web.StaticRange` interface returns
offset into the start node of the range's start position.
`var startOffset = staticRange.startOffset
staticRange.startOffset = startOffset`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/startOffset`"
[this]
(-> this (.-startOffset)))
(defn set-start-offset!
"Property.
The startOffset property of the `web.StaticRange` interface returns
offset into the start node of the range's start position.
`var startOffset = staticRange.startOffset
staticRange.startOffset = startOffset`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/startOffset`"
[this val]
(aset this "startOffset" val))
(defn end-container
"Property.
The endContainer property of the `web.StaticRange` interface
the end `web.Node` for the range.
`var node = staticNode.endContainer
staticNode.endContainer = endContainer`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/endContainer`"
[this]
(-> this (.-endContainer)))
(defn set-end-container!
"Property.
The endContainer property of the `web.StaticRange` interface
the end `web.Node` for the range.
`var node = staticNode.endContainer
staticNode.endContainer = endContainer`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/endContainer`"
[this val]
(aset this "endContainer" val))
(defn end-offset
"Property.
The endOffset property of the `web.StaticRange` interface returns
offset into the end node of the range's end position.
`var endOffset = staticRange.endOffset
staticRange.endOffset = endOffset`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/endOffset`"
[this]
(-> this (.-endOffset)))
(defn set-end-offset!
"Property.
The endOffset property of the `web.StaticRange` interface returns
offset into the end node of the range's end position.
`var endOffset = staticRange.endOffset
staticRange.endOffset = endOffset`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/endOffset`"
[this val]
(aset this "endOffset" val))
(defn collapsed
"Property.
The collapsed read-only property of the `web.StaticRange` interface
true if the range's start position and end position are the same.
`var boolean = staticRange.collapsed`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/collapsed`"
[this]
(-> this (.-collapsed)))
(defn set-collapsed!
"Property.
The collapsed read-only property of the `web.StaticRange` interface
true if the range's start position and end position are the same.
`var boolean = staticRange.collapsed`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/collapsed`"
[this val]
(aset this "collapsed" val))