1 | <!DOCTYPE html>
|
2 | <html>
|
3 | <head>
|
4 | <meta charset="utf-8">
|
5 | <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6 | <title>Mermaid Quick Test Page</title>
|
7 | <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
|
8 | <script>
|
9 | function xss(x){
|
10 | alert(x + ' cause an xss attack');
|
11 | }
|
12 | </script>
|
13 | <style>
|
14 | .label text { fill: red}
|
15 | </style>
|
16 | </head>
|
17 | <body>
|
18 | <div class="mermaid">
|
19 | info
|
20 | </div>
|
21 | <div class="mermaid">
|
22 | graph LR;
|
23 | alert`xss`-->B;
|
24 | click B "javaSc
|
25 | ript:alert`salt`" "This is a tooltip for a link"
|
26 | </div>
|
27 | <div class="mermaid">
|
28 | graph LR;
|
29 | alert`xss`-->B;
|
30 | click B "java
|
31 | script:alert`xss`" "This is a tooltip for a link"
|
32 | </div>
|
33 | <div class="mermaid">
|
34 | graph LR;
|
35 | alert`base64`-->B;
|
36 | click B "data:image/png;base64,HNjcmlwdD5hbGVydCgiSGVsbG8iKTs8L3NjcmlwdD4="
|
37 | </div>
|
38 | <img src=xss.png />
|
39 | <div class="mermaid">
|
40 | graph TD
|
41 | A["<strong>If bold then xss</strong>Christmas"] -->|Get <strong>If bold then xss</strong> money| B(Go <strong>If bold then xss</strong> shopping)
|
42 | B --> C{Let me thinksssss<br/>ssssssssssssssssssssss<br />sssssssssssssssssssssssssss}
|
43 | C -->|One| D[Laptop]
|
44 | C -->|Two| E[iPhone]
|
45 | C -->|Three| F[Car]
|
46 | </div>
|
47 | <div class="mermaid">
|
48 | graph TB
|
49 | subgraph "<strong>If bold then xss</strong>"
|
50 | a1-->a2
|
51 | end
|
52 | </div>
|
53 | <div class="mermaid">
|
54 | graph TD
|
55 | A[Click on] -->|Get happines| BBBB(Clickable)
|
56 | BBBB --> C{Let me think}
|
57 | C -->|One| D[Laptop]
|
58 | C -->|Two| E[iPhone]
|
59 | C -->|Three| F[Car]
|
60 | click A "http://localhost:9000/index.html#link-clicked" "link test"
|
61 | click BBBB testClick "click test"
|
62 | click C "javascript:alert" "link test"
|
63 | classDef someclass fill:#f96;
|
64 | class A someclass;
|
65 | </div>
|
66 | <div class="mermaid">
|
67 | graph LR;
|
68 | alert`md5_salt`-->B;
|
69 | click alert`md5_salt` eval "Tooltip for a callback"
|
70 | click B "javascript:alert`salt`" "This is a tooltip for a link"
|
71 | </div>
|
72 | <div class="mermaid">
|
73 | gantt
|
74 | dateFormat YYYY-MM-DD
|
75 | axisFormat %d/%m
|
76 | title Adding GANTT diagram to mermaid
|
77 | excludes weekdays 2014-01-10
|
78 |
|
79 | section A section
|
80 | Completed task :done, des1, 2014-01-06,2014-01-08
|
81 | Active task :active, des2, 2014-01-09, 3d
|
82 | Future task : des3, after des2, 5d
|
83 | Future task2 : des4, after des3, 5d
|
84 |
|
85 | section Critical tasks
|
86 | Completed task in the critical line :crit, done, 2014-01-06,24h
|
87 | Implement parser and jison :crit, done, after des1, 2d
|
88 | Create tests for parser :crit, active, 3d
|
89 | Future task in critical line :crit, 5d
|
90 | Create tests for renderer :2d
|
91 | Add to mermaid :1d
|
92 |
|
93 | section Documentation
|
94 | Describe gantt syntax :active, a1, after des1, 3d
|
95 | Add gantt diagram to demo page :after a1 , 20h
|
96 | Add another diagram to demo page :doc1, after a1 , 48h
|
97 |
|
98 | section Clickable
|
99 | Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
|
100 | Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
101 |
|
102 | click cl1 href "javascript:alert`salt`"
|
103 | click cl2 call ganttTestClick("test", test, test)
|
104 |
|
105 | section Last section
|
106 | Describe gantt syntax :after doc1, 3d
|
107 | Add gantt diagram to demo page : 20h
|
108 | Add another diagram to demo page : 48h
|
109 | </div>
|
110 | <div class="mermaid">
|
111 | sequenceDiagram
|
112 | participant "Alice"
|
113 | participant Bob
|
114 | participant John as John<br/>Second Line
|
115 | Alice ->> Bob: Hello Bob, how are you?
|
116 | Bob-->>John: How about you <strong>If bold then xss</strong>John?
|
117 | Bob--x Alice: I am good thanks!
|
118 | Bob-x John: I am good thanks!
|
119 | Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
|
120 | Bob-->Alice: Checking with John...
|
121 | alt either this
|
122 | Alice->>John: Yes
|
123 | else or this
|
124 | Alice->>John: No
|
125 | else or this will happen
|
126 | Alice->John: Maybe
|
127 | end
|
128 | par this happens in parallel
|
129 | Alice -->> Bob: Parallel message 1
|
130 | and
|
131 | Alice -->> John: Parallel message 2
|
132 | end
|
133 | </div>
|
134 |
|
135 | <div class="mermaid">
|
136 | classDiagram
|
137 | Class01 <|-- AveryLongClass : Co<strong>If bold then xss</strong>ol
|
138 | Class03 "0" *-- "0..n" Class04
|
139 | Class05 "1" o-- "many" Class06
|
140 | Class07 .. Class08
|
141 | Class09 "many" --> "1" C2 : Where am i?
|
142 | Class09 "0" --* "1..n" C3
|
143 | Class09 --|> Class07
|
144 | Class07 : equals()
|
145 | Class07 : Object[] elementData
|
146 | Class01 : size()
|
147 | Class01 : int chimp
|
148 | Class01 : int gorilla
|
149 | Class08 <--> C2: Cool label
|
150 | </div>
|
151 | <div class="mermaid">
|
152 | graph LR
|
153 |
|
154 | SavePropertyController --> SavePropertyCommand
|
155 | SavePropertyCommand --> SavePropertyCommandHandler
|
156 | SavePropertyCommandHandler --> EventElastica[elastica.postupdate]
|
157 | SavePropertyCommandHandler --> EventProperty[property.postdisable]
|
158 |
|
159 | SavePropertyController --> Exceptions
|
160 | Exceptions --> ExceptionList(SecurityException<br/>EmptyRequestBodyException<br/>Throwable)
|
161 |
|
162 | classDef Ui fill:#FFFFFF
|
163 | classDef object fill:#1E98EC
|
164 | classDef event fill:#ECB11E
|
165 |
|
166 | class EventElastica,EventProperty event
|
167 | class SavePropertyCommand,SavePropertyCommandHandler object
|
168 | class SavePropertyController Ui
|
169 | </div>
|
170 |
|
171 | <script src="./mermaid.js"></script>
|
172 |
|
173 | <script>
|
174 | mermaid.initialize({
|
175 | theme: 'forest',
|
176 |
|
177 | logLevel: 4,
|
178 | flowchart: { htmlLabels: false, curve: 'linear' },
|
179 | gantt: { axisFormat: '%m/%d/%Y' },
|
180 | sequence: { actorMargin: 50 },
|
181 |
|
182 | securityLevel:'strict',
|
183 |
|
184 | });
|
185 | </script>
|
186 | <script>
|
187 | function ganttTestClick(a, b, c){
|
188 | console.log("a:", a)
|
189 | console.log("b:", b)
|
190 | console.log("c:", c)
|
191 | }
|
192 | function testClick(nodeId) {
|
193 | console.log("clicked", nodeId)
|
194 | var originalBgColor = document.querySelector('body').style.backgroundColor
|
195 | document.querySelector('body').style.backgroundColor = 'yellow'
|
196 | setTimeout(function() {
|
197 | document.querySelector('body').style.backgroundColor = originalBgColor
|
198 | }, 100)
|
199 | }
|
200 | </script>
|
201 | </body>
|
202 | </html>
|