SVGHMI: declares pages detachable requirements as an object, to find more efficiently common requirements svghmi
authorEdouard Tisserant
Mon, 02 Mar 2020 14:43:21 +0100
branchsvghmi
changeset 2848 c525b1083653
parent 2847 dffade5c83d3
child 2849 bb89a2fbb4e0
SVGHMI: declares pages detachable requirements as an object, to find more efficiently common requirements
svghmi/gen_index_xhtml.xslt
svghmi/gen_index_xhtml.ysl2
--- a/svghmi/gen_index_xhtml.xslt	Mon Mar 02 10:29:41 2020 +0100
+++ b/svghmi/gen_index_xhtml.xslt	Mon Mar 02 14:43:21 2020 +0100
@@ -489,10 +489,12 @@
       </xsl:for-each>
       <xsl:text>        ],
 </xsl:text>
-      <xsl:text>        required_detachables: [
+      <xsl:text>        required_detachables: {
 </xsl:text>
       <xsl:for-each select="$required_detachables">
-        <xsl:text>            detachable_elements["</xsl:text>
+        <xsl:text>            "</xsl:text>
+        <xsl:value-of select="@id"/>
+        <xsl:text>": detachable_elements["</xsl:text>
         <xsl:value-of select="@id"/>
         <xsl:text>"]</xsl:text>
         <xsl:if test="position()!=last()">
@@ -501,7 +503,7 @@
         <xsl:text>
 </xsl:text>
       </xsl:for-each>
-      <xsl:text>        ]
+      <xsl:text>        }
 </xsl:text>
       <xsl:text>    }</xsl:text>
       <xsl:if test="position()!=last()">
--- a/svghmi/gen_index_xhtml.ysl2	Mon Mar 02 10:29:41 2020 +0100
+++ b/svghmi/gen_index_xhtml.ysl2	Mon Mar 02 14:43:21 2020 +0100
@@ -549,11 +549,11 @@
             |             hmi_widgets["«.»"]`if "position()!=last()" > ,`
             }
             |         ],
-            |         required_detachables: [
+            |         required_detachables: {
             foreach "$required_detachables" {
-            |             detachable_elements["«@id»"]`if "position()!=last()" > ,`
-            }
-            |         ]
+            |             "«@id»": detachable_elements["«@id»"]`if "position()!=last()" > ,`
+            }
+            |         }
             |     }`if "position()!=last()" > ,`
         }
         | }