{% macro build_widget_checkbox(param_group, widget) %}{% endmacro %} {# https://ru.stackoverflow.com/questions/1241064 #} {% macro build_widget_number(param_group, widget) %}{% endmacro %} {% macro js_build_number_number_validator(widget) %}{{ '{' }}{% if widget['min'] %}min:{{ widget['min'] }},{% endif %}{% if widget['max'] %}max:{{ widget['max'] }},{% endif %}{% if widget['step'] %}step:{{ widget['step'] }}{% endif %}{{ '}' }}{% endmacro %} {% macro build_widget_number_int(param_group, widget) %}{% endmacro %} {% macro build_widget_select(param_group, widget) %}{% endmacro %} {% macro build_widget_watch(param_group, widget) %}{% endmacro %} {% macro build_widget_watch_expr(param_group, widget) %}{% endmacro %} {% macro build_widget_modulation_modcod(param_group, widget) %}{% endmacro %} {% macro build_widget_modulation_speed(param_group, widget) %}{% endmacro %} {% macro build_widget_flex_container(param_group, widget) %}
Widget '{{ widget.widget }}' not defined!
{{ widget }}
{% endif %} {% endmacro %} {% macro build_getter_js(param_group, widget) %}{% if widget.widget in ['flex-container', 'settings-container', 'h2', 'h3', 'submit', 'watch', 'watch-expr'] %}null{% elif widget.widget in ['checkbox', 'number', 'select', 'ip-address', 'modulation-modcod', 'modulation-speed', 'text'] %}this.param{{ param_group | title }}.{{ widget.name }}{% elif widget.widget == 'number-int' %}parseFloat(this.param{{ param_group | title }}.{{ widget.name }}.replace(/[^0-9,.]/g, '').replace(',', '.')){% else %}Widget '{{ widget.widget }}' not defined!
{{ widget }}
{% endif %}{% endmacro %} {% macro build_setter_js(param_group, widget, expr) %}{% if widget.widget in ['flex-container', 'settings-container', 'h2', 'h3', 'submit', 'watch', 'watch-expr'] %}null{% elif widget.widget in ['checkbox', 'number', 'select', 'ip-address', 'modulation-modcod', 'modulation-speed', 'text'] %}this.param{{ param_group | title }}.{{ widget.name }} = {{ expr }}{% elif widget.widget == 'number-int' %}this.param{{ param_group | title }}.{{ widget.name }} = this.inputFormatNumber({{ expr }}, {{ js_build_number_number_validator(widget) }}){% else %}Widget '{{ widget.widget }}' not defined!
{{ widget }}
{% endif %}{% endmacro %} {% macro build_setter(param_group, widget, expr) %}{% if widget.widget in ['flex-container', 'settings-container', 'h2', 'h3', 'submit', 'watch', 'watch-expr'] %}null{% elif widget.widget in ['checkbox', 'number', 'select', 'ip-address', 'modulation-modcod', 'modulation-speed', 'text'] %}param{{ param_group | title }}.{{ widget.name }} = {{ expr }}{% elif widget.widget == 'number-int' %}param{{ param_group | title }}.{{ widget.name }} = inputFormatNumber({{ expr }}, {{ js_build_number_number_validator(widget) }}){% else %}Widget '{{ widget.widget }}' not defined!
{{ widget }}
{% endif %}{% endmacro %}