-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (45 loc) · 1.59 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="dark-theme.css">
<title>Flowgorithm file viewer</title>
<meta charset="utf-8">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="script.js?016"></script>
<script>
var config = {};
var xml;
function loadFile() {
var file = $('#source').get(0).files[0];
var reader = new FileReader();
reader.addEventListener("load", function() {
xml = reader.result;
config.groupInput = true; // Default grouping
config.aH = 12; // Default arrow length
config.aT = 7; // Default arrow tip size
config.itMode = 2; // Default pre-conditional iteration style (Flowgorithm)
config.viewDesc = true; // Default print description
config.labelTrue = "True"; // Default True label
config.labelFalse = "False"; // Default False label
drawFlowchartFromSource(xml, '#f', config);
$('#choose').removeClass('big');
$('body').addClass('view');
$('title').text($('#f div.title').text());
}, false);
if (file) {
reader.readAsText(file);
}
}
</script>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/canvg@3/dist/browser/canvg.min.js"></script>
<h1 class="noprint">Flowgorithm file viewer</h1>
<div id="choose" class="big noprint">
<label for="source">Select .fprg file</label>
<input type="file" onchange="loadFile()" id="source" accept=".fprg">
</div>
<div id="chooseOption" class="noprint" style="display: none;"> </div>
<div id="f"></div>
</body>
</html>