forked from bdotdub/hummingbird
/
index.html
116 lines (82 loc) · 3.59 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<script src="/js/jquery-1.4.3.js"></script>
<script src="http://localhost:8000/socket.io/socket.io.js"></script>
<script>
WEB_SOCKET_SWF_LOCATION = 'http://localhost:8000/socket.io/WebSocketMain.swf';
</script>
<script src="/js/helpers.js"></script>
<script src="/js/websocket.js"></script>
<script src="/js/polymaps.js"></script>
<script src="/js/widgets/base.js"></script>
<script src="/js/widgets/logger.js"></script>
<script src="/js/widgets/graph.js"></script>
<script src="/js/widgets/count.js"></script>
<script src="/js/widgets/map.js"></script>
<title>Hummingbird</title>
<link rel="shortcut icon" type="image/png" href="/images/favicon.png" />
<link rel="stylesheet" media="all" href="/css/main.css" />
<link rel="stylesheet" media="all" href="/css/map.css" />
<link rel="stylesheet" media="all" href="/css/weekly.css" />
</head>
<body>
<h1>Hummingbird</h1>
<div class="hummingbird_graph" id="total">
<h2 class="graph_title">All Traffic: <span class="value">0</span> Pageviews / Second</h2>
<div class="axis_left"></div>
<div class="graph"></div>
<div class="axis_right"></div>
</div>
<div style="clear: both;"></div>
<div class="hummingbird_graph" id="cart_adds">
<h2 class="graph_title">Cart Traffic:</h2>
<div class="axis_left"></div>
<div class="graph"></div>
<div class="axis_right"></div>
</div>
<div style="clear: both;"></div>
<button id="test_it" style="margin-left: 60px;">Send test traffic</button>
<button id="test_cart" style="margin-left: 60px;">Send test traffic to cart</button>
<div style="clear: both;"></div>
<div id="map_container" style="margin: 40px; width: 800px; height: 450px; position: relative;"></div>
<script>
$(document).ready(function() {
hummingbirdSocket = new Hummingbird.WebSocket();
hummingbirdSocket.start();
$("#total").hummingbirdGraph(hummingbirdSocket,
{
data: { total: true }
});
$("#cart_adds").hummingbirdGraph(hummingbirdSocket,
{
data: { cartAdds: true },
graphHeight: 100
});
$("#total h2.graph_title span.value").hummingbirdCount(hummingbirdSocket,
{
data: { total: true },
every: 10
});
$("#map_container").hummingbirdMap(hummingbirdSocket, { data: { location: true } });
new Hummingbird.Logger(window,
hummingbirdSocket,
{
data: { cartAdds: true},
every: 20
});
$("#test_it").click(function(e) {
e.preventDefault();
var img = document.createElement('img');
img.src = "http://localhost:8000/tracking_pixel.gif?f=" + Math.ceil(Math.random() * 1000000)
});
$("#test_cart").click(function(e) {
e.preventDefault();
var img = document.createElement('img');
img.src = "http://localhost:8000/tracking_pixel.gif?events=scAdd&f=" + Math.ceil(Math.random() * 1000000)
});
});
</script>
</body>
</html>