Skip to content
Snippets Groups Projects
Commit 609a9c66 authored by dgelessus's avatar dgelessus
Browse files

Enable ID prefix for VisB to avoid ID conflicts between cells

parent a644e33c
No related branches found
No related tags found
No related merge requests found
Pipeline #117439 passed
...@@ -225,10 +225,10 @@ ...@@ -225,10 +225,10 @@
" <script>\n", " <script>\n",
" function visualise0(stepNr) {\n", " function visualise0(stepNr) {\n",
" setAttr(\"visb_debug_messages\",\"text\",\"Step \"+stepNr+\"/1, State ID: 0\");\n", " setAttr(\"visb_debug_messages\",\"text\",\"Step \"+stepNr+\"/1, State ID: 0\");\n",
" setAttr(\"button\",\"fill\",\"red\");\n", " setAttr(\"visb__1.button\",\"fill\",\"red\");\n",
" setAttr(\"arrow\",\"visible\",\"TRUE\");\n", " setAttr(\"visb__1.arrow\",\"visible\",\"TRUE\");\n",
" setAttr(\"arrow\",\"x2\",\"100.0\");\n", " setAttr(\"visb__1.arrow\",\"x2\",\"100.0\");\n",
" setAttr(\"arrow\",\"y2\",\"20.0\");\n", " setAttr(\"visb__1.arrow\",\"y2\",\"20.0\");\n",
" }\n", " }\n",
" async function runAll(delay) {\n", " async function runAll(delay) {\n",
" visualise0(1);\n", " visualise0(1);\n",
...@@ -240,14 +240,14 @@ ...@@ -240,14 +240,14 @@
" <script>\n", " <script>\n",
" function registerHovers() {\n", " function registerHovers() {\n",
" var obj;\n", " var obj;\n",
" obj = document.getElementById(\"button\");\n", " obj = document.getElementById(\"visb__1.button\");\n",
" obj.onmouseover = function(ev){\n", " obj.onmouseover = function(ev){\n",
" setAttr(\"button\",\"stroke\",\"gray\")\n", " setAttr(\"visb__1.button\",\"stroke\",\"gray\")\n",
" setAttr(\"button\",\"stroke-width\",\"5\")\n", " setAttr(\"visb__1.button\",\"stroke-width\",\"5\")\n",
" };\n", " };\n",
" obj.onmouseout = function(){\n", " obj.onmouseout = function(){\n",
" setAttr(\"button\",\"stroke\",\"black\")\n", " setAttr(\"visb__1.button\",\"stroke\",\"black\")\n",
" setAttr(\"button\",\"stroke-width\",\"2\")\n", " setAttr(\"visb__1.button\",\"stroke-width\",\"2\")\n",
" };\n", " };\n",
" }\n", " }\n",
" </script>\n", " </script>\n",
...@@ -266,8 +266,8 @@ ...@@ -266,8 +266,8 @@
" </marker>\n", " </marker>\n",
" </defs>\n", " </defs>\n",
"\n", "\n",
" <circle id=\"button\" cx=\"100\" cy=\"100\" fill=\"red\" r=\"80\" stroke=\"black\" stroke-width=\"2\"></circle>\n", " <circle id=\"visb__1.button\" cx=\"100\" cy=\"100\" fill=\"red\" r=\"80\" stroke=\"black\" stroke-width=\"2\"></circle>\n",
" <line id=\"arrow\" marker-end=\"url(#arrowhead)\" stroke=\"gray\" stroke-width=\"2.0\" visible=\"TRUE\" x1=\"100\" x2=\"100.0\" y1=\"100\" y2=\"20.0\"></line>\n", " <line id=\"visb__1.arrow\" marker-end=\"url(#arrowhead)\" stroke=\"gray\" stroke-width=\"2.0\" visible=\"TRUE\" x1=\"100\" x2=\"100.0\" y1=\"100\" y2=\"20.0\"></line>\n",
"</svg>\n", "</svg>\n",
" </div>\n", " </div>\n",
" <script> visualise0(1); </script>\n", " <script> visualise0(1); </script>\n",
...@@ -464,10 +464,10 @@ ...@@ -464,10 +464,10 @@
" <script>\n", " <script>\n",
" function visualise1(stepNr) {\n", " function visualise1(stepNr) {\n",
" setAttr(\"visb_debug_messages\",\"text\",\"Step \"+stepNr+\"/1, State ID: 1\");\n", " setAttr(\"visb_debug_messages\",\"text\",\"Step \"+stepNr+\"/1, State ID: 1\");\n",
" setAttr(\"button\",\"fill\",\"green\");\n", " setAttr(\"visb__2.button\",\"fill\",\"green\");\n",
" setAttr(\"arrow\",\"visible\",\"TRUE\");\n", " setAttr(\"visb__2.arrow\",\"visible\",\"TRUE\");\n",
" setAttr(\"arrow\",\"x2\",\"100.0\");\n", " setAttr(\"visb__2.arrow\",\"x2\",\"100.0\");\n",
" setAttr(\"arrow\",\"y2\",\"180.0\");\n", " setAttr(\"visb__2.arrow\",\"y2\",\"180.0\");\n",
" }\n", " }\n",
" async function runAll(delay) {\n", " async function runAll(delay) {\n",
" visualise1(1);\n", " visualise1(1);\n",
...@@ -479,14 +479,14 @@ ...@@ -479,14 +479,14 @@
" <script>\n", " <script>\n",
" function registerHovers() {\n", " function registerHovers() {\n",
" var obj;\n", " var obj;\n",
" obj = document.getElementById(\"button\");\n", " obj = document.getElementById(\"visb__2.button\");\n",
" obj.onmouseover = function(ev){\n", " obj.onmouseover = function(ev){\n",
" setAttr(\"button\",\"stroke\",\"gray\")\n", " setAttr(\"visb__2.button\",\"stroke\",\"gray\")\n",
" setAttr(\"button\",\"stroke-width\",\"5\")\n", " setAttr(\"visb__2.button\",\"stroke-width\",\"5\")\n",
" };\n", " };\n",
" obj.onmouseout = function(){\n", " obj.onmouseout = function(){\n",
" setAttr(\"button\",\"stroke\",\"black\")\n", " setAttr(\"visb__2.button\",\"stroke\",\"black\")\n",
" setAttr(\"button\",\"stroke-width\",\"2\")\n", " setAttr(\"visb__2.button\",\"stroke-width\",\"2\")\n",
" };\n", " };\n",
" }\n", " }\n",
" </script>\n", " </script>\n",
...@@ -505,8 +505,8 @@ ...@@ -505,8 +505,8 @@
" </marker>\n", " </marker>\n",
" </defs>\n", " </defs>\n",
"\n", "\n",
" <circle id=\"button\" cx=\"100\" cy=\"100\" fill=\"green\" r=\"80\" stroke=\"black\" stroke-width=\"2\"></circle>\n", " <circle id=\"visb__2.button\" cx=\"100\" cy=\"100\" fill=\"green\" r=\"80\" stroke=\"black\" stroke-width=\"2\"></circle>\n",
" <line id=\"arrow\" marker-end=\"url(#arrowhead)\" stroke=\"gray\" stroke-width=\"2.0\" visible=\"TRUE\" x1=\"100\" x2=\"100.0\" y1=\"100\" y2=\"180.0\"></line>\n", " <line id=\"visb__2.arrow\" marker-end=\"url(#arrowhead)\" stroke=\"gray\" stroke-width=\"2.0\" visible=\"TRUE\" x1=\"100\" x2=\"100.0\" y1=\"100\" y2=\"180.0\"></line>\n",
"</svg>\n", "</svg>\n",
" </div>\n", " </div>\n",
" <script> visualise1(1); </script>\n", " <script> visualise1(1); </script>\n",
...@@ -703,10 +703,10 @@ ...@@ -703,10 +703,10 @@
" <script>\n", " <script>\n",
" function visualise0(stepNr) {\n", " function visualise0(stepNr) {\n",
" setAttr(\"visb_debug_messages\",\"text\",\"Step \"+stepNr+\"/1, State ID: 0\");\n", " setAttr(\"visb_debug_messages\",\"text\",\"Step \"+stepNr+\"/1, State ID: 0\");\n",
" setAttr(\"button\",\"fill\",\"red\");\n", " setAttr(\"visb__3.button\",\"fill\",\"red\");\n",
" setAttr(\"arrow\",\"visible\",\"TRUE\");\n", " setAttr(\"visb__3.arrow\",\"visible\",\"TRUE\");\n",
" setAttr(\"arrow\",\"x2\",\"100.0\");\n", " setAttr(\"visb__3.arrow\",\"x2\",\"100.0\");\n",
" setAttr(\"arrow\",\"y2\",\"20.0\");\n", " setAttr(\"visb__3.arrow\",\"y2\",\"20.0\");\n",
" }\n", " }\n",
" async function runAll(delay) {\n", " async function runAll(delay) {\n",
" visualise0(1);\n", " visualise0(1);\n",
...@@ -718,14 +718,14 @@ ...@@ -718,14 +718,14 @@
" <script>\n", " <script>\n",
" function registerHovers() {\n", " function registerHovers() {\n",
" var obj;\n", " var obj;\n",
" obj = document.getElementById(\"button\");\n", " obj = document.getElementById(\"visb__3.button\");\n",
" obj.onmouseover = function(ev){\n", " obj.onmouseover = function(ev){\n",
" setAttr(\"button\",\"stroke\",\"gray\")\n", " setAttr(\"visb__3.button\",\"stroke\",\"gray\")\n",
" setAttr(\"button\",\"stroke-width\",\"5\")\n", " setAttr(\"visb__3.button\",\"stroke-width\",\"5\")\n",
" };\n", " };\n",
" obj.onmouseout = function(){\n", " obj.onmouseout = function(){\n",
" setAttr(\"button\",\"stroke\",\"black\")\n", " setAttr(\"visb__3.button\",\"stroke\",\"black\")\n",
" setAttr(\"button\",\"stroke-width\",\"2\")\n", " setAttr(\"visb__3.button\",\"stroke-width\",\"2\")\n",
" };\n", " };\n",
" }\n", " }\n",
" </script>\n", " </script>\n",
...@@ -744,8 +744,8 @@ ...@@ -744,8 +744,8 @@
" </marker>\n", " </marker>\n",
" </defs>\n", " </defs>\n",
"\n", "\n",
" <circle id=\"button\" cx=\"100\" cy=\"100\" fill=\"red\" r=\"80\" stroke=\"black\" stroke-width=\"2\"></circle>\n", " <circle id=\"visb__3.button\" cx=\"100\" cy=\"100\" fill=\"red\" r=\"80\" stroke=\"black\" stroke-width=\"2\"></circle>\n",
" <line id=\"arrow\" marker-end=\"url(#arrowhead)\" stroke=\"gray\" stroke-width=\"2.0\" visible=\"TRUE\" x1=\"100\" x2=\"100.0\" y1=\"100\" y2=\"20.0\"></line>\n", " <line id=\"visb__3.arrow\" marker-end=\"url(#arrowhead)\" stroke=\"gray\" stroke-width=\"2.0\" visible=\"TRUE\" x1=\"100\" x2=\"100.0\" y1=\"100\" y2=\"20.0\"></line>\n",
"</svg>\n", "</svg>\n",
" </div>\n", " </div>\n",
" <script> visualise0(1); </script>\n", " <script> visualise0(1); </script>\n",
......
...@@ -165,7 +165,11 @@ public final class ShowCommand implements Command { ...@@ -165,7 +165,11 @@ public final class ShowCommand implements Command {
return null; return null;
} }
GetVisBHtmlForStates htmlCmd = new GetVisBHtmlForStates(state, VisBExportOptions.DEFAULT.withShowHeader(false).withShowVersionInfo(false)); VisBExportOptions options = VisBExportOptions.DEFAULT
.withShowHeader(false)
.withShowVersionInfo(false)
.withAutoIdPrefix();
GetVisBHtmlForStates htmlCmd = new GetVisBHtmlForStates(state, options);
state.getStateSpace().execute(htmlCmd); state.getStateSpace().execute(htmlCmd);
final DisplayData result = new DisplayData("<VisB visualization>"); final DisplayData result = new DisplayData("<VisB visualization>");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment