// widget_cloudimage.ysl2
widget_desc("CloudImage") {
If CloudImage widget is a svg:image element, then href content is replaced by
link to the file whose name is the value of given variable, being served from
/media/data/cloud folder.
shortdesc > Image display
widget_class("CloudImage")
dispatch(value, oldval, index) {
this.given_url = "cloudfolder?image=" + value;
widget_defs("CloudImage") {
| this.element.setAttribute('href', this.given_url);
gen_index_xhtml { // following content is only available when generating xhtml file
// strip inkscape embedded bitmap when it is meant to be replaced by HMI:CloudImage widget
svgtmpl "svg:image[starts-with(@inkscape:label, 'HMI:CloudImage')]", mode="inline_svg" {
apply "@*[not(contains(name(), 'href'))] | node()", mode="inline_svg";