6
6
< script src ="lib/jquery-3.3.1.min.js "> </ script >
7
7
< script src ="flowgorithm.js?014 "> </ script >
8
8
< script >
9
- var config = {
10
- itMode : 2
11
- } ;
9
+ var config = { } ;
12
10
var xml ;
13
11
function loadFile ( ) {
14
12
var file = $ ( '#source' ) . get ( 0 ) . files [ 0 ] ;
15
13
var reader = new FileReader ( ) ;
16
14
reader . addEventListener ( "load" , function ( ) {
17
15
xml = reader . result ;
18
- config . groupInput = $ ( "#o1 " ) . is ( ":checked" ) ? true : false ;
16
+ config . groupInput = ( $ ( "input[name='o1']:checked " ) . val ( ) === '1' ) ? true : false ;
19
17
config . aH = parseInt ( $ ( "#o2" ) . val ( ) ) ;
18
+ config . itMode = parseInt ( $ ( "#o3" ) . val ( ) ) ;
19
+ config . viewDesc = ( $ ( "input[name='o4']:checked" ) . val ( ) === '1' ) ? true : false ;
20
20
drawFlowchartFromSource ( xml , '#f' , config ) ;
21
21
$ ( '#choose' ) . removeClass ( 'big' ) ;
22
22
$ ( 'body' ) . addClass ( 'view' ) ;
33
33
# choose label {color : # 888 }
34
34
# choose .big {border : 1px solid # ddd ;padding : 5em 0 ;text-align : center;font-size : 1.2em ;background : none}
35
35
# 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 }
36
38
body .view # chooseOption {display : none}
37
39
body .view h1 {float : left;font-size : 1em ;margin : .1em .5em }
38
40
@media print{
@@ -53,8 +55,27 @@ <h1 class="noprint">Flowgorithm JS Viewer</h1>
53
55
< input type ="file " onchange ="loadFile() " id ="source " accept =".fprg ">
54
56
</ div >
55
57
< 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 >
58
79
</ div >
59
80
< div id ="f "> </ div >
60
81
</ body >
0 commit comments