├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── Towser.svg
├── build.hxml
├── haxelib.json
├── src
└── towser
│ ├── RenderFunction.hx
│ ├── RenderType.hx
│ ├── Towser.hx
│ ├── html
│ ├── Attribute.hx
│ ├── Attributes.hx
│ ├── Element.hx
│ ├── Event.hx
│ ├── Events.hx
│ ├── Html.hx
│ ├── Lazy.hx
│ ├── Node.hx
│ └── Text.hx
│ └── platform
│ ├── DomBuilder.hx
│ ├── HtmlHelper.hx
│ ├── LazyMap.hx
│ ├── client
│ ├── ClientDomBuilder.hx
│ └── ClientTowser.hx
│ ├── macro
│ ├── MacroDomBuilder.hx
│ └── MacroTowser.hx
│ └── server
│ ├── ServerDomBuilder.hx
│ └── ServerTowser.hx
└── tests
├── Main.hx
└── TestApp.hx
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: haxe
2 | haxe:
3 | # - "3.4.4"
4 | - development # the latest stable release defined in https://haxe.org/download/list/
5 | script:
6 | - haxe build.hxml
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Jeremy Meltingtallow
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # Towser [](https://travis-ci.org/PongoEngine/Towser) [](https://gitter.im/pongo-towser/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6 | 🐶Incremental Dom + Haxe + Elm Architechture + SSR
7 |
8 | ## Table of Contents
9 |
10 | - [About](#about)
11 | - [Current Tasks](#current-tasks)
12 | - [Features](#features)
13 | - [Hello World](#hello-world)
14 | - [Why Haxe and why Mutability?](#why-haxe-and-why-mutability)
15 |
16 | ## About
17 | **Towser is the Mutable Elm Architechture** built using Haxe and Google's Incremental-Dom. Towser can easily be adopted into any node framework for serverside rendering using the compiler define '-D backend'.
18 |
19 | ## Current Tasks
20 | Towser is fully functional for making MVU applications but is far from being complete. Below is what you can expect now and in the future.
21 | - [ ] Documentation
22 | - [x] MVU
23 | - [x] SSR Strings
24 | - [ ] Generic SSR functionality
25 | - [ ] Attribute / Element array pool
26 | - [ ] CMD line utility for new projects
27 | - [ ] Example projects
28 |
29 | ## Features
30 | A few of the features you get with Towser
31 | - One-way data flow
32 | - Get / Set model
33 | - Manually trigger renders
34 | - Lazy wrappers for render functions
35 | - Mutable Elm Architcture
36 |
37 | ## Hello World
38 | ```haxe
39 | import towser.RenderType;
40 | import towser.RenderFunction;
41 | import towser.html.Event;
42 | import towser.html.Attributes.*;
43 | import towser.html.Html.*;
44 | import towser.html.Events.*;
45 | import towser.Towser;
46 |
47 | class TestApp {
48 | public static function view(model:Model) : RenderFunction
49 | {
50 | return switch model.section {
51 | case Hello: div([class_("full-screen"), onclick(ChangeName.bind("Robot"))], [
52 | h1([], [text("Hello")]),
53 | p([], [text(model.name)])
54 | ]);
55 | case VoidElements: div([], [
56 | area([]),
57 | br([]),
58 | col([]),
59 | embed([]),
60 | hr([]),
61 | img([]),
62 | input([]),
63 | param([]),
64 | source([]),
65 | track([]),
66 | wbr([])
67 | ]);
68 | }
69 | }
70 |
71 | public static function update(towser :Towser, msg:Msg, model:Model) : RenderType
72 | {
73 | return switch msg {
74 | case ChangeName(name, e):
75 | model.name = name;
76 | FULL;
77 | case ChangeSection(section_):
78 | model.section = section_;
79 | FULL;
80 | }
81 | }
82 | }
83 |
84 | enum Msg {
85 | ChangeName(name :String, e :MouseEvent);
86 | ChangeSection(section :Section);
87 | }
88 |
89 | typedef Model =
90 | {
91 | var name :String;
92 | var section :Section;
93 | }
94 |
95 | enum Section
96 | {
97 | Hello;
98 | VoidElements;
99 | }
100 |
101 | ```
102 |
103 | ## Why Haxe and why Mutability?
104 | Haxe is a strongly typed programming language that transpiles to other target languages. It has many functional qualities like exhaustive pattern matching, first class functions, and currying to name a few. These functional features adapt to the Elm Architecture quite well given that Elm is a functional language. Additionaly Haxe has Abstracts which wrap concrete types. These abstract wrappers come with zero runtime cost and make for wonderful APIs. Lastly haxe has mutable data types. I love making games and although it is possible to make a purely functional game I would rather not.
105 |
106 | ### License
107 |
108 | Towser is [MIT licensed](./LICENSE).
109 |
--------------------------------------------------------------------------------
/Towser.svg:
--------------------------------------------------------------------------------
1 | Towser_LogoAsset 1
--------------------------------------------------------------------------------
/build.hxml:
--------------------------------------------------------------------------------
1 | -cp src/
2 | -cp tests/
3 | -main Main
4 | -D client
5 | -lib hx3compat
6 | --js out.js
7 | --no-output
8 |
9 | --next
10 |
11 | -cp src/
12 | -cp tests/
13 | -main Main
14 | -D backend
15 | -lib hx3compat
16 | --interp
17 |
--------------------------------------------------------------------------------
/haxelib.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "towser",
3 | "url" : "https://github.com/PongoEngine/Towser",
4 | "license": "MIT",
5 | "tags": ["incremental-dom", "declarative", "web", "framework", "elm", "architecture"],
6 | "description": "Incremental Dom + Haxe + Elm Architechture",
7 | "version": "0.1.1",
8 | "classPath": "src/",
9 | "releasenote": "Add Partial rendering",
10 | "contributors": ["Jeremy"],
11 | "dependencies": {}
12 | }
--------------------------------------------------------------------------------
/src/towser/RenderFunction.hx:
--------------------------------------------------------------------------------
1 | package towser;
2 |
3 | import towser.Towser;
4 |
5 | /**
6 | *
7 | */
8 | typedef RenderFunction = Towser -> Void;
--------------------------------------------------------------------------------
/src/towser/RenderType.hx:
--------------------------------------------------------------------------------
1 | package towser;
2 |
3 | import towser.html.Element;
4 |
5 | enum RenderType
6 | {
7 | NONE;
8 | FULL;
9 | PARTIAL(element :Element, render :RenderFunction);
10 | }
--------------------------------------------------------------------------------
/src/towser/Towser.hx:
--------------------------------------------------------------------------------
1 | package towser;
2 |
3 | import towser.platform.LazyMap;
4 |
5 | class Towser
6 | {
7 | public var markup (get, null) :String;
8 | public var model (get, set) :Model;
9 |
10 | public function new(element :String, update :Towser -> Msg -> Model -> RenderType, view :Model -> RenderFunction, model :Model) : Void
11 | {
12 | _arch = new
13 | #if backend towser.platform.server.ServerTowser(this, element, update, view, model);
14 | #elseif macro towser.platform.macro.MacroTowser(this, element, update, view, model);
15 | #elseif client towser.platform.client.ClientTowser(this, element, update, view, model);
16 | #end
17 | }
18 |
19 | public inline function update(msg :Msg) : Void
20 | {
21 | _arch.update(msg, this);
22 | }
23 |
24 | private inline function get_model() : Model
25 | {
26 | return _arch.getModel();
27 | }
28 |
29 | private inline function set_model(model :Model) : Model
30 | {
31 | _arch.setModel(model);
32 | return model;
33 | }
34 |
35 | private inline function get_markup() : String
36 | {
37 | return _arch.markup;
38 | }
39 |
40 | private var _arch
41 | #if backend :towser.platform.server.ServerTowser;
42 | #elseif macro :towser.platform.macro.MacroTowser;
43 | #elseif client :towser.platform.client.ClientTowser;
44 | #end
45 | @:allow(towser.html.Lazy)
46 | private var _lazyMap = new LazyMap();
47 | }
--------------------------------------------------------------------------------
/src/towser/html/Attribute.hx:
--------------------------------------------------------------------------------
1 | package towser.html;
2 |
3 | typedef Attribute = Towser -> Void;
--------------------------------------------------------------------------------
/src/towser/html/Attributes.hx:
--------------------------------------------------------------------------------
1 | package towser.html;
2 |
3 | import haxe.extern.EitherType;
4 | import towser.platform.DomBuilder;
5 |
6 | @:extern class Attributes
7 | {
8 | public static inline function accept(value :String) : Attribute
9 | {
10 | return (t) -> DomBuilder.attr("accept", value);
11 | }
12 |
13 | public static inline function acceptCharset(value :String) : Attribute
14 | {
15 | return (t) -> DomBuilder.attr("accept-charset", value);
16 | }
17 |
18 | public static inline function accesskey(value :String) : Attribute
19 | {
20 | return (t) -> DomBuilder.attr("accesskey", value);
21 | }
22 |
23 | public static inline function action(value :String) : Attribute
24 | {
25 | return (t) -> DomBuilder.attr("action", value);
26 | }
27 |
28 | public static inline function align(value :String) : Attribute
29 | {
30 | return (t) -> DomBuilder.attr("align", value);
31 | }
32 |
33 | public static inline function allow(value :String) : Attribute
34 | {
35 | return (t) -> DomBuilder.attr("allow", value);
36 | }
37 |
38 | public static inline function alt(value :String) : Attribute
39 | {
40 | return (t) -> DomBuilder.attr("alt", value);
41 | }
42 |
43 | public static inline function async(value :Bool) : Attribute
44 | {
45 | return function(t) {
46 | if(value) DomBuilder.attr("async", true);
47 | }
48 | }
49 |
50 | public static inline function autocapitalize(value :String) : Attribute
51 | {
52 | return (t) -> DomBuilder.attr("autocapitalize", value);
53 | }
54 |
55 | public static inline function autocomplete(value :Bool) : Attribute
56 | {
57 | return function(t) {
58 | if(value) DomBuilder.attr("autocomplete", true);
59 | }
60 | }
61 |
62 | public static inline function autofocus(value :Bool) : Attribute
63 | {
64 | return function(t) {
65 | if(value) DomBuilder.attr("autofocus", true);
66 | }
67 | }
68 |
69 | public static inline function autoplay(value :Bool) : Attribute
70 | {
71 | return function(t) {
72 | if(value) DomBuilder.attr("autoplay", true);
73 | }
74 | }
75 |
76 | public static inline function background(value :String) : Attribute
77 | {
78 | return (t) -> DomBuilder.attr("background", value);
79 | }
80 |
81 | public static inline function bgcolor(value :String) : Attribute
82 | {
83 | return (t) -> DomBuilder.attr("bgcolor", value);
84 | }
85 |
86 | public static inline function border(value :Bool) : Attribute
87 | {
88 | return function(t) {
89 | if(value) DomBuilder.attr("border", true);
90 | }
91 | }
92 |
93 | public static inline function buffered(value :String) : Attribute
94 | {
95 | return (t) -> DomBuilder.attr("buffered", value);
96 | }
97 |
98 | public static inline function challenge(value :Bool) : Attribute
99 | {
100 | return function(t) {
101 | if(value) DomBuilder.attr("challenge", true);
102 | }
103 | }
104 |
105 | public static inline function charset(value :String) : Attribute
106 | {
107 | return (t) -> DomBuilder.attr("charset", value);
108 | }
109 |
110 | public static inline function checked(value :Bool) : Attribute
111 | {
112 | return function(t) {
113 | if(value) DomBuilder.attr("checked", true);
114 | }
115 | }
116 |
117 | public static inline function cite(value :String) : Attribute
118 | {
119 | return (t) -> DomBuilder.attr("cite", value);
120 | }
121 |
122 | public static inline function class_(value :String) : Attribute
123 | {
124 | return (t) -> DomBuilder.attr("class", value);
125 | }
126 |
127 | public static inline function code(value :String) : Attribute
128 | {
129 | return (t) -> DomBuilder.attr("code", value);
130 | }
131 |
132 | public static inline function codebase(value :String) : Attribute
133 | {
134 | return (t) -> DomBuilder.attr("codebase", value);
135 | }
136 |
137 | public static inline function color(value :String) : Attribute
138 | {
139 | return (t) -> DomBuilder.attr("color", value);
140 | }
141 |
142 | public static inline function cols(value :String) : Attribute
143 | {
144 | return (t) -> DomBuilder.attr("cols", value);
145 | }
146 |
147 | public static inline function colspan(value :String) : Attribute
148 | {
149 | return (t) -> DomBuilder.attr("colspan", value);
150 | }
151 |
152 | public static inline function content(value :String) : Attribute
153 | {
154 | return (t) -> DomBuilder.attr("content", value);
155 | }
156 |
157 | public static inline function contenteditable(value :Bool) : Attribute
158 | {
159 | return function(t) {
160 | if(value) DomBuilder.attr("contenteditable", true);
161 | }
162 | }
163 |
164 | public static inline function contextmenu(value :String) : Attribute
165 | {
166 | return (t) -> DomBuilder.attr("contextmenu", value);
167 | }
168 |
169 | public static inline function controls(value :Bool) : Attribute
170 | {
171 | return function(t) {
172 | if(value) DomBuilder.attr("controls", true);
173 | }
174 | }
175 |
176 | public static inline function coords(value :String) : Attribute
177 | {
178 | return (t) -> DomBuilder.attr("coords", value);
179 | }
180 |
181 | public static inline function crossorigin(value :String) : Attribute
182 | {
183 | return (t) -> DomBuilder.attr("crossorigin", value);
184 | }
185 |
186 | public static inline function csp(value :String) : Attribute
187 | {
188 | return (t) -> DomBuilder.attr("csp", value);
189 | }
190 |
191 | public static inline function data(value :String) : Attribute
192 | {
193 | return (t) -> DomBuilder.attr("data", value);
194 | }
195 |
196 | public static inline function datetime(value :String) : Attribute
197 | {
198 | return (t) -> DomBuilder.attr("datetime", value);
199 | }
200 |
201 | public static inline function decoding(value :String) : Attribute
202 | {
203 | return (t) -> DomBuilder.attr("decoding", value);
204 | }
205 |
206 | public static inline function default_(value :Bool) : Attribute
207 | {
208 | return function(t) {
209 | if(value) DomBuilder.attr("default", true);
210 | }
211 | }
212 |
213 | public static inline function defer(value :Bool) : Attribute
214 | {
215 | return function(t) {
216 | if(value) DomBuilder.attr("defer", true);
217 | }
218 | }
219 |
220 | public static inline function dir(value :String) : Attribute
221 | {
222 | return (t) -> DomBuilder.attr("dir", value);
223 | }
224 |
225 | public static inline function directory(value :Bool) : Attribute
226 | {
227 | return function(t) {
228 | if(value) DomBuilder.attr("directory", true);
229 | }
230 | }
231 |
232 | public static inline function dirname(value :String) : Attribute
233 | {
234 | return (t) -> DomBuilder.attr("dirname", value);
235 | }
236 |
237 | public static inline function disabled(value :Bool) : Attribute
238 | {
239 | return function(t) {
240 | if(value) DomBuilder.attr("disabled", true);
241 | }
242 | }
243 |
244 | public static inline function download(value :String) : Attribute
245 | {
246 | return (t) -> DomBuilder.attr("download", value);
247 | }
248 |
249 | public static inline function draggable(value :String) : Attribute
250 | {
251 | return (t) -> DomBuilder.attr("draggable", value);
252 | }
253 |
254 | public static inline function dropzone(value :String) : Attribute
255 | {
256 | return (t) -> DomBuilder.attr("dropzone", value);
257 | }
258 |
259 | public static inline function enctype(value :String) : Attribute
260 | {
261 | return (t) -> DomBuilder.attr("enctype", value);
262 | }
263 |
264 | public static inline function enterkeyhint(value :String) : Attribute
265 | {
266 | return (t) -> DomBuilder.attr("enterkeyhint", value);
267 | }
268 |
269 | public static inline function for_(value :String) : Attribute
270 | {
271 | return (t) -> DomBuilder.attr("for", value);
272 | }
273 |
274 | public static inline function form(value :String) : Attribute
275 | {
276 | return (t) -> DomBuilder.attr("form", value);
277 | }
278 |
279 | public static inline function formaction(value :String) : Attribute
280 | {
281 | return (t) -> DomBuilder.attr("formaction", value);
282 | }
283 |
284 | public static inline function formenctype(value :String) : Attribute
285 | {
286 | return (t) -> DomBuilder.attr("formenctype", value);
287 | }
288 |
289 | public static inline function formmethod(value :String) : Attribute
290 | {
291 | return (t) -> DomBuilder.attr("formmethod", value);
292 | }
293 |
294 | public static inline function formnovalidate(value :Bool) : Attribute
295 | {
296 | return function(t) {
297 | if(value) DomBuilder.attr("formnovalidate", true);
298 | }
299 | }
300 |
301 | public static inline function formtarget(value :String) : Attribute
302 | {
303 | return (t) -> DomBuilder.attr("formtarget", value);
304 | }
305 |
306 | public static inline function headers(value :String) : Attribute
307 | {
308 | return (t) -> DomBuilder.attr("headers", value);
309 | }
310 |
311 | public static inline function height(value :String) : Attribute
312 | {
313 | return (t) -> DomBuilder.attr("height", value);
314 | }
315 |
316 | public static inline function hidden(value :Bool) : Attribute
317 | {
318 | return function(t) {
319 | if(value) DomBuilder.attr("hidden", true);
320 | }
321 | }
322 |
323 | public static inline function high(value :String) : Attribute
324 | {
325 | return (t) -> DomBuilder.attr("high", value);
326 | }
327 |
328 | public static inline function href(value :String) : Attribute
329 | {
330 | return (t) -> DomBuilder.attr("href", value);
331 | }
332 |
333 | public static inline function hreflang(value :String) : Attribute
334 | {
335 | return (t) -> DomBuilder.attr("hreflang", value);
336 | }
337 |
338 | public static inline function httpEquiv(value :String) : Attribute
339 | {
340 | return (t) -> DomBuilder.attr("http-equiv", value);
341 | }
342 |
343 | public static inline function icon(value :String) : Attribute
344 | {
345 | return (t) -> DomBuilder.attr("icon", value);
346 | }
347 |
348 | public static inline function id(value :String) : Attribute
349 | {
350 | return (t) -> DomBuilder.attr("id", value);
351 | }
352 |
353 | public static inline function importance(value :String) : Attribute
354 | {
355 | return (t) -> DomBuilder.attr("importance", value);
356 | }
357 |
358 | public static inline function integrity(value :String) : Attribute
359 | {
360 | return (t) -> DomBuilder.attr("integrity", value);
361 | }
362 |
363 | public static inline function intrinsicsize(value :String) : Attribute
364 | {
365 | return (t) -> DomBuilder.attr("intrinsicsize", value);
366 | }
367 |
368 | public static inline function inputmode(value :String) : Attribute
369 | {
370 | return (t) -> DomBuilder.attr("inputmode", value);
371 | }
372 |
373 | public static inline function ismap(value :Bool) : Attribute
374 | {
375 | return function(t) {
376 | if(value) DomBuilder.attr("ismap", true);
377 | }
378 | }
379 |
380 | public static inline function itemprop(value :String) : Attribute
381 | {
382 | return (t) -> DomBuilder.attr("itemprop", value);
383 | }
384 |
385 | public static inline function keytype(value :String) : Attribute
386 | {
387 | return (t) -> DomBuilder.attr("keytype", value);
388 | }
389 |
390 | public static inline function kind(value :String) : Attribute
391 | {
392 | return (t) -> DomBuilder.attr("kind", value);
393 | }
394 |
395 | public static inline function label(value :String) : Attribute
396 | {
397 | return (t) -> DomBuilder.attr("label", value);
398 | }
399 |
400 | public static inline function lang(value :String) : Attribute
401 | {
402 | return (t) -> DomBuilder.attr("lang", value);
403 | }
404 |
405 | public static inline function language(value :String) : Attribute
406 | {
407 | return (t) -> DomBuilder.attr("language", value);
408 | }
409 |
410 | public static inline function loading(value :String) : Attribute
411 | {
412 | return (t) -> DomBuilder.attr("loading", value);
413 | }
414 |
415 | public static inline function list(value :String) : Attribute
416 | {
417 | return (t) -> DomBuilder.attr("list", value);
418 | }
419 |
420 | public static inline function loop(value :Bool) : Attribute
421 | {
422 | return function(t) {
423 | if(value) DomBuilder.attr("loop", true);
424 | }
425 | }
426 |
427 | public static inline function low(value :String) : Attribute
428 | {
429 | return (t) -> DomBuilder.attr("low", value);
430 | }
431 |
432 | public static inline function manifest(value :String) : Attribute
433 | {
434 | return (t) -> DomBuilder.attr("manifest", value);
435 | }
436 |
437 | public static inline function max(value :String) : Attribute
438 | {
439 | return (t) -> DomBuilder.attr("max", value);
440 | }
441 |
442 | public static inline function maxlength(value :String) : Attribute
443 | {
444 | return (t) -> DomBuilder.attr("maxlength", value);
445 | }
446 |
447 | public static inline function minlength(value :String) : Attribute
448 | {
449 | return (t) -> DomBuilder.attr("minlength", value);
450 | }
451 |
452 | public static inline function media(value :String) : Attribute
453 | {
454 | return (t) -> DomBuilder.attr("media", value);
455 | }
456 |
457 | public static inline function method(value :String) : Attribute
458 | {
459 | return (t) -> DomBuilder.attr("method", value);
460 | }
461 |
462 | public static inline function min(value :String) : Attribute
463 | {
464 | return (t) -> DomBuilder.attr("min", value);
465 | }
466 |
467 | public static inline function multiple(value :Bool) : Attribute
468 | {
469 | return function(t) {
470 | if(value) DomBuilder.attr("multiple", true);
471 | }
472 | }
473 |
474 | public static inline function muted(value :Bool) : Attribute
475 | {
476 | return function(t) {
477 | if(value) DomBuilder.attr("muted", true);
478 | }
479 | }
480 |
481 | public static inline function name(value :String) : Attribute
482 | {
483 | return (t) -> DomBuilder.attr("name", value);
484 | }
485 |
486 | public static inline function novalidate(value :Bool) : Attribute
487 | {
488 | return function(t) {
489 | if(value) DomBuilder.attr("novalidate", true);
490 | }
491 | }
492 |
493 | public static inline function open(value :Bool) : Attribute
494 | {
495 | return function(t) {
496 | if(value) DomBuilder.attr("open", true);
497 | }
498 | }
499 |
500 | public static inline function optimum(value :String) : Attribute
501 | {
502 | return (t) -> DomBuilder.attr("optimum", value);
503 | }
504 |
505 | public static inline function pattern(value :String) : Attribute
506 | {
507 | return (t) -> DomBuilder.attr("pattern", value);
508 | }
509 |
510 | public static inline function ping(value :String) : Attribute
511 | {
512 | return (t) -> DomBuilder.attr("ping", value);
513 | }
514 |
515 | public static inline function placeholder(value :String) : Attribute
516 | {
517 | return (t) -> DomBuilder.attr("placeholder", value);
518 | }
519 |
520 | public static inline function poster(value :String) : Attribute
521 | {
522 | return (t) -> DomBuilder.attr("poster", value);
523 | }
524 |
525 | public static inline function preload(value :String) : Attribute
526 | {
527 | return (t) -> DomBuilder.attr("preload", value);
528 | }
529 |
530 | public static inline function radiogroup(value :String) : Attribute
531 | {
532 | return (t) -> DomBuilder.attr("radiogroup", value);
533 | }
534 |
535 | public static inline function readonly(value :Bool) : Attribute
536 | {
537 | return function(t) {
538 | if(value) DomBuilder.attr("readonly", true);
539 | }
540 | }
541 |
542 | public static inline function referrerpolicy(value :String) : Attribute
543 | {
544 | return (t) -> DomBuilder.attr("referrerpolicy", value);
545 | }
546 |
547 | public static inline function rel(value :String) : Attribute
548 | {
549 | return (t) -> DomBuilder.attr("rel", value);
550 | }
551 |
552 | public static inline function required(value :Bool) : Attribute
553 | {
554 | return function(t) {
555 | if(value) DomBuilder.attr("required", true);
556 | }
557 | }
558 |
559 | public static inline function reversed(value :Bool) : Attribute
560 | {
561 | return function(t) {
562 | if(value) DomBuilder.attr("reversed", true);
563 | }
564 | }
565 |
566 | public static inline function rows(value :String) : Attribute
567 | {
568 | return (t) -> DomBuilder.attr("rows", value);
569 | }
570 |
571 | public static inline function rowspan(value :String) : Attribute
572 | {
573 | return (t) -> DomBuilder.attr("rowspan", value);
574 | }
575 |
576 | public static inline function sandbox(value :String) : Attribute
577 | {
578 | return (t) -> DomBuilder.attr("sandbox", value);
579 | }
580 |
581 | public static inline function scope(value :String) : Attribute
582 | {
583 | return (t) -> DomBuilder.attr("scope", value);
584 | }
585 |
586 | public static inline function scoped(value :Bool) : Attribute
587 | {
588 | return function(t) {
589 | if(value) DomBuilder.attr("scoped", true);
590 | }
591 | }
592 |
593 | public static inline function selected(value :Bool) : Attribute
594 | {
595 | return function(t) {
596 | if(value) DomBuilder.attr("selected", true);
597 | }
598 | }
599 |
600 | public static inline function shape(value :String) : Attribute
601 | {
602 | return (t) -> DomBuilder.attr("shape", value);
603 | }
604 |
605 | public static inline function size(value :String) : Attribute
606 | {
607 | return (t) -> DomBuilder.attr("size", value);
608 | }
609 |
610 | public static inline function sizes(value :String) : Attribute
611 | {
612 | return (t) -> DomBuilder.attr("sizes", value);
613 | }
614 |
615 | public static inline function slot(value :String) : Attribute
616 | {
617 | return (t) -> DomBuilder.attr("slot", value);
618 | }
619 |
620 | public static inline function span(value :String) : Attribute
621 | {
622 | return (t) -> DomBuilder.attr("span", value);
623 | }
624 |
625 | public static inline function spellcheck(value :Bool) : Attribute
626 | {
627 | return function(t) {
628 | if(value) DomBuilder.attr("spellcheck", true);
629 | }
630 | }
631 |
632 | public static inline function src(value :String) : Attribute
633 | {
634 | return (t) -> DomBuilder.attr("src", value);
635 | }
636 |
637 | public static inline function srcdoc(value :String) : Attribute
638 | {
639 | return (t) -> DomBuilder.attr("srcdoc", value);
640 | }
641 |
642 | public static inline function srclang(value :String) : Attribute
643 | {
644 | return (t) -> DomBuilder.attr("srclang", value);
645 | }
646 |
647 | public static inline function srcset