Omnibus commited on
Commit
f790c25
·
verified ·
1 Parent(s): cef12b2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +58 -4
index.html CHANGED
@@ -16,8 +16,8 @@
16
  </style>
17
  </head>
18
  <body>
19
- <div class="chart">
20
- <pre id = "test1" class="mermaid">
21
  graph TD
22
  A[Dogs]
23
  B[Classification]
@@ -94,12 +94,66 @@ graph TD
94
  J --> H
95
  K --> V
96
  L --> M
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  </pre>
98
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
 
 
 
100
  <script type="module">
101
  import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
102
- mermaid.initialize({ startOnLoad: true });
 
 
103
  </script>
104
  </body>
105
  </html>
 
16
  </style>
17
  </head>
18
  <body>
19
+ <!--div class="chart">
20
+ <!--pre id = "test1" class="mermaid">
21
  graph TD
22
  A[Dogs]
23
  B[Classification]
 
94
  J --> H
95
  K --> V
96
  L --> M
97
+ </pre>
98
+ </div-->
99
+
100
+
101
+
102
+ <form id="my-form">
103
+ <textarea id="inp" rows="5" cols="33"></textarea>
104
+ </form>
105
+
106
+ <button onclick="displayFormOutput()" type="button">Submit & Display Output</button>
107
+
108
+
109
+
110
+ <div id="myList"></div>
111
+ <div id="test">
112
+ <pre id = "test1" class="mermaid">
113
+ graph TD
114
+ A[Start] --> B[Task 1]
115
+ B --> C[Task 2]
116
+ C --> D[End]
117
  </pre>
118
+ </div>
119
+ <script>
120
+ const queryString = window.location.search;
121
+ const urlParams = new URLSearchParams(queryString);
122
+ const merm = urlParams.get("mermaid");
123
+ console.log(merm);
124
+ //this_id=document.getElementById("test1");
125
+ //this_id.innerHTML="graph TD\nA[Start] --> B[Task 1]\nB --> C[Task 7]\nC --> D[End]"
126
+ //this_id.innerHTML=merm;
127
+
128
+ </script>
129
+ <script>
130
+ function displayFormOutput() {
131
+ const form = document.getElementById("my-form");
132
+ const inp = form.elements["inp"];
133
+ const inpValue = inp.value || "Not specified";
134
+ const node = document.createElement("pre");
135
+ node.classList.add('mermaid');
136
+ //const textnode = document.createTextNode(inp.value);
137
+ //node.appendChild(textnode);
138
+ node.innerHTML=inp.value;
139
+ document.getElementById("myList").appendChild(node);
140
+ this_id=document.getElementById("test1")
141
+ this_id.innerHTML=inp.value
142
+ $('#mermaid').html(node.data.graph).removeAttr('data-processed');
143
+ mermaid.init(undefined, $("#mermaid"));
144
+ }
145
+ </script>
146
+
147
+
148
 
149
+
150
+
151
+
152
  <script type="module">
153
  import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
154
+ mermaid.initialize({ securityLevel: 'loose' });
155
+ //mermaid.initialize({ securityLevel: 'loose',startOnLoad: true });
156
+
157
  </script>
158
  </body>
159
  </html>