forked from timchoh585/sccoogle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.html
148 lines (136 loc) · 4.58 KB
/
list.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
<html>
<head>
<style>
#panel_body
{
position: absolute;
top: 0;
left: 50px;
}
#search_button
{
position: absolute;
top: 2px;
left: 170px;
width: 140px;
height: 20px;
}
#dont_know
{
position: absolute;
top: 2px;
left: 280px;
width: 140px;
height: 20px;
}
#back_button
{
position: absolute;
top: 2px;
left: 402px;
width: 140px;
height: 20px;
}
#place_details
{
position: relative;
top: 2.5em;
width: 50%;
float: right;
}
#place_list
{
position: relative;
top: 2.5em;
width: 50%;
float: left;
height: 500px;
overflow-y: scroll;
}
</style>
<script type="text/JavaScript">
</script>
</head>
<body>
<div id= "place_details"></div>
<div id="place_list"></div>
<form method="get" action='list.html'>
<div id="panel_body">
<input type="text" class="form-control" name="search" id="inputError1" placeholder="What's Your Issue?">
</div>
<div id="search_button">
<button type="submit" class="btn btn-primary" style="margin: 0px 10px 300px 10px; background-color: lightgrey; color: black; border: white">SCCoogle Search</button>
</div>
<div id="dont_know">
<a href="index.html#index"><button type="button" class="btn btn-primary" style="margin: 0px 10px 300px 10px; background-color: lightgrey; color: black; border: white">No Search Results?</button></a>
</div>
<div id="back_button">
<a href="index.html"><button type="button" class="btn btn-primary" style="margin: 0px 10px 300px 10px; background-color: lightgrey; color: black; border: white">Back To Home</button></a>
</div>
</form>
<script src="taffydb-master/taffy-min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script src="jquery.csv-0.71.js"></script>
<script type="text/JavaScript">
var urlParams;
(window.onpopstate = function ()
{
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]);
})();
function info(information)
{
console.log(" info is " + information);
result = window.desc(information).first();
$("#place_details").html("");
$("#place_details").append("<h1>"+ result.Group_no + " - " + result.Group + " " + "</h1>");
$("#place_details").append("<h2>" + result.Group_no + "." + result.Violation_no + " - " + result.Description + "</h2>");
$("#place_details").append("<h3>" + "Restorative Action" + "</h3>");
$("#place_details").append("<p>" + result.Restorative_Action_1 + "</p>");
$("#place_details").append("<p>" + result.Restorative_Action_2 + "</p>");
$("#place_details").append("<p>" + result.Restorative_Action_3 + "</p>");
$("#place_details").append("<p>" + result.Restorative_Action_4 + "</p>");
$("#place_details").append("<p>" + result.Restorative_Action_5 + "</p>");
$("#place_details").append("<p>" + result.Restorative_Action_6 + "</p>");
$("#place_details").append("<p>" + result.Restorative_Action_7 + "</p>");
$("#place_details").append("<p>" + result.Restorative_Action_8 + "</p>");
$("#place_details").append("<h3>" + "Consequences" + "</h3>");
$("#place_details").append("<p>" + result.Consequence_1 + "</p>");
$("#place_details").append("<p>" + result.Consequence_2 + "</p>");
$("#place_details").append("<p>" + result.Consequence_3 + "</p>");
$("#place_details").append("<p>" + result.Consequence_4 + "</p>");
$("#place_details").append("<p>" + result.Consequence_5 + "</p>");
$("#place_details").append("<p>" + result.Consequence_6 + "</p>");
$("#place_details").append("<p>" + result.Consequence_7 + "</p>");
}
function getParams(){
}
$("document").ready(function(){
$.ajax({
type: "GET",
url: "http://timchoh585.github.io/CPS_Code_of_Conduct.txt",
dataType: "text",
success: function(data) {
table = $.csv.toObjects(data)
console.log(table);
window.desc = TAFFY(table);
window.desc({Description:{like: urlParams.search}}).each(function(d){
link = $("<a href=#>"+d.Description+"<br>"+"</a>")
link.click(function(e){
e.preventDefault();
info(d.___id)
});
$("#place_list").append(link);
});
}
});
});
</script>
</body>
</html>