Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 1.17 KB

xjs.md

File metadata and controls

44 lines (35 loc) · 1.17 KB

XJS

Overview

In all XJS documentation we will call special object any object with an implicit attribute name. That is any object with an attribute named "0", like {boolean init: true} for instance. Other objects, strings, numbers and so on are called standard values.

Preprocessed macros

Expand variables and return the resulting object.

A variable is written like this %VarName%, and it is set like this: %VarName%: "blabla". The value of a variable can be of any type. Variables defined in the value of another variables are expanded only when the parent variable is expanded.

{View SECTION
  %Button%: {tfw.view.button type: %Type% }
  %Type%: primary
  [
    {ARTICLE class: thm-bg3 %Button%}
    {ARTICLE class: thm-bgSL %Button%}
  ]}

It also possible to concatenate variables with the "+" syntax:

view.attribs: {
  duration: {String}
  duration-selected: {Boolean true}
  level: {String}
  level-selected: {Boolean true}
}
%selected%: "-selected"
%Component%: {tfw.view.checkbox value: {Bind %type%+%selected%} content: {Bind %type%}}
[
  {%Component% %type%: duration}
  {%Component% %type%: level}
]