-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
99 lines (84 loc) · 2.48 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
<html>
<head>
<title>Easy Application</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="./static/index-main.css" rel="stylesheet" />
</head>
<body>
<style>
</style>
<div id="main">
<div>
Filter based on location ?
<button id="filter-start" class="act-btn">Yes</button>
<button id="filter-do" class="act-btn" hidden>Filter</button>
</div>
<p></p>
</div>
<script src="./static/mason.js"></script>
<script src="./static/render.js"></script>
<script>
function nit(data_link) {
var loc_data;
var r = new XMLHttpRequest();
r.open("GET", data_link, true);
r.responseType = "json";
r.send();
r.onreadystatechange = function() {
if (r.readyState == 4) {
//console.log(r);
console.log("data got");
loc_data = r.response;
renderer.display(loc_data);
}
}
let filterBtn = document.getElementById("filter-start");
filterBtn.addEventListener('click', function() {
//
let tag = document.createElement("script");
tag.src = "./static/jquery.min.js";
document.body.appendChild(tag);
let jqLoaded = false;
let chsnLoaded = false;
let mainLoaded = false;
tag.onload = function() {
jqLoaded = true;
let tag2 = document.createElement("script");
tag2.src = "./static/chosen.jquery.min.js";
document.body.appendChild(tag2);
tag2.onload = function() {
chsnLoaded = true;
let tag3 = document.createElement("script");
tag3.src = "./static/index-main.js";
document.body.appendChild(tag3);
tag3.onload = function() {
mainLoaded = true;
customFilter.init(false, loc_data, renderer.display);
}
}
}
let chsnCss = document.createElement('link');
chsnCss.href = "./static/chosen.min.css";
chsnCss.rel = "stylesheet";
document.body.appendChild(chsnCss);
});
}
window.addEventListener('load', nit("https://raw.githubusercontent.com/antimatter96/easy-application-rewrite/master/data.json"));
</script>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-116655667-1', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script>
var trackOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {
'transport': 'beacon',
'hitCallback': function(){document.location = url;}
});
}
</script>
</body>
</html>