-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
49 lines (44 loc) · 1.07 KB
/
Copy pathindex.js
File metadata and controls
49 lines (44 loc) · 1.07 KB
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
'use strict';
const identityLoginURL = 'static.olark.com/jsclient/loader.js';
if (!window.olark) {
const el = document.createElement('script');
const [script] = document.getElementsByTagName('script');
el.async = 1;
el.src = '//' + identityLoginURL;
script.parentNode.insertBefore(el, script);
const olark = window.olark = (...args) => {
k.s.push(args);
k.t.push(Number(new Date));
};
/**
* @param {?} i
* @param {?} src
* @return {undefined}
*/
olark.extend = (i, src) => {
olark('extend', i, src);
};
/**
* @param {string} o
* @return {undefined}
*/
olark.identify = (o) => {
olark('identify', k.i = o);
};
/**
* @param {?} key
* @param {?} callback
* @return {undefined}
*/
olark.configure = (key, callback) => {
olark('configure', key, callback);
k.c[key] = callback;
};
const k = olark._ = {
s: [],
t: [Number(new Date)],
c: {},
l: identityLoginURL,
};
}
module.exports = window.olark;