From 62983cdc609aacc47ade0a8a4a4c6b85dd26199a Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 2 Jan 2023 21:19:46 +0100 Subject: dom: add better attribute reflection Instead of creating a new function for each attribute, use a single magic function for reflected attributes. --- src/html/env.nim | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/html/env.nim') diff --git a/src/html/env.nim b/src/html/env.nim index 3c1668c7..a232baa5 100644 --- a/src/html/env.nim +++ b/src/html/env.nim @@ -22,13 +22,14 @@ proc language(navigator: Navigator): string {.jsfget.} = "en-US" proc languages(navigator: Navigator): seq[string] {.jsfget.} = @["en-US"] #TODO frozen array? # NavigatorOnline -proc onLine(navigator: Navigator): bool {.jsfget.} = true # none of your business :) +proc onLine(navigator: Navigator): bool {.jsfget.} = + true # at the very least, the terminal is on-line :) #TODO NavigatorContentUtils # NavigatorCookies # "this website needs cookies to be enabled to function correctly" -# I'll take your incorrectly functioning website over the tracking any day. +# It's probably better to lie here. proc cookieEnabled(navigator: Navigator): bool {.jsfget.} = true # NavigatorPlugins @@ -48,9 +49,6 @@ proc addNavigatorModule(ctx: JSContext) = ctx.registerType(PluginArray) ctx.registerType(MimeTypeArray) -#func `$`(window: Window): string {.jsfunc.} = -# "[object Window]" - proc newWindow*(scripting: bool, loader = none(FileLoader)): Window = result = Window( console: console(), -- cgit 1.4.1-2-gfad0