SVGHMI: strip useless placeholder bitmap of HMI:Image in resulting xhtml
authorEdouard Tisserant <edouard@beremiz.fr>
Thu, 09 Jan 2025 17:10:40 +0100 (2 months ago)
changeset 4084 b312fd26a6a9
parent 4083 6a8fd46e9980
child 4085 8d150133d225
SVGHMI: strip useless placeholder bitmap of HMI:Image in resulting xhtml
svghmi/widget_image.ysl2
--- a/svghmi/widget_image.ysl2	Thu Jan 09 17:09:00 2025 +0100
+++ b/svghmi/widget_image.ysl2	Thu Jan 09 17:10:40 2025 +0100
@@ -28,8 +28,16 @@
     |     animate: function(){
     |       this.element.setAttribute('href', this.given_url);
     |     },
-    |
-    |     init: function() {
-    |       this.animate();
-    |     },
 }
+
+
+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:Image widget
+svgtmpl "svg:image[starts-with(@inkscape:label, 'HMI:Image')]", mode="inline_svg" {
+    xsl:copy {
+        apply "@*[not(contains(name(), 'href'))] | node()", mode="inline_svg";
+    }
+}
+
+}