-
Notifications
You must be signed in to change notification settings - Fork 7
/
gender-free.html
90 lines (77 loc) · 2.04 KB
/
gender-free.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
<!DOCTYPE html>
<html> <head>
<title>Try Contra Dancing</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="simple.css">
</head>
<body>
<div id="wrap">
<div id="content">
<div id="content-inner">
<div id="title">
<center>Gender Free</center>
</div>
<div id="dances">
</div>
</div>
</div>
</div>
<a id=back href="about.html">
<div id="footer">
<center>back</center>
</div>
</a>
<script>
var dances = document.getElementById("dances");
document.body.onload = function() {
fetch("dances_locs.json", function(response) {
load_dances(JSON.parse(response));
});
};
function fetch(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState==4 && xhr.status==200) {
callback(xhr.responseText);
}
};
xhr.open("GET",url,true);
xhr.send();
}
function add_dance(location, link, schedule) {
var div = document.createElement("div");
div.className = "dance";
div.innerHTML = '<div class="dance-internal">'
+ location + '<br>'
+ '<a href="' + link + '">' + link + '</a></div>';
dances.appendChild(div);
}
function load_dances(dance_locations) {
dance_locations.sort(function(a, b) {
var c_a = [a[1], a];
var c_b = [b[1], b];
if (c_a < c_b) {
return -1;
} else if (c_a == c_b) {
return 0;
} else {
return 1;
}
});
prev = null;
for (var i = 0 ; i < dance_locations.length ; i++) {
if (dance_locations[i][6]) {
add_dance(dance_locations[i][1],
dance_locations[i][0],
dance_locations[i][2]);
}
}
}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45031405-1', 'trycontra.com');
ga('send', 'pageview');
</script>
</body> </html>