# HG changeset patch # User Edouard Tisserant # Date 1656075404 -7200 # Node ID c2f7e9bda366b350cfcb8976a8b14fa9a7835ab2 # Parent 27d298c6f96167127746573cb9e0081e140017b9 SVGHMI: update generated XSLT files diff -r 27d298c6f961 -r c2f7e9bda366 svghmi/analyse_widget.xslt --- a/svghmi/analyse_widget.xslt Fri Jun 24 10:46:26 2022 +0200 +++ b/svghmi/analyse_widget.xslt Fri Jun 24 14:56:44 2022 +0200 @@ -395,7 +395,7 @@ - Printf-like formated text display + Printf-like formated text display printf-like format string when not given as svg:text diff -r 27d298c6f961 -r c2f7e9bda366 svghmi/gen_index_xhtml.xslt --- a/svghmi/gen_index_xhtml.xslt Fri Jun 24 10:46:26 2022 +0200 +++ b/svghmi/gen_index_xhtml.xslt Fri Jun 24 14:56:44 2022 +0200 @@ -1476,21 +1476,33 @@ function set_activation_state(eltsub, state){ - if(eltsub.active_elt_placeholder == undefined){ - - eltsub.active_elt_placeholder = document.createComment(""); - - eltsub.active_elt.parentNode.insertBefore(eltsub.active_elt_placeholder, eltsub.active_elt); - - eltsub.inactive_elt_placeholder = document.createComment(""); - - eltsub.inactive_elt.parentNode.insertBefore(eltsub.inactive_elt_placeholder, eltsub.inactive_elt); - - } - - (state?_show:_hide)(eltsub.active_elt, eltsub.active_elt_placeholder); - - ((state || state==undefined)?_hide:_show)(eltsub.inactive_elt, eltsub.inactive_elt_placeholder); + if(eltsub.active_elt != undefined){ + + if(eltsub.active_elt_placeholder == undefined){ + + eltsub.active_elt_placeholder = document.createComment(""); + + eltsub.active_elt.parentNode.insertBefore(eltsub.active_elt_placeholder, eltsub.active_elt); + + } + + (state?_show:_hide)(eltsub.active_elt, eltsub.active_elt_placeholder); + + } + + if(eltsub.inactive_elt != undefined){ + + if(eltsub.inactive_elt_placeholder == undefined){ + + eltsub.inactive_elt_placeholder = document.createComment(""); + + eltsub.inactive_elt.parentNode.insertBefore(eltsub.inactive_elt_placeholder, eltsub.inactive_elt); + + } + + ((state || state==undefined)?_hide:_show)(eltsub.inactive_elt, eltsub.inactive_elt_placeholder); + + } } @@ -2075,6 +2087,7 @@ + @@ -2082,13 +2095,27 @@ - - + + - widget must have a + widget (id= + + ) must have a element - + + + + + + + + + + + + + @@ -2108,15 +2135,29 @@ - - + + - widget must have a + widget (id= + + ) must have a / element - + + + + + + + + + + + + + /* missing @@ -2683,6 +2724,7 @@ /active /inactive + } @@ -2710,6 +2752,7 @@ /active /inactive + } @@ -3482,7 +3525,7 @@ - Printf-like formated text display + Printf-like formated text display printf-like format string when not given as svg:text @@ -3500,7 +3543,15 @@ dispatch(value, oldval, index) { - this.fields[index] = value; + this.fields[index] = value; + + if(!this.ready){ + + this.readyfields[index] = true; + + this.ready = this.readyfields.every(x=>x); + + } this.request_animate(); @@ -3548,6 +3599,20 @@ ], + + + false + + , + + + + readyfields: [ + + ], + + ready: false, + animate: function(){ @@ -3562,28 +3627,30 @@ let str = vsprintf(this.format,this.fields); - multiline_to_svg_text(this.format_elt, str); + multiline_to_svg_text(this.format_elt, str, !this.ready); let str = this.args.length == 1 ? vsprintf(this.args[0],this.fields) : this.fields.join(' '); - multiline_to_svg_text(this.element, str); + multiline_to_svg_text(this.element, str, !this.ready); }, - + + + init: function() { - init: function() { - this.format = svg_text_to_multiline(this.format_elt); - }, - + this.animate(); + + }, + @@ -4782,6 +4849,10 @@ } + + + display = ""; + } @@ -4862,6 +4933,8 @@ this.value_elt.style.pointerEvents = "none"; + this.animate(); + id(" @@ -4871,6 +4944,10 @@ "); + + this.value_elt.textContent = ""; + + }, @@ -7925,6 +8002,7 @@ /active /inactive + } @@ -10761,9 +10839,9 @@ - function multiline_to_svg_text(elt, str) { - - str.split('\n').map((line,i) => {elt.children[i].textContent = line;}); + function multiline_to_svg_text(elt, str, blank) { + + str.split('\n').map((line,i) => {elt.children[i].textContent = blank?"":line;}); }