nitro.hrl 13 KB

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