Skip to content

Commit 1340a04

Browse files
committed
Improved the form to change the drawing configuration
1 parent 0ea4db3 commit 1340a04

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

drawLocal.html

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
<script src="lib/jquery-3.3.1.min.js"></script>
77
<script src="flowgorithm.js?014"></script>
88
<script>
9-
var config = {
10-
itMode: 2
11-
};
9+
var config = {};
1210
var xml;
1311
function loadFile(){
1412
var file = $('#source').get(0).files[0];
1513
var reader = new FileReader();
1614
reader.addEventListener("load",function(){
1715
xml = reader.result;
18-
config.groupInput = $("#o1").is(":checked") ? true : false;
16+
config.groupInput = ($("input[name='o1']:checked").val()==='1') ? true : false;
1917
config.aH = parseInt($("#o2").val());
18+
config.itMode = parseInt($("#o3").val());
19+
config.viewDesc = ($("input[name='o4']:checked").val()==='1') ? true : false;
2020
drawFlowchartFromSource(xml,'#f',config);
2121
$('#choose').removeClass('big');
2222
$('body').addClass('view');
@@ -33,6 +33,8 @@
3333
#choose label{color:#888}
3434
#choose.big{border:1px solid #ddd;padding:5em 0;text-align:center;font-size:1.2em;background:none}
3535
#choose.big #source{font-size:1.5em}
36+
#chooseOption .row{border-bottom:1px dotted #ddd;padding:.5em 0}
37+
#chooseOption input,#chooseOption select{font-size:.9em}
3638
body.view #chooseOption{display:none}
3739
body.view h1{float:left;font-size:1em;margin:.1em .5em}
3840
@media print{
@@ -53,8 +55,27 @@ <h1 class="noprint">Flowgorithm JS Viewer</h1>
5355
<input type="file" onchange="loadFile()" id="source" accept=".fprg">
5456
</div>
5557
<div id="chooseOption" class="noprint">
56-
<label for="o1"><input type="checkbox" value="1" name="groupInput" id="o1" checked> Grouping consecutive input</label><br>
57-
<label for="o2">Arrows height: <input type="number" min="1" max="100" value="12" name="groupInput" id="o2"></label>
58+
<div class="row">
59+
Grouping consecutive input:
60+
<label for="o1">Yes<input type="radio" value="1" name="o1" id="o1" checked></label>
61+
<label for="o1b">No<input type="radio" value="0" name="o1" id="o1b"></label>
62+
</div>
63+
<div class="row">
64+
<label for="o2">Distance between shapes: <input type="number" min="1" max="100" value="12" style="width:50px" name="groupInput" id="o2"></label>
65+
</div>
66+
<div class="row">
67+
<label for="o3">Style of pre-conditional iterations:</label>
68+
<select name="o3" id="o3">
69+
<option value="2" selected>Flowgorithm style</option>
70+
<option value="3">Variant 1</option>
71+
<option value="1">Variant 2</option>
72+
</select>
73+
</div>
74+
<div class="row">
75+
Print the description above the flowchart:
76+
<label for="o4">Yes<input type="radio" value="1" name="o4" id="o4" checked></label>
77+
<label for="o4b">No<input type="radio" value="0" name="o4" id="o4b"></label>
78+
</div>
5879
</div>
5980
<div id="f"></div>
6081
</body>

0 commit comments

Comments
 (0)