-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
91 lines (73 loc) · 3.49 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<html>
<head>
<script src="lib/snap.svg-min.js"></script>
<script src="js/Editor.js"></script>
<script src="js/Parser.js"></script>
<script src="js/Element.js"></script>
<script src="js/Arrow.js"></script>
<script src="js/Assignment.js"></script>
<script src="js/Entity.js"></script>
<script src="js/ServiceCall.js"></script>
<script src="js/CompositeCode.js"></script>
<script src="js/ConditionnalIf.js"></script>
<script src="js/ConditionnalElse.js"></script>
<script src="js/ConditionnalEndIf.js"></script>
<script src="js/ForLoop.js"></script>
<script src="js/EndFor.js"></script>
<script src="js/diagram.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="homepage">
<button id="startEditor">Workflow editor</button>
<button id="startParser">Workflow parser</button>
</div>
<div id="parser">
<textarea id="workflowToParse" cols=90 rows=40>
START ccData, userId, odds, bets, profit, winings
events = SportsEventsService.getSportEvents()
FOR (i=0; i<events.length; i++){
odds[i] = OddsService.requestOdds(events[i])
}
FOR (i=0; i<events.length; i++){
am = this.getAmount(events[i])
ch = this.getChoice(events[i])
bets[i] = BetService.placeBet(events[i], userId, ch, am)
}
sum = this.getTotalAmount()
result = BankService.makePayment(ccData, sum)
IF (result == true) {
FOR (i=0; i<events.length; i++){
res = SportsEventsService.requestResult(events[i])
profit[i] = OddsService.requestProfits(res, bets[i])
}
winings = BankService.requestPayment(ccData, profit)
this.resetTotalAmount()
}
RETURN winings
</textarea>
<button id="startParsing">Parse</button>
</div>
<div id="editor">
<nav id="toolbar">
<input type="text" id="entityName" /><button id="addEntity">Add entity</button>
<label class="labelinput" for="inputs">Input parameters (separated by commas) :</label>
<input type="text" id="inputs" />
<label class="labelinput" for="output">Output parameter :</label>
<input type="text" id="output" />
<label class="toggle-btn"><input type="radio" name="objectType" value="serviceCall" checked="checked"/>Service call</label>
<label class="toggle-btn"><input type="radio" name="objectType" value="compositeCode"/>Composite code</label>
<label class="toggle-btn"><input type="radio" name="objectType" value="if"/>If</label>
<label class="toggle-btn"><input type="radio" name="objectType" value="else"/>Else</label>
<label class="toggle-btn"><input type="radio" name="objectType" value="endIf"/>EndIf</label>
<label class="toggle-btn"><input type="radio" name="objectType" value="forLoop"/>ForLoop</label>
<label class="toggle-btn"><input type="radio" name="objectType" value="endFor"/>EndFor</label>
<button id="generate">Generate</button>
<textarea id="generated-workflow" rows=20></textarea>
</nav>
<div id="svgpanel">
<svg id="svg" height="2000px" width="1000px" viewBox="0 600 1200 1200"></svg>
</div>
</div>
</body>
</html>