nitro.hrl 13 KB

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