-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathapp.js
43 lines (33 loc) · 1.2 KB
/
app.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
require(['common'], function () {
require(['app/shared/config', 'util/error-reporter', 'util/google-analytics', 'sugar'], function (
Config, ErrorReporter, GA) {
ErrorReporter.init(''); // TODO: change to your app's frontend error logger API url
Config.refresh().done(function (config) {
var locale = config.locale;
if (locale) {
require.config({
config: {
i18n: {
locale: locale
}
}
});
try {
Date.setLocale(locale);
} catch (e) {
window.console.error(e.message);
}
}
GA.init(
config.credentials.google.analytics/* TODO: change to your app's way of getting the GA account */,
[
['require', 'linkid', 'linkid.js']
], /* TODO: change the required GA plugins per your app's needs, one plugin per sub-array.
e.g.: here we are requiring the enhanced link attributes plugin 'linkid' */
true // TODO: change to false if you don't want all click events on all pages to be auto-tracked by GA
);
/* TODO: do other bootstrapping needed for your app */
require(['framework/router']);
});
});
});