about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-25 11:56:54 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-25 12:04:37 +0200
commit98865ac747766118b94f39f749aba4be62c78022 (patch)
treedd0d6520997eef16fa7238d1dc486affd49057b6 /src/config
parente4cccbeb7488dfe8afbbe51c60fd16557dea923f (diff)
downloadchawan-98865ac747766118b94f39f749aba4be62c78022.tar.gz
Add jspropnames, CSSStyleDeclaration stub
Diffstat (limited to 'src/config')
-rw-r--r--src/config/config.nim11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/config/config.nim b/src/config/config.nim
index 5f749708..63438c55 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -9,6 +9,7 @@ import config/toml
 import io/urlfilter
 import js/error
 import js/javascript
+import js/propertyenumlist
 import js/regex
 import loader/headers
 import loader/loader
@@ -183,12 +184,20 @@ proc setter(a: ptr ActionMap, k, v: string) {.jssetprop.} =
       a[][teststr] = "client.feedNext()"
     teststr.setLen(i)
 
-proc delete(a: ptr Actionmap, k: string): bool {.jsdelprop.} =
+proc delete(a: ptr ActionMap, k: string): bool {.jsdelprop.} =
   let k = getRealKey(k)
   let ina = k in a[]
   a[].t.del(k)
   return ina
 
+func names(ctx: JSContext, a: ptr ActionMap): JSPropertyEnumList
+    {.jspropnames.} =
+  let L = uint32(a[].t.len)
+  var list = newJSPropertyEnumList(ctx, L)
+  for key in a[].t.keys:
+    list.add(key)
+  return list
+
 proc bindPagerKey(config: Config, key, action: string) {.jsfunc.} =
   (addr config.page).setter(key, action)