aboutsummaryrefslogtreecommitdiff
path: root/src/Lib/Dom/H.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/Lib/Dom/H.ml')
-rw-r--r--src/Lib/Dom/H.ml65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/Lib/Dom/H.ml b/src/Lib/Dom/H.ml
deleted file mode 100644
index 7213daf..0000000
--- a/src/Lib/Dom/H.ml
+++ /dev/null
@@ -1,65 +0,0 @@
-(* Element creation *)
-
-type attribute =
- | TextAttr of string * string
- | EventAttr of string * (Dom.event -> unit)
-
-let h tag attributes children =
- let element =
- if tag == "svg" || tag == "path" then
- Document.create_element_ns "http://www.w3.org/2000/svg" tag
- else Document.create_element tag
- in
- let () =
- Js.Array.forEach
- (fun attr ->
- match attr with
- | TextAttr (name, value) ->
- Element.set_attribute element name value
-
- | EventAttr (name, eventListener) ->
- Element.add_event_listener element name eventListener)
- attributes
- in
- let () =
- Js.Array.forEach
- (fun child -> Element.append_child element child)
- children
- in
- element
-
-(* Node creation *)
-
-let text = Document.create_text_node
-
-let div = h "div"
-
-let span = h "span"
-
-let header = h "header"
-
-let button = h "button"
-
-let section = h "section"
-
-let svg = h "svg"
-
-let path = h "path"
-
-let form = h "form"
-
-let label = h "label"
-
-let input = h "input"
-
-let textarea = h "textarea"
-
-let i = h "i"
-
-let a = h "a"
-
-let h1 = h "h1"
-
-let h2 = h "h2"
-
-let h3 = h "h3"