llearn
Version:
Bad-ass developers create awesome apps
38 lines (32 loc) • 1.89 kB
HTML
<html>
<header>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowchart/1.11.3/flowchart.min.js" ></script>
<script src= "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</header>
<body>
<table border="1">
<tr>
<th>Data</th>
<th>Diagram</th>
<th>Flow Code</th>
</tr>
<tr>
<td valign="top"><div id="data"></div></td>
<td><div id="diagram"></div></td>
<td valign="top"><div id="flowcode"></div></td>
</tr>
</table>
</body>
</html>
<script>
// Javascript code
let div_data = jQuery('#data');
let div_flowCode = jQuery('#flowcode');
var data = "-----------------------------------------<br>-- Build new test cases for npm module<br>-- Begin line with '+' for checked item<br>-- To add checklist file: +@filename.chk@+<br>-----------------------------------------<br>(Create tests)<br>[Test functions]<br>+Create test functions<br>+Add Trace logging<br>+Run test functions<br>+Fix bugs<br>+Improve tests<br>+Improve output<br><Done for all modules?> [Auto tests] ?? [Test functions]<br>[Auto tests]<br>+Create auto tests<br>+npm tests<br>+fix bugs<br><Success?> [[Publish]] ?? [Auto tests]<br>[[Publish]]<br>(end)<br>";
var code_flowchart = 'a=>start: Create tests\nt1=>operation: Test functions\nc1=>condition: Done for all modules?\nt2=>operation: Auto tests\nc2=>condition: Success?\nf1=>subroutine: Publish\nz=>end: end\na->t1\nt1->c1\nc1(no)->t1\nc1(yes)->t2\nt2->c2\nc2(no)->t2\nc2(yes)->f1\nf1->z\n';
div_data.html(data);
div_flowCode.html(code_flowchart.replace(/\n/g, "<br />"));
var diagram = flowchart.parse( code_flowchart);
diagram.drawSVG('diagram');
</script>