-
Notifications
You must be signed in to change notification settings - Fork 2
/
WebAPI.Elements.pas
69 lines (48 loc) · 2.52 KB
/
WebAPI.Elements.pas
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
unit WebAPI.Elements;
interface
type
JDOMTokenList = class external 'DOMTokenList'
procedure Add(token : String); external 'add';
procedure Remove(token : String); external 'remove';
procedure Toggle(token : String); external 'toggle';
function Contains(token : String) : Boolean; external 'contains';
end;
JDOMRect = class external 'DOMRect'
X : Float; external 'x';
Y : Float; external 'y';
Width : Float; external 'width';
Height : Float; external 'height';
Top : Float; external 'top';
Right : Float; external 'right';
Bottom : Float; external 'bottom';
Left : Float; external 'left';
end;
JElement = class;
JElements = array of JElement;
JElement = class external 'Element'
procedure Append(element : JElement); overload; external 'append';
procedure Append(element : array of JElement); overload; external 'append';
function Closest(selectors : String) : JElement; external 'closest';
procedure InsertAdjacentHTML(position, html : String); external 'insertAdjacentHTML';
function GetAttribute(name : String) : String; external 'getAttribute';
procedure SetAttribute(name, value : String); external 'setAttribute';
property Attr[name : String] : String read GetAttribute write SetAttribute;
function QuerySelector(filter : String) : JElement; external 'querySelector';
function QuerySelectorAll(filter : String) : JElements; external 'querySelectorAll';
procedure Remove(); external 'remove';
ClassList : JDOMTokenList; external 'classList';
ClassName : String; external 'className';
InnerHTML : String; external 'innerHTML';
InnerText : String; external 'innerText';
PreviousElementSibling : JElement; external 'previousElementSibling';
NextElementSibling : JElement; external 'nextElementSibling';
ParentElement : JElement; external 'parentElement';
Style : Variant; external 'style';
TextContent : String; external 'textContent';
Value : String; external 'value';
Checked : Variant; external 'checked';
procedure AddEventListener(eventType : String; callback : procedure; useCapture : Boolean); overload; external 'addEventListener';
procedure AddEventListener(eventType : String; callback : procedure (event : Variant); useCapture : Boolean); overload; external 'addEventListener';
procedure Focus; external 'focus';
function GetBoundingClientRect : JDOMRect; external 'getBoundingClientRect';
end;