4814 <xsl:text> |
4814 <xsl:text> |
4815 </xsl:text> |
4815 </xsl:text> |
4816 <xsl:text>} |
4816 <xsl:text>} |
4817 </xsl:text> |
4817 </xsl:text> |
4818 </xsl:template> |
4818 </xsl:template> |
|
4819 <xsl:template match="widget[@type='Image']" mode="widget_desc"> |
|
4820 <type> |
|
4821 <xsl:value-of select="@type"/> |
|
4822 </type> |
|
4823 <longdesc> |
|
4824 <xsl:text>If Image widget is a svg:image element, then href content is replaced by |
|
4825 </xsl:text> |
|
4826 <xsl:text>value of given variable. |
|
4827 </xsl:text> |
|
4828 </longdesc> |
|
4829 <shortdesc> |
|
4830 <xsl:text>Image display</xsl:text> |
|
4831 </shortdesc> |
|
4832 </xsl:template> |
|
4833 <xsl:template match="widget[@type='Image']" mode="widget_class"> |
|
4834 <xsl:text>class </xsl:text> |
|
4835 <xsl:text>ImageWidget</xsl:text> |
|
4836 <xsl:text> extends Widget{ |
|
4837 </xsl:text> |
|
4838 <xsl:text> frequency = 5; |
|
4839 </xsl:text> |
|
4840 <xsl:text> dispatch(value, oldval, index) { |
|
4841 </xsl:text> |
|
4842 <xsl:text> if (index == 0) { |
|
4843 </xsl:text> |
|
4844 <xsl:text> this.given_url = value; |
|
4845 </xsl:text> |
|
4846 <xsl:text> this.ready = true; |
|
4847 </xsl:text> |
|
4848 <xsl:text> this.request_animate(); |
|
4849 </xsl:text> |
|
4850 <xsl:text> } |
|
4851 </xsl:text> |
|
4852 <xsl:text> } |
|
4853 </xsl:text> |
|
4854 <xsl:text>} |
|
4855 </xsl:text> |
|
4856 </xsl:template> |
|
4857 <xsl:template match="widget[@type='Image']" mode="widget_defs"> |
|
4858 <xsl:param name="hmi_element"/> |
|
4859 <xsl:variable name="disability"> |
|
4860 <xsl:call-template name="defs_by_labels"> |
|
4861 <xsl:with-param name="hmi_element" select="$hmi_element"/> |
|
4862 <xsl:with-param name="labels"> |
|
4863 <xsl:text>/disabled</xsl:text> |
|
4864 </xsl:with-param> |
|
4865 <xsl:with-param name="mandatory" select="'no'"/> |
|
4866 </xsl:call-template> |
|
4867 </xsl:variable> |
|
4868 <xsl:value-of select="$disability"/> |
|
4869 <xsl:variable name="has_disability" select="string-length($disability)>0"/> |
|
4870 <xsl:text> given_url: "", |
|
4871 </xsl:text> |
|
4872 <xsl:text> ready: false, |
|
4873 </xsl:text> |
|
4874 <xsl:text> animate: function(){ |
|
4875 </xsl:text> |
|
4876 <xsl:text> this.element.setAttribute('href', this.given_url); |
|
4877 </xsl:text> |
|
4878 <xsl:text> }, |
|
4879 </xsl:text> |
|
4880 <xsl:text> |
|
4881 </xsl:text> |
|
4882 <xsl:text> init: function() { |
|
4883 </xsl:text> |
|
4884 <xsl:text> this.animate(); |
|
4885 </xsl:text> |
|
4886 <xsl:text> }, |
|
4887 </xsl:text> |
|
4888 </xsl:template> |
4819 <xsl:template match="widget[@type='Input']" mode="widget_desc"> |
4889 <xsl:template match="widget[@type='Input']" mode="widget_desc"> |
4820 <type> |
4890 <type> |
4821 <xsl:value-of select="@type"/> |
4891 <xsl:value-of select="@type"/> |
4822 </type> |
4892 </type> |
4823 <longdesc> |
4893 <longdesc> |
5245 <xsl:choose> |
5315 <xsl:choose> |
5246 <xsl:when test="contains($suffix,'=')"> |
5316 <xsl:when test="contains($suffix,'=')"> |
5247 <xsl:variable name="name" select="substring-before($suffix,'=')"/> |
5317 <xsl:variable name="name" select="substring-before($suffix,'=')"/> |
5248 <xsl:if test="$expr/@name[. != $name]"> |
5318 <xsl:if test="$expr/@name[. != $name]"> |
5249 <xsl:message terminate="yes"> |
5319 <xsl:message terminate="yes"> |
5250 <xsl:text>JsonTable : missplaced '=' or inconsistent names in Json data expressions.</xsl:text> |
5320 <xsl:text>JsonTable : misplaced '=' or inconsistent names in Json data expressions.</xsl:text> |
5251 </xsl:message> |
5321 </xsl:message> |
5252 </xsl:if> |
5322 </xsl:if> |
5253 <xsl:attribute name="name"> |
5323 <xsl:attribute name="name"> |
5254 <xsl:value-of select="$name"/> |
5324 <xsl:value-of select="$name"/> |
5255 </xsl:attribute> |
5325 </xsl:attribute> |
5318 <xsl:choose> |
5388 <xsl:choose> |
5319 <xsl:when test="count($from_textstylelist) > 0"> |
5389 <xsl:when test="count($from_textstylelist) > 0"> |
5320 <xsl:variable name="content_expr" select="$expressions/expression[2]/@content"/> |
5390 <xsl:variable name="content_expr" select="$expressions/expression[2]/@content"/> |
5321 <xsl:if test="string-length($content_expr) = 0 or $expressions/expression[2]/@name != 'textContent'"> |
5391 <xsl:if test="string-length($content_expr) = 0 or $expressions/expression[2]/@name != 'textContent'"> |
5322 <xsl:message terminate="yes"> |
5392 <xsl:message terminate="yes"> |
5323 <xsl:text>Clones (svg:use) in JsonTable Widget pointing to a HMI:TextStyleList widget or item must have a "textContent=.someVal" assignement following value expression in label.</xsl:text> |
5393 <xsl:text>Clones (svg:use) in JsonTable Widget pointing to a HMI:TextStyleList widget or item must have a "textContent=.someVal" assignment following value expression in label.</xsl:text> |
5324 </xsl:message> |
5394 </xsl:message> |
5325 </xsl:if> |
5395 </xsl:if> |
5326 <xsl:text> { |
5396 <xsl:text> { |
5327 </xsl:text> |
5397 </xsl:text> |
5328 <xsl:text> let elt = id("</xsl:text> |
5398 <xsl:text> let elt = id("</xsl:text> |
5349 <xsl:value-of select="$value_expr"/> |
5419 <xsl:value-of select="$value_expr"/> |
5350 <xsl:text>); |
5420 <xsl:text>); |
5351 </xsl:text> |
5421 </xsl:text> |
5352 </xsl:otherwise> |
5422 </xsl:otherwise> |
5353 </xsl:choose> |
5423 </xsl:choose> |
|
5424 </xsl:template> |
|
5425 <xsl:template mode="json_table_elt_render" match="svg:image"> |
|
5426 <xsl:param name="expressions"/> |
|
5427 <xsl:variable name="value_expr" select="$expressions/expression[1]/@content"/> |
|
5428 <xsl:text> id("</xsl:text> |
|
5429 <xsl:value-of select="@id"/> |
|
5430 <xsl:text>").setAttribute('href', String(</xsl:text> |
|
5431 <xsl:value-of select="$value_expr"/> |
|
5432 <xsl:text>)); |
|
5433 </xsl:text> |
5354 </xsl:template> |
5434 </xsl:template> |
5355 <func:function name="func:filter_non_widget_label"> |
5435 <func:function name="func:filter_non_widget_label"> |
5356 <xsl:param name="elt"/> |
5436 <xsl:param name="elt"/> |
5357 <xsl:param name="widget_elts"/> |
5437 <xsl:param name="widget_elts"/> |
5358 <xsl:variable name="eltid"> |
5438 <xsl:variable name="eltid"> |