about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-02 23:41:02 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-02 23:41:11 +0200
commit3c5aa0645bcc1d2481cdb4b03001afd96fd318e0 (patch)
treef1ba22a1d7d93a6db28e60e56e04602d023e5f41 /src/display/client.nim
parent31cca81850bfe43771767dbffc2879a5061b84cd (diff)
downloadchawan-3c5aa0645bcc1d2481cdb4b03001afd96fd318e0.tar.gz
Add XHR/Event stubs
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index 2f99a7d5..6b18e092 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -22,6 +22,7 @@ import data/charset
 import display/pager
 import display/term
 import html/dom
+import html/event
 import html/htmlparser
 import io/headers
 import io/lineedit
@@ -44,7 +45,8 @@ import types/cookie
 import types/dispatcher
 import types/url
 import utils/opt
-import xhr/formdata as formdata_impl
+import xhr/formdata
+import xhr/xmlhttprequest
 
 type
   Client* = ref ClientObj
@@ -378,7 +380,7 @@ proc inputLoop(client: Client) =
         assert event.fd == sigwinch
         client.attrs = getWindowAttributes(client.console.tty)
         client.pager.windowChange(client.attrs)
-      if Event.Timer in event.events:
+      if selectors.Event.Timer in event.events:
         assert client.timeouts.runTimeoutFd(event.fd)
         client.runJSJobs()
         client.console.container.requestLines().then(proc() =
@@ -409,7 +411,7 @@ proc headlessLoop(client: Client) =
         client.handleRead(event.fd)
       if Error in event.events:
         client.handleError(event.fd)
-      if Event.Timer in event.events:
+      if selectors.Event.Timer in event.events:
         assert client.timeouts.runTimeoutFd(event.fd)
     client.runJSJobs()
     client.loader.unregistered.setLen(0)
@@ -583,11 +585,13 @@ proc newClient*(config: Config, dispatcher: Dispatcher): Client =
   ctx.addDOMExceptionModule()
   ctx.addCookieModule()
   ctx.addURLModule()
+  ctx.addEventModule()
   ctx.addDOMModule()
   ctx.addHTMLModule()
   ctx.addIntlModule()
   ctx.addBlobModule()
   ctx.addFormDataModule()
+  ctx.addXMLHttpRequestModule()
   ctx.addHeadersModule()
   ctx.addRequestModule()
   ctx.addResponseModule()