Skip to content

Commit 45cdff2

Browse files
Add files via upload
1 parent 6884010 commit 45cdff2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3165
-0
lines changed

analytics-frame.html

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="referrer" content="origin" />
6+
<script>
7+
/* jshint ignore:start */
8+
// jscs:disable
9+
// https://gist.github.com/982883
10+
var uuid = function(a) {
11+
return a // if the placeholder was passed, return
12+
? ( // a random number from 0 to 15
13+
a ^ // unless b is 8,
14+
Math.random() // in which case
15+
* 16 // a random number from
16+
>> a/4 // 8 to 11
17+
).toString(16) // in hexadecimal
18+
: ( // or otherwise a concatenated string:
19+
[1e7] + // 10000000 +
20+
-1e3 + // -1000 +
21+
-4e3 + // -4000 +
22+
-8e3 + // -80000000 +
23+
-1e11 // -100000000000,
24+
).replace( // replacing
25+
/[018]/g, // zeroes, ones, and eights with
26+
uuid // random hex digits
27+
);
28+
};
29+
30+
window.frameHash = window.location.hash.replace(/^#/, '');
31+
32+
var postToParent = function(message) {
33+
if (window.parent.postMessage != null) {
34+
window.parent.postMessage(message, '*');
35+
}
36+
};
37+
38+
var onDidReceiveMessage = function(e) {
39+
if (e.data.id === frameHash) {
40+
var xhr = new XMLHttpRequest(),
41+
now = new Date(),
42+
data = {
43+
messageId: uuid(),
44+
sentAt: now.toISOString(),
45+
batch: [ {
46+
event: e.data.event,
47+
properties: e.data.properties,
48+
type: 'track',
49+
messageId: uuid(),
50+
timestamp: now.toISOString(),
51+
context: {
52+
ip: '0.0.0.0',
53+
page: {
54+
path: '/',
55+
referrer: '',
56+
search: '',
57+
title: '',
58+
url: 'http://'
59+
}
60+
},
61+
integrations: {},
62+
userId: e.data.aid
63+
} ]
64+
};
65+
66+
xhr.onreadystatechange = function() {
67+
if (xhr.readyState === 4) {
68+
postToParent({
69+
id: frameHash,
70+
message: 'xhr sent'
71+
});
72+
window.onDidReceiveMessage = null;
73+
}
74+
};
75+
76+
xhr.open('POST', 'https://metrics.articulate.com/v1/import');
77+
xhr.setRequestHeader('Content-Type', 'application/json');
78+
xhr.send(JSON.stringify(data));
79+
}
80+
};
81+
82+
if ('onmessage' in window) {
83+
window.addEventListener('message', onDidReceiveMessage, false);
84+
} else {
85+
// coming from flash, we will use older JS since we can expect some older IE versions
86+
var validProps = [
87+
'os', 'browser', 'playerVersion', 'playerType', 'lmsPresent', 'tinCanPresent',
88+
'aoSupport', 'publishSource', 'protocol', 'productChannel', 'cid', 'screenResolution',
89+
'pixelRatio'
90+
];
91+
var aid,
92+
props = window.location.search.replace(/^\?/, '').split('&'),
93+
config = {};
94+
95+
for (var i = 0, ii = props.length, currProp; i < ii; i++) {
96+
currProp = props[i].split('=');
97+
if (validProps.indexOf(currProp[0]) > -1 && currProp.length === 2) {
98+
config[currProp[0]] = currProp[1];
99+
} else if (currProp[0] === 'aid') {
100+
aid = currProp[1];
101+
}
102+
}
103+
104+
window.onDidReceiveMessage({
105+
data: {
106+
id: frameHash,
107+
event: 'player_course_load',
108+
properties: config,
109+
aid: aid
110+
}
111+
})
112+
113+
}
114+
/* jshint ignore:end */
115+
// jscs:enable
116+
</script>
117+
</head>
118+
<body>
119+
</body>
120+
<script>
121+
postToParent({
122+
id: window.frameHash,
123+
message: 'loaded'
124+
});
125+
</script>
126+
</html>

html5/data/css/output.min.css

Lines changed: 849 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

html5/data/js/5Uj0S7UJRpL.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)