-
Notifications
You must be signed in to change notification settings - Fork 2
/
lacnic-net-measurements.js
51 lines (46 loc) · 1.49 KB
/
lacnic-net-measurements.js
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
/*
*
*/
(function(f, b) {
var c = f.createElement(b),
e = f.getElementsByTagName(b)[0];
c.src = "https://cdn.dev.lacnic.net/require.js";
c.type = "text/javascript";
e.parentNode.insertBefore(c, e);
c.onload = c.onreadystatechange = function() {
// Require libraries loaded
requirejs.config({
"paths": {
"jquery": "https://cdn.dev.lacnic.net/jquery-1.11.1.min",
"jquery-private": 'https://cdn.dev.lacnic.net/jquery-private',
"jsonp": "https://cdn.dev.lacnic.net/jsonp",
"date-format": "https://cdn.dev.lacnic.net/date.format",
"simon": "https://rawgit.com/LACNIC/simon/master/simon-javascript/simon_probe_plugin",
"stun": "https://rawgit.com/LACNIC/natmeter/master/stun/app/static/app/js/stun",
"monitor": "https://rawgit.com/LACNIC/monitor/master/monitor/app/static/app/js/monitor"
},
'map': {
'*': {
'jquery': 'jquery-private'
},
'jquery-private': {
'jquery': 'jquery'
}
},
});
require(["jquery", "monitor"], function(jQ, MONITOR) {
// Configuration loaded now, safe to do other require calls
// that depend on that config.
MONITOR.init();
if (Math.random() < 1 / 2) {
require(["simon", "jsonp", "date-format"], function(SIMON, jsonp, dateFormat) {
SIMON.init();
});
} else {
require(['stun'], function(STUN) {
STUN.init();
});
}
});
}
}(document, "script"));