forked from karaxnim/karax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dsl.nim
93 lines (89 loc) · 2.7 KB
/
dsl.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
block:
let tmp_402653306 = tree(VNodeKind.li)
tmp_402653306.class = className
addEventHandler(tmp_402653306, EventKind.onclick, proc (ev: Event; n: VNode) =
inc menuCtx.idx
menuCtx.onSelect(menuCtx.idx)(ev, n)
, kxi)
tmp_402653306
block:
let tmp_402653442 = tree(VNodeKind.ul)
tmp_402653442.class = className
tmp_402653442
block:
let tmp_402653488 = tree(VNodeKind.tdiv)
block:
let tmp_402653489 = tree(VNodeKind.link)
setAttr(tmp_402653489, "rel", "stylesheet")
setAttr(tmp_402653489, "type", "text/css")
setAttr(tmp_402653489, "href", "styles/index.css")
add(tmp_402653488, tmp_402653489)
add(tmp_402653488, block:
let tmp_402653490 = Menu(callback = hello)
add(tmp_402653490, block:
let tmp_402653491 = MenuItem()
add(tmp_402653491, text "one is one")
tmp_402653491)
add(tmp_402653490, block:
let tmp_402653492 = MenuItem()
add(tmp_402653492, text "two is two")
tmp_402653492)
add(tmp_402653490, block:
let tmp_402653493 = MenuItem()
add(tmp_402653493, text "three is three")
tmp_402653493)
tmp_402653490)
block:
let tmp_402653494 = tree(VNodeKind.br)
add(tmp_402653488, tmp_402653494)
block:
let tmp_402653495 = tree(VNodeKind.p)
add(tmp_402653495, block:
let tmp_402653496 = Menu()
block:
let tmp_402653497 = tree(VNodeKind.tdiv)
add(tmp_402653497, block:
let tmp_402653498 = MenuItem()
add(tmp_402653498, text "Hello")
tmp_402653498)
add(tmp_402653496, tmp_402653497)
tmp_402653496)
add(tmp_402653495, block:
let tmp_402653499 = Menu()
add(tmp_402653499, MenuItem)
tmp_402653499)
add(tmp_402653488, tmp_402653495)
add(tmp_402653488, block:
let tmp_402653500 = Menu()
add(tmp_402653500, block:
let tmp_402653501 = MenuItem()
add(tmp_402653501, text "Prologue")
tmp_402653501)
tmp_402653500)
tmp_402653488
block:
let tmp_402653954 = tree(VNodeKind.tdiv)
tmp_402653954.class = class
block:
let tmp_402653955 = tree(VNodeKind.span)
add(tmp_402653955, text message)
add(tmp_402653954, tmp_402653955)
tmp_402653954
if baseButton.typ == ButtonType.link and baseButton.href.len > 0:
block:
let tmp_402654102 = tree(VNodeKind.a)
tmp_402654102.class = class
setAttr(tmp_402654102, "href", baseButton.href)
tmp_402654102
else:
if baseButton.disabled:
block:
let tmp_402654103 = tree(VNodeKind.button)
tmp_402654103.class = class
setAttr(tmp_402654103, "disabled", $baseButton.disabled)
tmp_402654103
else:
block:
let tmp_402654104 = tree(VNodeKind.button)
tmp_402654104.class = class
tmp_402654104