summaryrefslogtreecommitdiff
path: root/htc/html.htc
diff options
context:
space:
mode:
Diffstat (limited to 'htc/html.htc')
-rw-r--r--htc/html.htc152
1 files changed, 152 insertions, 0 deletions
diff --git a/htc/html.htc b/htc/html.htc
new file mode 100644
index 0000000..bd96870
--- /dev/null
+++ b/htc/html.htc
@@ -0,0 +1,152 @@
1\const{icons}{/icons}
2\const{space}{ }
3\const{lt}{<}
4\const{gt}{>}
5\def{indent}{x}{\for(i:=0)(i<\1)(i+=1){\space}}
6\def{option}{?xx}{
7 %<options>{value}{desc}
8 <option\on.arg{0}{ \0} value=\cdata{\1}>
9 \2
10}
11\def{select}{xx*}{
12 %{name}{selected}<optname><optval>..
13 <select name=\1>
14 \if(\args>2){
15 \for(i:=3)(i<=\args)(i+=2){
16 <option\if(\arg(i) eq \2){ selected} value=\cdata{\arg(i)}>
17 \arg(i+1)
18 }
19 }{
20 \2
21 }
22 </select>
23}
24\def{button}{?x}{
25 %[option]{value}
26 <input type=submit name=\on.arg{0}{\0}{cmd} value=\cdata{\1}>
27}
28\def{variable}{xx}{
29 %{name}{value}
30 <input type=hidden name=\1 value=\cdata{\2}>
31}
32\def{radio}{xx?}{
33 %{name}{value}[bool]
34 <input type=radio name=\1 value=\cdata{\2}\if{\0}{ checked}>
35}
36\def{target}{x}{}
37\def{href}{xx}{
38 %{uri}{name}
39 <a href=\cdata{\1}\target{\1}>\2</a>
40}
41\def{iref}{xx}{
42 %{uri}{image}
43 <a href=\cdata{\1}\target{\1}><img border=0 src=\cdata{\2}></a>
44}
45\def{form}{?x}{
46 %<uri>{body}
47 <form method=post action=/POST\on.arg{0}{\0}{\req.uri}\target{\0}>
48 \1
49 </form>
50}
51\def{form.multi}{?x}{
52 %{body}
53 <form method=post enctype=multipart/form-data action=/POST\on.arg{0}{\0}{\req.uri}\target{\0}>
54 \1
55 </form>
56}
57\def{input}{xx?}{
58 %{name}{size}[value]
59 <input type=text name=\1 size=\2\on.arg{0}{ value=\cdata{\0}}>
60}
61\def{passwd}{xx?}{
62 %{name}{size}[value]
63 <input type=password name=\1 size=\2\on.arg{0}{ value=\cdata{\0}}>
64}
65\def{check}{xx?}{
66 %{name}{value}[bool]
67 <input type=checkbox name=\1 value=\cdata{\2}\if{\0}{ checked}>
68}
69\def{file}{?xx}{
70 %{name}{size}[value]
71 <input type=file\on.arg{0}{ accept=\cdata{\0}} name=\1 size=\2>
72}
73\def{text}{xxx?}{
74 %{name}{row}{col}[value]
75 <textarea name=\1 rows=\2 cols=\3>
76 \mask.html{\4}
77 </textarea>
78}
79\def{image}{?x}{
80 %[options]{body}
81 <img\on.arg{0}{ \0} src=\cdata{\1}>
82}
83\def{table}{?x}{
84 %[options]{body}
85 <table\on.arg{0}{ \0}>
86 \1
87 </table>
88}
89\def{th}{?x}{
90 %[options]{body}
91 <th\on.arg{0}{ \0}>
92 \1
93 </th>
94}
95\def{tr}{?x}{
96 %[options]{body}
97 <tr\on.arg{0}{ \0}>
98 \1
99 </tr>
100}
101\def{td}{?x}{
102 %[options]{body}
103 <td\on.arg{0}{ \0}>\on.arg{1}{\1}{\space}</td>
104}
105\def{font}{?x}{
106 %[options]{body}
107 <font\on.arg{0}{ \0}>\1</font>
108}
109\def{ul}{?x}{
110 %[options]{body}
111 <ul\on.arg{0}{ \0}>
112 \1
113 </ul>
114}
115\def{li}{?x}{
116 %[options]{body}
117 <li\on.arg{0}{ \0}>\1</li>
118}
119\def{h1}{?x}{
120 %[options]{body}
121 <h1\on.arg{0}{ \0}>\1</h1>
122}
123\def{h2}{?x}{
124 %[options]{body}
125 <h2\on.arg{0}{ \0}>\1</h2>
126}
127\def{h3}{?x}{
128 %[options]{body}
129 <h3\on.arg{0}{ \0}>\1</h3>
130}
131\def{h4}{?x}{
132 %[options]{body}
133 <h4\on.arg{0}{ \0}>\1</h4>
134}
135\def{h5}{?x}{
136 %[options]{body}
137 <h5\on.arg{0}{ \0}>\1</h5>
138}
139\def{h6}{?x}{
140 %[options]{body}
141 <h6\on.arg{0}{ \0}>\1</h6>
142}
143\def{center}{?x}{
144 %[options]{body}
145 <center\on.arg{0}{ \0}>\1</center>
146}
147\def{body}{?x}{
148 %[options]{body}
149 <body\on.arg{0}{ \0}>
150 \1
151 </body>
152}