nitro.hrl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. -ifndef(NITRO_HRL).
  2. -define(NITRO_HRL, true).
  3. -define(DEFAULT_BASE, {?ELEMENT_BASE([])} ).
  4. -define(DEFAULT_BASE_TAG(Tag), {?ELEMENT_BASE([], Tag, [])} ).
  5. -define(ELEMENT_BASE(Module), ?ELEMENT_BASE(Module, [], []) ).
  6. -define(ELEMENT_BASE(Module, Tag, Delegate),
  7. ancestor = element, id = [], module = Module, delegate = Delegate, validation = [],
  8. validate = [], actions = [], class = [], style = [], source = [], onmouseover = [], onmouseout = [], onmousemove = [],
  9. onkeypress = [], onchange = [], onkeyup = [], onkeydown = [], onclick = [],
  10. data_fields = [], aria_states = [], body = [], role = [], tabindex = [], show_if = true,
  11. html_tag = Tag, title = [], postback = [], accesskey = [], contenteditable = [],
  12. contextmenu = [], dir = [], draggable = [], dropzone = [], hidden = [], lang = [],
  13. spellcheck = [], translate = [], onblur = [], onerror = [], onfocus = [],
  14. onmessage = [], onresize = [], bind = []).
  15. -define(ACTION_BASE(Module), ancestor = action, trigger = [], target = [], module = Module, actions = [], source = [] ).
  16. -define(CTRL_BASE(Module), ?ELEMENT_BASE(Module, [], Module)).
  17. -record(element, {?ELEMENT_BASE([])} ).
  18. -record(literal, {?ELEMENT_BASE(element_literal), html_encode = true} ).
  19. -record(dtl, {?ELEMENT_BASE(element_dtl), file = "index", bindings = [], app = web, folder="priv/templates", ext = "html", bind_script = true, js_escape = false} ).
  20. -record(list, {?ELEMENT_BASE(element_list), numbered = false} ).
  21. -record(dropdown, {?ELEMENT_BASE(element_dropdown), options, value, multiple = false, disabled = false, name} ).
  22. -record(radiogroup, {?ELEMENT_BASE(element_radiogroup)} ).
  23. -record(spinner, {?ELEMENT_BASE(element_spinner), image = "/priv/static/spinner.gif"} ).
  24. %% HTML Document meta
  25. -record(base, {?ELEMENT_BASE(element_meta_base), href = [], target = []} ).
  26. -record(head, ?DEFAULT_BASE).
  27. -record(meta_link, {?ELEMENT_BASE(element_meta_link), href = [], hreflang = [], media = [], rel = [], sizes = [], type = []} ).
  28. -record(meta, {?ELEMENT_BASE(element_meta), charset = [], content = [], http_equiv = [], name = [], type = []} ).
  29. -record(style, {?ELEMENT_BASE(element_style), media = [], scoped = [], type = []} ).
  30. -record(title, ?DEFAULT_BASE).
  31. %% HTML Edits
  32. -record('del', {?ELEMENT_BASE(element_del), cite = [], datetime} ).
  33. -record(ins, {?ELEMENT_BASE(element_ins), cite = [], datetime} ).
  34. %% HTML Embedded
  35. -record(area, {?ELEMENT_BASE(element_area), alt, coords, href, hreflang, media, target, rel, shape, type} ).
  36. -record(audio, {?ELEMENT_BASE(element_audio), autoplay, controls, loop, mediagroup, muted, preload, src, width} ).
  37. -record(canvas, {?ELEMENT_BASE(element_canvas), height, width} ).
  38. -record(embed, {?ELEMENT_BASE(element_embed), height, src, type, width} ).
  39. -record(iframe, {?ELEMENT_BASE(element_iframe), height, name, sandbox, seamless, src, srcdoc, width} ).
  40. -record(image, {?ELEMENT_BASE(element_image), alt, height, ismap, src, usemap, width, image} ).
  41. -record(map, {?ELEMENT_BASE(element_map), name} ).
  42. -record(object, {?ELEMENT_BASE(element_object), data, form, height, name, type, usemap, width} ).
  43. -record(param, {?ELEMENT_BASE(element_param), name, value} ).
  44. -record(source, {?ELEMENT_BASE(element_source), media, src, type} ).
  45. -record(track, {?ELEMENT_BASE(element_track), default, kind, label, src, srclang} ).
  46. -record(video, {?ELEMENT_BASE(element_video), autoplay, controls, height, loop, mediagroup, muted, poster, preload, src, width} ).
  47. %% HTML Form
  48. -record(button, {?ELEMENT_BASE(element_button), autofocus = [], disabled = [], form = [], formaction = [], formenctype = [], formmethod = [], formtarget = [], formnovalidate = [], name = [], type = <<"button">>, value = []} ).
  49. -record(datalist, ?DEFAULT_BASE).
  50. -record(fieldset, {?ELEMENT_BASE(element_fieldset), disabled = [], form = [], name = [], legend = []} ).
  51. -record(form, {?ELEMENT_BASE(element_form), accept_charset = [], action = [], autocomplete = [], enctype = [], method = [], name = [], novalidate = [], target = []} ).
  52. -record(keygen, {?ELEMENT_BASE(element_keygen), autofocus = [], challenge = [], disabled = [], form = [], keytype = [], name = []} ).
  53. -record(legend, ?DEFAULT_BASE).
  54. -record(label, {?ELEMENT_BASE(element_label), for = [], form = []} ).
  55. -record(meter, {?ELEMENT_BASE(element_meter), high = [], low = [], max = [], min = [], optimum = [], value = []} ).
  56. -record(optgroup, {?ELEMENT_BASE(element_select), disabled = [], label = []} ).
  57. -record(option, {?ELEMENT_BASE(element_select), disabled = [], label = [], selected = false, value = []} ).
  58. -record(output, {?ELEMENT_BASE(element_output), for, form, name} ).
  59. -record(progress, {?ELEMENT_BASE(element_progress), max = [], value = []} ).
  60. -record(select, {?ELEMENT_BASE(element_select), multi_select = false, optgroup = [], autofocus = [], disabled = [], form = [], multiple = [], name = [], required = [], size = []} ).
  61. -record(textarea, {?ELEMENT_BASE(element_textarea), autofocus = [], cols = [], dirname = [], disabled = [], form = [], maxlength, name, placeholder, readonly = [], required = [], rows = [], wrap = [], value = []} ).
  62. %% HTML Form inputs
  63. -record(input, {?ELEMENT_BASE(element_input), required, autocomplete, autofocus, disabled, form, name, value, type = [], checked = false, placeholder, multiple, min, max, pattern, accept} ).
  64. -record(input_button, {?ELEMENT_BASE(element_input_button), autofocus, disabled, form, name, value} ).
  65. -record(checkbox, {?ELEMENT_BASE(element_checkbox), autofocus, checked = false, disabled, form, name, required, value} ).
  66. -record(color, {?ELEMENT_BASE(element_color), autocomplete, autofocus, disabled, form, list, name, value} ).
  67. -record(date, {?ELEMENT_BASE(element_date), autocomplete, autofocus, disabled, form, list, max, min, name, step, readonly, required, value} ).
  68. -record(datetime, {?ELEMENT_BASE(element_datetime), autocomplete, autofocus, disabled, form, list, max, min, name, step, readonly, required, value} ).
  69. -record(datetime_local,{?ELEMENT_BASE(element_datetime_local), autocomplete, autofocus, disabled, form, list, max, min, name, step, readonly, required, value} ).
  70. -record(email, {?ELEMENT_BASE(element_email), autocomplete, autofocus, disabled, form, list, maxlength, multiple, name, pattern, placeholder, readonly, required, size, value} ).
  71. -record(file, {?ELEMENT_BASE(element_file), accept, autofocus, disabled, form, multiple, name, required} ).
  72. -record(hidden, {?ELEMENT_BASE(element_hidden), disabled, form, name, value, html_name} ).
  73. -record(input_image, {?ELEMENT_BASE(element_input_image), alt, autofocus, disabled, form, formaction, formenctype, formmethod, formnovalue, formtarget, height, name, src, width} ).
  74. -record(month, {?ELEMENT_BASE(element_month), alt, autocomplete, autofocus, disabled, form, list, min, max, name, readonly, required, step, value} ).
  75. -record(number, {?ELEMENT_BASE(element_number), autocomplete, autofocus, disabled, form, list, max, min, name, placeholder, readonly, required, step, value} ).
  76. -record(password, {?ELEMENT_BASE(element_password), autocomplete, autofocus, disabled, form, maxlength, name, pattern, placeholder, readonly, required, size, value} ).
  77. -record(radio, {?ELEMENT_BASE(element_radio), autofocus, checked, disabled, form, name, required, value, html_name} ).
  78. -record(range, {?ELEMENT_BASE(element_range), autocomplete, autofocus, disabled, form, list, max = 100, min = 0, name, step = 1, value} ).
  79. -record(reset, {?ELEMENT_BASE(element_reset), autofocus, disabled, form, name, value} ).
  80. -record(search, {?ELEMENT_BASE(element_search), autocomplete, autofocus, dirname, disabled, form, list, maxlength, name, pattern, placeholder, readonly, required, size, value} ).
  81. -record(submit, {?ELEMENT_BASE(element_submit), autofocus, disabled, form, formaction, formenctype, formmethod, formnovalidate, formtarget, name, value, click} ).
  82. -record(tel, {?ELEMENT_BASE(element_tel), autocomplete, autofocus, disabled, form, list, maxlength, name, pattern, placeholder, readonly, required, size, value} ).
  83. -record(textbox, {?ELEMENT_BASE(element_textbox), autocomplete, autofocus, dirname, disabled, form, list, maxlength, name, pattern, placeholder, readonly, required, size, value} ).
  84. -record(input_time, {?ELEMENT_BASE(element_input_time), autocomplete, autofocus, disabled, form, list, max, min, name, step, readonly, required, value} ).
  85. -record(url, {?ELEMENT_BASE(element_url), autocomplete, autofocus, disabled, form, list, maxlength, name, pattern, placeholder, readonly, required, size, value} ).
  86. -record(week, {?ELEMENT_BASE(element_week), autocomplete, autofocus, disabled, form, list, max, min, name, readonly, required, step, value} ).
  87. %% HTML Interactive
  88. -record(command, {?ELEMENT_BASE(element_command), checked, disabled, icon, label, radiogroup, type = <<"command">>} ).
  89. -record(details, {?ELEMENT_BASE(element_details), open} ).
  90. -record(menu, {?ELEMENT_BASE(element_menu), label, type} ).
  91. -record(summary, ?DEFAULT_BASE).
  92. %% HTML Grouping content
  93. -record(blockquote, {?ELEMENT_BASE(element_blockquote), cite} ).
  94. -record(br, ?DEFAULT_BASE).
  95. -record(dd, ?DEFAULT_BASE).
  96. -record('div', ?DEFAULT_BASE_TAG(<<"div">>)).
  97. -record(dl, ?DEFAULT_BASE).
  98. -record(dt, ?DEFAULT_BASE).
  99. -record(figcaption, ?DEFAULT_BASE).
  100. -record(figure, ?DEFAULT_BASE).
  101. -record(hr, ?DEFAULT_BASE).
  102. -record(li, {?ELEMENT_BASE(element_li), value} ).
  103. -record(ol, ?DEFAULT_BASE).
  104. -record(p, ?DEFAULT_BASE).
  105. -record(panel, ?DEFAULT_BASE_TAG(<<"div">>)).
  106. -record(pre, ?DEFAULT_BASE).
  107. -record(ul, ?DEFAULT_BASE).
  108. %% HTML Root
  109. -record(html, {?ELEMENT_BASE(element_html), manifest} ).
  110. %% HTML Scripting
  111. -record(script, {?ELEMENT_BASE(element_script), async = [], charset = [], defer = [], src = [], type = []} ).
  112. -record(noscript, ?DEFAULT_BASE).
  113. %% HTML Sections
  114. -record(body, ?DEFAULT_BASE).
  115. -record(section, ?DEFAULT_BASE).
  116. -record(nav, ?DEFAULT_BASE).
  117. -record(article, ?DEFAULT_BASE).
  118. -record(aside, ?DEFAULT_BASE).
  119. -record(h1, ?DEFAULT_BASE).
  120. -record(h2, ?DEFAULT_BASE).
  121. -record(h3, ?DEFAULT_BASE).
  122. -record(h4, ?DEFAULT_BASE).
  123. -record(h5, ?DEFAULT_BASE).
  124. -record(h6, ?DEFAULT_BASE).
  125. -record(header, ?DEFAULT_BASE).
  126. -record(hgroup, ?DEFAULT_BASE).
  127. -record(footer, ?DEFAULT_BASE).
  128. -record(address, ?DEFAULT_BASE).
  129. -record(main, ?DEFAULT_BASE).
  130. %% HTML Table
  131. -record(caption, ?DEFAULT_BASE).
  132. -record(col, {?ELEMENT_BASE(element_col), span} ).
  133. -record(colgroup, {?ELEMENT_BASE(element_colgroup), col, span} ).
  134. -record(table, {?ELEMENT_BASE(element_table), caption, colgroup, border, footer, header} ).
  135. -record(tbody, ?DEFAULT_BASE).
  136. -record(td, {?ELEMENT_BASE(element_td), colspan = 1, headers, rowspan = 1, scope, bgcolor} ).
  137. -record(tfoot, ?DEFAULT_BASE).
  138. -record(th, {?ELEMENT_BASE(element_th), colspan = 1, headers, rowspan = 1, scope} ).
  139. -record(thead, ?DEFAULT_BASE).
  140. -record(tr, {?ELEMENT_BASE(element_tr), cells} ).
  141. %% HTML Text-level semantics
  142. -record(link, {?ELEMENT_BASE(element_link), href, hreflang, media, rel, target, type, url = "javascript:void(0);", download, name} ).
  143. -record(abbr, ?DEFAULT_BASE).
  144. -record(b, ?DEFAULT_BASE).
  145. -record(bdi, ?DEFAULT_BASE).
  146. -record(bdo, ?DEFAULT_BASE).
  147. -record(cite, ?DEFAULT_BASE).
  148. -record(code, ?DEFAULT_BASE).
  149. -record(dfn, ?DEFAULT_BASE).
  150. -record(em, ?DEFAULT_BASE).
  151. -record(i, ?DEFAULT_BASE).
  152. -record(kbd, ?DEFAULT_BASE).
  153. -record(mark, ?DEFAULT_BASE).
  154. -record(q, {?ELEMENT_BASE(element_q), cite}).
  155. -record(rt, ?DEFAULT_BASE).
  156. -record(rp, ?DEFAULT_BASE).
  157. -record(ruby, ?DEFAULT_BASE).
  158. -record(s, ?DEFAULT_BASE).
  159. -record(samp, ?DEFAULT_BASE).
  160. -record(small, ?DEFAULT_BASE).
  161. -record(span, ?DEFAULT_BASE).
  162. -record(strong, ?DEFAULT_BASE).
  163. -record(sub, ?DEFAULT_BASE).
  164. -record(sup, ?DEFAULT_BASE).
  165. -record('time', {?ELEMENT_BASE(element_time), datetime}).
  166. -record(u, ?DEFAULT_BASE).
  167. -record(var, ?DEFAULT_BASE).
  168. %% Extras
  169. -record(upload, {?CTRL_BASE(element_upload), name, value} ).
  170. %% HTML5 template
  171. -record(template, ?DEFAULT_BASE).
  172. -record(message, ?DEFAULT_BASE).
  173. -record(author, ?DEFAULT_BASE).
  174. -record(action, {?ACTION_BASE(undefined)} ).
  175. -record(wire, {?ACTION_BASE(action_wire)} ).
  176. -record(replace, {?ACTION_BASE(action_manage), elements} ).
  177. -record(insert, {?ACTION_BASE(action_manage), elements, position = beforeend} ).
  178. -record(multi, {?ACTION_BASE(action_manage)} ).
  179. -record(focus, {?ACTION_BASE(action_ui)} ).
  180. -record(api, {?ACTION_BASE(action_api), name, tag, delegate} ).
  181. -record(bind, {?ACTION_BASE(action_bind), type = click, postback} ).
  182. -record(alert, {?ACTION_BASE(action_alert), text} ).
  183. -record(confirm, {?ACTION_BASE(action_confirm), text, postback, delegate} ).
  184. -record(jq, {?ACTION_BASE(action_jq), property, method, args = [], right, format = "~s"} ).
  185. -record(transfer,{?ACTION_BASE(action_transfer), state, events = []} ).
  186. -endif.