Omnibus commited on
Commit
5d38218
·
verified ·
1 Parent(s): 2ac7848

Create index_og.html

Browse files
Files changed (1) hide show
  1. index_og.html +63 -0
index_og.html ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width" />
6
+ <title>My static Space</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
8
+ <script src="jquery-3.7.1.min.js"></script>
9
+
10
+ </head>
11
+ <body>
12
+ <form id="my-form">
13
+ <textarea id="inp" rows="5" cols="33"></textarea>
14
+ </form>
15
+
16
+ <button onclick="displayFormOutput()" type="button">Submit & Display Output</button>
17
+
18
+
19
+
20
+ <div id="myList"></div>
21
+ <div id="test">
22
+ <pre id = "test1" class="mermaid">
23
+ graph TD
24
+ A[Start] --> B[Task 1]
25
+ B --> C[Task 2]
26
+ C --> D[End]
27
+ </pre>
28
+ </div>
29
+ <script>
30
+ const queryString = window.location.search;
31
+ const urlParams = new URLSearchParams(queryString);
32
+ const merm = urlParams.get("mermaid");
33
+ console.log(merm);
34
+ //this_id=document.getElementById("test1");
35
+ //this_id.innerHTML="graph TD\nA[Start] --> B[Task 1]\nB --> C[Task 7]\nC --> D[End]"
36
+ //this_id.innerHTML=merm;
37
+
38
+ </script>
39
+ <script>
40
+ function displayFormOutput() {
41
+ const form = document.getElementById("my-form");
42
+ const inp = form.elements["inp"];
43
+ const inpValue = inp.value || "Not specified";
44
+
45
+ const node = document.createElement("pre");
46
+ node.classList.add('mermaid');
47
+ //const textnode = document.createTextNode(inp.value);
48
+ //node.appendChild(textnode);
49
+ node.innerHTML=inp.value;
50
+ document.getElementById("myList").appendChild(node);
51
+ this_id=document.getElementById("test1")
52
+ this_id.innerHTML=inp.value
53
+ $('#mermaid').html(node.data.graph).removeAttr('data-processed');
54
+ mermaid.init(undefined, $("#mermaid"));
55
+ }
56
+ </script>
57
+
58
+ <script type="module">
59
+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
60
+ mermaid.initialize({ startOnLoad: true });
61
+ </script>
62
+ </body>
63
+ </html>