diff -r 5243c2a2f7f8 -r 7bdb766c2a4d svghmi/widget_switch.ysl2 --- a/svghmi/widget_switch.ysl2 Thu Apr 15 09:15:23 2021 +0200 +++ b/svghmi/widget_switch.ysl2 Sun May 02 23:01:08 2021 +0200 @@ -1,8 +1,7 @@ // widget_switch.ysl2 -template "widget[@type='Switch']", mode="widget_class" +widget_class("Switch") || - class SwitchWidget extends Widget{ frequency = 5; dispatch(value) { for(let choice of this.choices){ @@ -13,10 +12,9 @@ } } } - } || -template "widget[@type='Switch']", mode="widget_defs" { +widget_defs("Switch") { param "hmi_element"; | choices: [ const "regex",!"'^(\"[^\"].*\"|\-?[0-9]+|false|true)(#.*)?$'"!;