-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
168 lines (151 loc) · 5.45 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!doctype html>
<title>Browser Matrix</title>
<link rel="stylesheet" href="./stylesheets/base.css">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<!--[if lt IE 9]>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>window.attachEvent("onload", function() { CFInstall.check({ mode: "overlay" }); });</script>
<![endif]-->
<header>
<h1>Browser Matrix</h1>
<p>by <a href="http://e26.co.uk">Edd Sowden</a></p>
</header>
<div class="options hidden">
<div class="account-options">
<label for="account">Account:</label>
<select id="account" name="account" disabled="disabled">
<option>Select account</option>
</select>
<label for="property">Property:</label>
<select id="property" name="property" disabled="disabled">
<option>Select property</option>
</select>
<label for="profile">Profile:</label>
<select id="profile" name="profile" disabled="disabled">
<option>Select profile</option>
</select>
</div>
<div class="page-options">
<label for="period">Bucket Size:</label>
<select id="period" name="period">
<option value="nthDay">1 day</option>
<option value="nthWeek" selected>1 week</option>
<option value="nthMonth">1 month</option>
</select>
<label for="support">Support</label>
<select id="support" name="support">
<option value="90">90% of users</option>
<option value="91">91% of users</option>
<option value="92">92% of users</option>
<option value="93">93% of users</option>
<option value="94">94% of users</option>
<option value="95" selected>95% of users</option>
<option value="96">96% of users</option>
<option value="97">97% of users</option>
<option value="98">98% of users</option>
<option value="99">99% of users</option>
<option value="100">100% of users</option>
</select>
<label for="combine">Combine</label>
<select id="combine" name="combine">
<option value="default">None</option>
<option value="autoUpdating" selected>Auto updating browser</option>
</select>
</div>
</div>
<div id="graph"></div>
<div id="wrapper"></div>
<p class="fork"><a href="//github.com/edds/browser-matrix">View on GitHub</a></p>
<div class="overlay">
<p>
Browser Matrix is a tool which lets you use your Google Analytics data to
graph percentage share of browsers over time.
</p>
<p>
To do that you will need to give this page access to your Google Analytics
account. Don't worry, the details of your account are never sent
back to any servers, this is an entirely client-side application.
</p>
<p><button id="start">Authenticate with Google</button></p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<!--[if gt IE 8]><!-->
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="javascripts/vendor/mustache.js"></script>
<script src="javascripts/auth.js"></script>
<script src="javascripts/browsers.js"></script>
<script src="javascripts/browser-maps.js"></script>
<script src="javascripts/cache.js"></script>
<script src="javascripts/graph.js"></script>
<script src="javascripts/template.js"></script>
<script src="javascripts/user.js"></script>
<script src="javascripts/manager.js"></script>
<!--<![endif]-->
<!--[if lt IE 10]><script type="text/javascript">
if(window.location.hash.replace('#','').length > 0 && window.location.hash.search('stopRedirectionInIE') == -1) {
window.location.href = window.location.href+'&stopRedirectionInIE';
}
</script><![endif]-->
<script>
if(typeof window.matrix === 'undefined'){ window.matrix = {}; }
matrix.settings = {
auth: {
response_type: 'token',
client_id: '85453278104.apps.googleusercontent.com',
redirect_uri: window.location.href.split('#')[0],
scope: 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/analytics.readonly',
state: '',
approval_prompt: 'auto'
}
};
$(function(){
$('#start').click(function(){
matrix.manager.init();
});
if(window.location.hash.indexOf('token') > -1){
matrix.manager.init();
}
});
</script>
<script type="text/mustache" id="select-options">
<option value="">Select {{object}}</option>
{{#options}}
<option value="{{id}}">{{name}}</option>
{{/options}}
</script>
<script type="text/mustache" id="browser-table">
<table class="matrix">
<thead>
<tr>
<th>OS</th>
<th>Browser</th>
<th>Version</th>
{{#days}}
<th>{{.}}</th>
{{/days}}
</tr>
</thead>
<tbody>
{{#results}}
<tr{{#supported}} class="supported"{{/supported}}>
<td>{{os}}</td>
<td>{{browser}}</td>
<td>{{version}}</td>
{{#daysWithSupport}}
<td{{#supported}} class="supported"{{/supported}}>{{users}}%</td>
{{/daysWithSupport}}
</tr>
{{/results}}
</tbody>
</table>
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-325261-9']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>