-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
170 lines (152 loc) · 7.45 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!-- Fontaswesome CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<title>Assignment 1 - DFA</title>
<style>
html,
body {
height: 100%;
font-size: 17px;
color: black;
font-weight: 400;
}
body .container-fluid {
height: 100%;
font-size: 17px;
color: black;
font-weight: 400;
}
::placeholder {
/* Chrome, Firefox, Opera, Safari 10.1+ */
color: #C0C0C0;
}
.col-form-label {
font-size: 17px!important;
}
input {
font-size: 17px!important;
}
/* .container-fluid {
height: 100%;
font-size: 16px;
} */
.row {
height: 100%;
}
.form-control {
padding: 0.1rem .75rem;
height: calc(1.5em + .3rem + 2px);
}
.col-form-label {
line-height: 1;
}
.mark,
mark {
padding: 0;
background-color: YELLOW;
}
</style>
</head>
<body>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<a class="navbar-brand">Place Finder</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation" id="navCollapseBut">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav mr-auto"></ul>
<button class="btn btn-success float-right mr-2" type="button" onclick="runDFA()">Run <i class="fa fa-play"></i></button>
<button class="btn btn-primary float-right" type="button" onclick="clear_input()">Clear</button>
</ul>
</div>
</nav>
<div class="container-fluid" style="margin-top: 60px;">
<div class="row">
<div class="col-lg-6 border-right border-secondary" style="padding:20px;height:auto">
<form>
<div class="form-group">
<h4 class="font-weight-bold">DFA Setting</h4>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-3 col-form-label">Strings/Patterns/Places:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="patterns" placeholder="E.g. Malaysia, Australia, Penang, Pizza Hut, Intel etc." onchange="createAlphabet()">
<small>Separate multiple patterns or places by comma (",")</small>
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-3 col-form-label">State:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="states" placeholder="E.g. 0,1,2,..." onchange="createTable()">
<small>Separate multiple values by comma (",")</small>
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-3 col-form-label">Alphabet:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="alphabets" placeholder="E.g. A,B,C,..." onchange="createTable()">
<small>Separate multiple values by comma (",")</small>
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-3 col-form-label">Initial State:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="initial_state" placeholder="E.g. 0">
<!-- <small>Seperate multiple values by comma (",")</small> -->
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-3 col-form-label">Final State:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="final_state" placeholder="E.g. 0">
<small>Separate multiple values by comma (",")</small>
</div>
</div>
<div class="form-group row">
<label for="exampleInputEmail1" class="col-sm-3 col-form-label mb-1">Transition Function:</label>
<table class="table table-responsive" id="transition_table" style="padding-left: 15px;margin-right: 20px;">
</table>
</div>
</form>
<form>
<div class="form-group">
<h4 class="font-weight-bold">Inputs</h4>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label">Text file:</label>
<div class="col-sm-5">
<input type="file" id="openFile" style="font-size: 14px!important;" />
</div>
<div id='text' style='padding:15px;'></div>
</div>
</form>
</div>
<div class="clearfix"></div>
<div class="col-lg-6 border-left" style="padding:20px;height:auto">
<!-- <iframe><iframe frameborder="0" height="400" width="100%"></iframe></p>
-->
<h4 class="font-weight-bold" id="result">Result</h4>
<div class="form-group" id="needle"></div>
<div id="haystack"></div>
<div id="occurence"></div>
<br>
<div id="position"></div>
<div id="demostration"></div>
</div>
</div>
</div>
<script src="dfa.js"></script>
</body>
</html>