Add some extra methods and fields to DOM module.
This commit is contained in:
parent
0c694d2064
commit
28f3b3d3a7
1 changed files with 11 additions and 0 deletions
|
|
@ -57,6 +57,7 @@ type
|
||||||
status*: cstring
|
status*: cstring
|
||||||
toolbar*: ref TToolBar
|
toolbar*: ref TToolBar
|
||||||
frames*: seq[TFrame]
|
frames*: seq[TFrame]
|
||||||
|
screen*: Screen
|
||||||
|
|
||||||
Frame* = ref FrameObj
|
Frame* = ref FrameObj
|
||||||
FrameObj {.importc.} = object of WindowObj
|
FrameObj {.importc.} = object of WindowObj
|
||||||
|
|
@ -129,6 +130,7 @@ type
|
||||||
name*: cstring
|
name*: cstring
|
||||||
readOnly*: bool
|
readOnly*: bool
|
||||||
options*: seq[OptionElement]
|
options*: seq[OptionElement]
|
||||||
|
clientWidth*, clientHeight*: int
|
||||||
|
|
||||||
# https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
# https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
||||||
HtmlElement* = ref object of Element
|
HtmlElement* = ref object of Element
|
||||||
|
|
@ -393,10 +395,17 @@ type
|
||||||
TTimeOut* {.importc.} = object of RootObj
|
TTimeOut* {.importc.} = object of RootObj
|
||||||
TInterval* {.importc.} = object of RootObj
|
TInterval* {.importc.} = object of RootObj
|
||||||
|
|
||||||
|
AddEventListenerOptions* = object
|
||||||
|
capture*: bool
|
||||||
|
once*: bool
|
||||||
|
passive*: bool
|
||||||
|
|
||||||
{.push importcpp.}
|
{.push importcpp.}
|
||||||
|
|
||||||
# EventTarget "methods"
|
# EventTarget "methods"
|
||||||
proc addEventListener*(et: EventTarget, ev: cstring, cb: proc(ev: Event), useCapture: bool = false)
|
proc addEventListener*(et: EventTarget, ev: cstring, cb: proc(ev: Event), useCapture: bool = false)
|
||||||
|
proc addEventListener*(et: EventTarget, ev: cstring, cb: proc(ev: Event), options: AddEventListenerOptions)
|
||||||
|
|
||||||
|
|
||||||
# Window "methods"
|
# Window "methods"
|
||||||
proc alert*(w: Window, msg: cstring)
|
proc alert*(w: Window, msg: cstring)
|
||||||
|
|
@ -470,6 +479,8 @@ proc releaseEvents*(d: Document, eventMask: int) {.deprecated.}
|
||||||
proc routeEvent*(d: Document, event: Event)
|
proc routeEvent*(d: Document, event: Event)
|
||||||
proc write*(d: Document, text: cstring)
|
proc write*(d: Document, text: cstring)
|
||||||
proc writeln*(d: Document, text: cstring)
|
proc writeln*(d: Document, text: cstring)
|
||||||
|
proc querySelector*(d: Document, selectors: cstring): Element
|
||||||
|
proc querySelectorAll*(d: Document, selectors: cstring): seq[Element]
|
||||||
|
|
||||||
# Element "methods"
|
# Element "methods"
|
||||||
proc blur*(e: Element)
|
proc blur*(e: Element)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue