-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
125 lines (109 loc) · 4.08 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
<!DOCTYPE html>
<html>
<head>
<title>Functional Dependency Calculator Web Service</title>
<link href="//current.bootstrapcdn.com/bootstrap-v204/css/bootstrap-combined.min.css" rel="stylesheet">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
function nl2br(input_string)
{
return input_string.replace(/(\r\n|\r|\n)/g, '<br>');
}
$(document).ready(function(){
$('#submit').click(function() {
var rString = 'r=' + $('#r').val();
var fString = 'f=' + $('#f').val();
$.ajax({
type : 'GET',
url : 'nf?' + rString + '&' + fString,
success : function(text) { $('#nf').html(text); }
});
$.ajax({
type : 'GET',
url : 'fmin?' + fString,
success : function(text) { $('#fmin').html(nl2br(text)); }
});
$.ajax({
type : 'GET',
url : 'keys?' + rString + '&' + fString,
success : function(text) { $('#keys').html(text); }
});
$.ajax({
type : 'GET',
url : 'primaryattributes?' + rString + '&' + fString,
success : function(text) { $('#primaryattributes').html(text); }
});
$.ajax({
type : 'GET',
url : 'secondaryattributes?' + rString + '&' + fString,
success : function(text) { $('#secondaryattributes').html(text); }
});
$.ajax({
type : 'GET',
url : 'bcnfs?' + rString + '&' + fString,
success : function(text) { $('#bcnfs').html(nl2br(text)); }
});
$.ajax({
type : 'GET',
url : 'd3nfs?' + rString + '&' + fString,
success : function(text) { $('#d3nfs').html(nl2br(text)); }
});
return false;
});
});
</script>
</head>
<body>
<h1>Functional Dependency Calculator Web Service</h1>
<h2>AJAX form</h2>
<div id="form_wrapper">
<form action="" id="demoForm" method="get">
<fieldset>
<legend>Input</legend>
<div>
<label for="r">relational schema:</label>
<input type="text" name="r" id="r" value="abcde" />
</div>
<div>
<label for="f">functional dependency set:</label>
<input type="text" name="f" id="f" value="ab->cd, b->e, d->e" />
</div>
<div>
<input type="submit" name="submit" id="submit" value="Submit" />
</div>
</fieldset>
<fieldset>
<legend>Results</legend>
<table border="1" cellspacing="0" cellpadding="3">
<tr><td>normal form</td><td id="nf"></td></tr>
<tr><td>fmin</td><td id="fmin"></td></tr>
<tr><td>keys</td><td id="keys"></td></tr>
<tr><td>primary attributes</td><td id="primaryattributes"></td></tr>
<tr><td>secondary attributes</td><td id="secondaryattributes"></td></tr>
<tr>
<td>BCNF decompositions</td>
<td id="bcnfs"></td>
</tr>
</tr>
<tr>
<td>3NF decompositions</td>
<td id="d3nfs"></td>
</tr>
</table>
</fieldset>
</form>
</div>
<h2>HTTP examples</h2>
<ul>
<li><a href="json?r=abcde&f=ab->cd, b->e, d->e,e->d">json</a></li>
<li><a href="nf?r=abcdef&f=a->b,b->c,c->a,d->e,e->f,f->d">nf</a></li>
<li><a href="fmin?f=a->b,b->d,a->d">fmin</a></li>
<li><a href="keys?r=abcdef&f=a->b,b->c">keys</a></li>
<li><a href="primaryattributes?r=abcdef&f=a->b,b->c">primaryattributes</a></li>
<li><a href="secondaryattributes?r=abcdef&f=a->b,b->c">secondaryattributes</a></li>
<li><a href="bcnfs?r=abcde&f=ab->cd, b->e, d->e">bcnf</a></li>
<li><a href="bcnfs?r=itkoscmpd&f=it->os">bcnf timeout</a></li>
<li><a href="d3nfs?r=abcde&f=ab->cd, b->e, d->e">d3nfs</a></li>
</ul>
</body>
</html>