-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathojs-config.js
144 lines (125 loc) · 3.76 KB
/
ojs-config.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
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
/*----------------------------------
| Do OpenScript Configurations Here
|----------------------------------
*/
/*----------------------------------
*
* Set the default route path here
* ----------------------------------
*/
route.basePath(''); // === '/'
/*-----------------------------------
| Set the global runtime prefix.
| This prefix will be appended
| to every path before resolution.
| So ensure when defining routes,
| you have it as the main prefix.
|------------------------------------
*/
route.runtimePrefix(''); // === ''
/*-----------------------------------
| set the directories in which we
| can find the context files
|-----------------------------------
*/
ContextProvider.directory = route.baseUrl('js/contexts');
/*-----------------------------------
| set the version number of the
| context files so that we can
| always load the new files incase
| files change
|-----------------------------------
*/
ContextProvider.version = '1.0.0';
/*-----------------------------------
| Set the Mediators directory
| so that we an load the mediators
| from that directory
|-----------------------------------
*/
MediatorManager.directory = route.baseUrl('js/mediators');
/*-----------------------------------
| Set the version number of the
| mediator files so that we can
| always load a fresh copy of the
| mediators files upon changes.
|----------------------------------
*/
MediatorManager.version = '1.0.0';
/*-----------------------------------
| Set the default component
| directory for the loader
|-----------------------------------
*/
loader.dir = route.baseUrl('js/components');
/*-----------------------------------
| set the version number of the
| component files so that we load
| a fresh file when they change
|-----------------------------------
*/
loader.version = '1.0.0';
/*-----------------------------------
| Set the default directory of the
| autoload object for loading
| files.
|-----------------------------------
*/
autoload.dir = route.baseUrl('js/classes');
/*-----------------------------------
| set the version number of the
| JS files so that we load
| a fresh file when they change
|-----------------------------------
*/
autoload.version = '1.0.0';
/*---------------------------------
| Get the initial body style so
| so that when routes change,
| we can reset the body style.
| Sometimes, the body element's
| style is affected by elements
| That are no longer on the DOM.
| example, bootstrap offcanvas.
| In these cases, you need to
| reset the body style when
| the routeChanged event is fired
| by the router. So you can listen
| to it and use this to reset
| the style.
|----------------------------------
*/
var __bodyStyle = document.body.getAttribute("style");
/*--------------------------------
| Set the logs clearing interval
| for the broker to remove stale
| events. (milliseconds)
|--------------------------------
*/
broker.CLEAR_LOGS_AFTER = 30000; // 30 secs
/*--------------------------------
| Set how old an event must be
| to be deleted from the broker's
| event log during logs clearing
|--------------------------------
*/
broker.TIME_TO_GC = 10000; // 10 secs
/*-------------------------------------------
| Start the garbage
| collector for the broker
|-------------------------------------------
*/
broker.removeStaleEvents(); // broker garbage collection started
/*------------------------------------------
| When this is set to true, the broker
| will display events and their payloads
| in the console when they are fired
|------------------------------------------
*/
broker.withLogs(true);
/*-----------------------------------------
| For SPAs, you have to initialize the
| Router using `router.init()`
|-----------------------------------------
*/
// router.init();