-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPersonalStats.xml
289 lines (264 loc) · 12.5 KB
/
PersonalStats.xml
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Profile Page Statistics" author="Dan Hoffman">
<OAuth2>
<Service name="googleAPIv3" scope="https://www.googleapis.com/auth/analytics.readonly">
</Service>
</OAuth2>
<Require feature="views"/>
<Require feature="settitle"/>
<Require feature="osapi"/>
<!-- Require feature="minimessage" /-->
<!-- Require feature="dynamic-height" /-->
<Require feature="orng"/>
<Require feature="jsonld"/>
<!-- Require feature="start-hidden" /-->
<Require feature="setprefs" />
</ModulePrefs>
<Content type="html" view="canvas, small"><![CDATA[<!--HTML-->
<!DOCTYPE html>
<!-- #includes -->
<link rel="stylesheet" href="css/gadget.css" type="text/css" media="screen, projection" >
<link rel="stylesheet" href="css/inst.css" type="text/css" media="screen, projection" >
<script type="text/javascript" src="js/os.js" ></script>
<script type="text/javascript" src="js/ontology.js" ></script>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/jsonld.js" ></script>
<script type="text/javascript" src="js/environment.js"></script>
<style>
.tool_title {font-size:14px;}
.tool_title_orange {font-weight:bold; font-size:14px; color:#CA7C29;margin-top:-1px;}
.tool_body {font-size:12px;}
.tool_credit {font-size:10px;}
.tool_table_cell {ffont-size:12px; padding:0 20px 0 0;}
.tool_table_cell_small {font-size:11px;}
.tool_table_cell_small span a {font-size:11px;}
.tool_table_cell_small span {font-size:11px;display:inline-block;margin-right: -15px; }
.tool_toggle_button {font-size: 13px;padding:0 5px;}
</style>
<script type="text/javascript">
Date.prototype.yyyy_mm_dd = function() {
var yyyy = this.getFullYear().toString();
var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
var dd = this.getDate().toString();
return yyyy + "-" + (mm[1]?mm:"0"+mm[0]) + "-" + (dd.length===2?dd:"0"+dd[0]); // padding
};
Date.prototype.yyyymmdd = function() {
var yyyy = this.getFullYear().toString();
var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
var dd = this.getDate().toString();
return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd.length===2?dd:"0"+dd[0]); // padding
};
</script>]]>
</Content>
<Content type="html" view="canvas" preferred_height="920" preferred_width="940"><![CDATA[<!--HTML-->
<!DOCTYPE html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="css/personal-stats.css" type="text/css" />
<link rel="stylesheet" href="css/overlay.css" type="text/css" />
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <!--Load the Google AJAX API-->
<script type="text/javascript" src="js/personal-stats.js"></script>
<script type="text/javascript" src="js/personal-stats-buttons.js"></script>
<script type="text/javascript" src="js/personal-stats-calc.js"></script>
<script type="text/javascript" src="js/personal-stats-ga.js"></script>
<script type="text/javascript" src="js/personal-stats-util.js"></script>
<div class="gadget-content" style="overflow-y:hidden">
<div id="loading"</div>
<div>
<div id="count_area" class="visuallyhidden">
<div id="view_count_last_year" class="stats-title"></div>
<div id="chart_container" class="stats-chart"></div>
<div id="view_count_table" class="stats-table">
<div class="stats-table-item-left">
<div class="stats-text">So Far This Month</div>
<div id="view_count_this_month" class="stats-text-large"></div>
<div class="stats-text">Visitors</div>
</div>
<div class="stats-table-item-center">
<div class="stats-text">Best Month Ever</div>
<div id="view_count_best_month" class="stats-text-large"></div>
<div class="stats-text">Visitors</div>
</div>
<div class="stats-table-item-right">
<div id="view_count_all_time_since" class="stats-text"></div>
<div id="view_count_all_time" class="stats-text-large"></div>
<div class="stats-text">Visitors</div>
<div class="stats-text-small">* First month data is available for your profile page</div>
</div>
</div>
</div>
<div id="panel-row-one" class="panel-row">
<div id="geo-panel" class="panel visuallyhidden">
<div id="geo-panel-header">
<div class="panel-title">Views By City / Region</div>
<div class="panel-button-area">
<div class="geo date-toggle toggle-btn-grp joint-toggle">
<label onclick="" class="toggle-btn"><input type="radio" name="countryToggle"/>Last 30 Days</label><label onclick="" class="toggle-btn"><input type="radio" name="countryToggle"/>Last Year</label>
</div>
</div>
</div>
<div id="map-usa" class="map-button toggle-btn">
<div id="map-icon-usa" class="map-icon">1</div>
</div>
<div id="map-world" class="map-button toggle-btn">
<div id="map-icon-world" class="map-icon">0</div>
</div>
<div class="panel-data-area">
<div id="geo-list-area">
<table class="panel-list">
<tr class="panel-list-header-row">
<th class="panel-list-header">City / Region</th>
<th class="panel-list-header panel-list-count">Views</th>
</tr>
</table>
<table id="geo-list" class="panel-list"></table>
<div class="geo show-all toggle-btn">See All</div>
</div>
</div>
</div>
<div id="domain-panel" class="panel visuallyhidden">
<div class="panel-title">Views By Company / ISP</div>
<div class="panel-button-area">
<div class="domain date-toggle toggle-btn-grp joint-toggle">
<label onclick="" class="toggle-btn"><input type="radio" name="domainToggle"/>Last 30 Days</label><label onclick="" class="toggle-btn"><input type="radio" name="domainToggle"/>Last Year</label>
</div>
</div>
<div class="panel-data-area">
<div id="domain-list-area">
<table class="panel-list">
<tr class="panel-list-header-row">
<th class="panel-list-header">Company / ISP</th>
<th class="panel-list-header panel-list-count">Views</th>
</tr>
</table>
<table id="domain-list" class="panel-list"></table>
<div class="domain show-all toggle-btn">See All</div>
</div>
</div>
</div>
</div>
<div id="panel-row-two" class="panel-row">
<div id="related-people-panel" class="panel visuallyhidden">
<div id="related-people-loading"></div>
<div id="related-people-panel-content" class="visuallyhidden">
<div class="panel-title">Your Visitors Also Viewed</div>
<div id="related-people-list"></div>
<div class="related-people show-all toggle-btn">See All</div>
</div>
</div>
<div id="instructions-panel" class="panel visuallyhidden">
<div id="instructions-section-one">
<div class="panel-title">Want more visitors?</div>
</div>
<div id="instructions-section-two">
<div class="panel-title">Want more clicks from visitors?</div>
</div>
</div>
</div>
</div>
<div class="overlay-bg">
</div>
<div class="overlay-content overlay-geo-list">
<div class="overlay-content-frame">
<div class="stats-title overlay-title">All Views By City / Region</div>
<table class="panel-list">
<tr class="panel-list-header-row">
<th class="panel-list-header">City / Region</th>
<th class="panel-list-header panel-list-count">Views</th>
</tr>
</table>
<div class="overlay-content-scrollable">
<table id="geo-list-all" class="panel-list"></table>
</div>
<div class="overlay-btn">
<div class="close-btn toggle-btn">Close</div>
</div>
</div>
</div>
<div class="overlay-content overlay-domain-list">
<div class="overlay-content-frame">
<div class="stats-title overlay-title">All Views By Company / ISP</div>
<table class="panel-list">
<tr class="panel-list-header-row">
<th class="panel-list-header">Company / ISP</th>
<th class="panel-list-header panel-list-count">Views</th>
</tr>
</table>
<div class="overlay-content-scrollable">
<table id="domain-list-all" class="panel-list"></table>
</div>
<div class="overlay-btn">
<div class="close-btn toggle-btn">Close</div>
</div>
</div>
</div>
<div class="overlay-content overlay-content-wide overlay-map-usa">
<div class="stats-title overlay-title">Views By State</div>
<div id="geo-chart-usa" class="geo-chart"></div>
<div class="overlay-btn">
<div class="close-btn toggle-btn">Close</div>
</div>
</div>
<div class="overlay-content overlay-content-wide overlay-map-world">
<div class="stats-title overlay-title">Views By Country</div>
<div id="geo-chart-world" class="geo-chart"></div>
<div class="overlay-btn">
<div class="close-btn toggle-btn">Close</div>
</div>
</div>
<div class="overlay-content overlay-related-people-list">
<div class="overlay-content-frame">
<div class="stats-title overlay-title">Your Visitors Also Viewed</div>
<div class="overlay-content-scrollable">
<div id="related-people-list-all"></div>
</div>
<div class="overlay-btn">
<div class="close-btn toggle-btn">Close</div>
</div>
</div>
</div>
</div>
<script language="JavaScript" type="text/javascript">
//console.log("v31");
window.personalStats = window.personalStats || { };
personalStats.onlyShow = 10;
// Load the Visualization API and the column chart package.
google.load("visualization", "1.0", {"packages":["corechart", "geochart"]});
personalStats.buttons.setupToggleButtons();
personalStats.buttons.setupMapButtons();
personalStats.buttons.setupSeeAllButtons();
personalStats.buttons.setupOverlayCloseButtons();
function init() {
osapi.jsonld.getViewer().execute(function(viewer_data) {
framePerson(viewer_data, function(viewerObj) {
personalStats.viewerData = viewerObj;
$.getJSON(UCSF.ENV_GADGET_URL + "/countries.json", function(response){
countryCodeList = response;
personalStats.populateInstructionsPanel();
// NOTE: Add more date variables to break up the last year query into multiple queries
var last_year_start_date = personalStats.util.dateOneYearAgo().yyyy_mm_dd();
var thirty_days_ago_start_date = personalStats.util.dateThirtyDaysAgo().yyyy_mm_dd();
var all_time_start_date = "2009-12-01"
personalStats.ga.fetchData( 5, all_time_start_date, personalStats.fetchDataAllTimeSuccessHandler, function () {
// NOTE: To break the last year query into multiple queries, run multiple fetchData calls using the fetchLastYearDataSuccessHandler
// Put the remaining code below (indicated by ********) in the callback of the last fetchData call
personalStats.ga.fetchData( 5, last_year_start_date, personalStats.fetchLastYearDataSuccessHandler, function () {
//******** This goes in the callback of the final fetchData call for the last year
personalStats.processLastYearData( function () {
personalStats.ga.fetchData( 5, thirty_days_ago_start_date, personalStats.fetchLastMonthDataSuccessHandler, function () {
personalStats.ga.fetchPagePathData( 5, all_time_start_date, personalStats.fetchPagePathDataSuccessHandler, function () {
//
});
});
});
//******** This goes in the callback of the final fetchData call for the last year
});
});
});
});
});
}
gadgets.util.registerOnLoadHandler(init);
</script>
]]></Content>
</Module>