aboutsummaryrefslogtreecommitdiffstats
path: root/lib/html.client.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-10-29 08:37:40 +0000
committers-ol <s-ol@users.noreply.github.com>2018-10-29 08:40:08 +0000
commite5491bc7fbd867812500c845db99b55b35db0666 (patch)
tree7204730bc3cd99027a3104b315b6b3996bc794a4 /lib/html.client.moon
parentbetter conversion inverence for mmmfs (diff)
downloadmmm-e5491bc7fbd867812500c845db99b55b35db0666.tar.gz
mmm-e5491bc7fbd867812500c845db99b55b35db0666.zip
rename lib.html to lib.dom
Diffstat (limited to 'lib/html.client.moon')
-rw-r--r--lib/html.client.moon32
1 files changed, 0 insertions, 32 deletions
diff --git a/lib/html.client.moon b/lib/html.client.moon
deleted file mode 100644
index b8f2bd5..0000000
--- a/lib/html.client.moon
+++ /dev/null
@@ -1,32 +0,0 @@
-element = (element) -> (...) ->
- children = { ... }
-
- -- attributes are last arguments but mustn't be a ReactiveVar
- attributes = children[#children]
- if 'table' == (type attributes) and not attributes.node
- table.remove children
- else
- attributes = {}
-
- with e = document\createElement element
- for k,v in pairs attributes
- if k == 'style' and 'table' == type v
- for kk,vv in pairs v
- e.style[kk] = vv
- elseif 'string' == type k
- e[k] = v
-
- -- if there is only one argument,
- -- children can be in attributes table too
- if #children == 0
- children = attributes
-
- for child in *children
- if 'string' == type child
- e.innerHTML ..= child
- else
- e\appendChild child
-
-setmetatable {}, __index: (name) =>
- with val = element name
- @[name] = val