|
1 | 1 | ;(function(window) {
|
2 |
| - /** |
3 |
| - * Add parameter to url search |
4 |
| - * for switch users groups |
5 |
| - * |
6 |
| - * Possible options: |
7 |
| - * https://examples.com?users=prod |
8 |
| - * https://examples.com?users=dev |
9 |
| - * https://examples.com - for qa by default |
10 |
| - */ |
11 |
| - var usersQuery = _getQueryVar('users'); |
12 |
| - |
13 | 2 | var CONFIG = {
|
14 | 3 | debug: true,
|
15 | 4 | webrtc: {
|
|
20 | 9 | }
|
21 | 10 | };
|
22 | 11 |
|
23 |
| - /** |
24 |
| - * QBAppDefault for qa and dev |
25 |
| - * QBAppProd for production |
26 |
| - */ |
27 |
| - var QBAppProd = { |
| 12 | + var CREDENTIALS = { |
28 | 13 | appId: 92,
|
29 | 14 | authKey: 'wJHdOcQSxXQGWx5',
|
30 | 15 | authSecret: 'BTFsj7Rtt27DAmT'
|
31 |
| - }, |
32 |
| - QBAppDefault = { |
33 |
| - appId: 28287, |
34 |
| - authKey: 'XydaWcf8OO9xhGT', |
35 |
| - authSecret: 'JZfqTspCvELAmnW' |
36 | 16 | };
|
37 | 17 |
|
38 |
| - /** set QBApp */ |
39 |
| - var QBApp = usersQuery === 'prod' ? QBAppProd : QBAppDefault; |
40 |
| - |
41 |
| - var QBUsersQA = [ |
42 |
| - { |
43 |
| - id: 5395743, |
44 |
| - login: 'webuser111', |
45 |
| - password: 'webuser111', |
46 |
| - full_name: 'User 1', |
47 |
| - colour: 'FD8209' |
48 |
| - }, |
49 |
| - { |
50 |
| - id: 5395747, |
51 |
| - login: 'webuser112', |
52 |
| - password: 'webuser112', |
53 |
| - full_name: 'User 2', |
54 |
| - colour: '11a209' |
55 |
| - }, |
56 |
| - { |
57 |
| - id: 5681538, |
58 |
| - login: 'webuser113', |
59 |
| - password: 'webuser113', |
60 |
| - full_name: 'User 3', |
61 |
| - colour: '11a2a9' |
62 |
| - }, |
63 |
| - { |
64 |
| - id: 5719859, |
65 |
| - login: 'webuser114', |
66 |
| - password: 'webuser114', |
67 |
| - full_name: 'User 4', |
68 |
| - colour: '51c209' |
69 |
| - }, |
70 |
| - { |
71 |
| - id: 5719860, |
72 |
| - login: 'webuser115', |
73 |
| - password: 'webuser115', |
74 |
| - full_name: 'User 5', |
75 |
| - colour: '511209' |
76 |
| - }, |
77 |
| - { |
78 |
| - id: 5719866, |
79 |
| - login: 'webuser116', |
80 |
| - password: 'webuser116', |
81 |
| - full_name: 'User 6', |
82 |
| - colour: '01e209' |
83 |
| - } |
84 |
| - ], |
85 |
| - QBUsersDev = [ |
86 |
| - { |
87 |
| - id: 6970356, |
88 |
| - login: 'dev_user_1', |
89 |
| - password: 'dev_user_1', |
90 |
| - full_name: 'User 1', |
91 |
| - colour: 'ffaa00' |
92 |
| - }, |
93 |
| - { |
94 |
| - id: 6970368, |
95 |
| - login: 'dev_user_2', |
96 |
| - password: 'dev_user_2', |
97 |
| - full_name: 'User 2', |
98 |
| - colour: '0890ff' |
99 |
| - }, |
100 |
| - { |
101 |
| - id: 6970375, |
102 |
| - login: 'dev_user_3', |
103 |
| - password: 'dev_user_3', |
104 |
| - full_name: 'User 3', |
105 |
| - colour: 'ff03a6' |
106 |
| - }, |
107 |
| - { |
108 |
| - id: 6970379, |
109 |
| - login: 'dev_user_4', |
110 |
| - password: 'dev_user_4', |
111 |
| - full_name: 'User 4', |
112 |
| - colour: '60e27a' |
113 |
| - } |
114 |
| - ], |
115 |
| - QBUsersProd = [ |
116 |
| - { |
117 |
| - id: 2436251, |
118 |
| - login: 'webrtc_user1', |
119 |
| - password: 'x6Bt0VDy5', |
120 |
| - full_name: 'User 1', |
121 |
| - colour: 'FD8209' |
122 |
| - }, |
123 |
| - { |
124 |
| - id: 2436254, |
125 |
| - login: 'webrtc_user2', |
126 |
| - password: 'x6Bt0VDy5', |
127 |
| - full_name: 'User 2', |
128 |
| - colour: '1765FB' |
129 |
| - }, |
130 |
| - { |
131 |
| - id: 2436257, |
132 |
| - login: 'webrtc_user3', |
133 |
| - password: 'x6Bt0VDy5', |
134 |
| - full_name: 'User 3', |
135 |
| - colour: 'F81480' |
136 |
| - }, |
137 |
| - { |
138 |
| - id: 2436258, |
139 |
| - login: 'webrtc_user4', |
140 |
| - password: 'x6Bt0VDy5', |
141 |
| - full_name: 'User 4', |
142 |
| - colour: '39A345' |
143 |
| - }, |
144 |
| - { |
145 |
| - id: 2436259, |
146 |
| - login: 'webrtc_user5', |
147 |
| - password: 'x6Bt0VDy5', |
148 |
| - full_name: 'User 5', |
149 |
| - colour: '921392' |
150 |
| - }, |
151 |
| - { |
152 |
| - id: 2436262, |
153 |
| - login: 'webrtc_user6', |
154 |
| - password: 'x6Bt0VDy5', |
155 |
| - full_name: 'User 6', |
156 |
| - colour: '6594C5' |
157 |
| - }, |
158 |
| - { |
159 |
| - id: 2436263, |
160 |
| - login: 'webrtc_user7', |
161 |
| - password: 'x6Bt0VDy5', |
162 |
| - full_name: 'User 7', |
163 |
| - colour: 'C1061E' |
164 |
| - }, |
165 |
| - { |
166 |
| - id: 2436265, |
167 |
| - login: 'webrtc_user8', |
168 |
| - password: 'x6Bt0VDy5', |
169 |
| - full_name: 'User 8', |
170 |
| - colour: '898989' |
171 |
| - }, |
172 |
| - { |
173 |
| - id: 2436266, |
174 |
| - login: 'webrtc_user9', |
175 |
| - password: 'x6Bt0VDy5', |
176 |
| - full_name: 'User 9', |
177 |
| - colour: 'C7B325' |
178 |
| - }, |
179 |
| - { |
180 |
| - id: 2436269, |
181 |
| - login: 'webrtc_user10', |
182 |
| - password: 'x6Bt0VDy5', |
183 |
| - full_name: 'User 10', |
184 |
| - colour: 'BDA0CA' |
185 |
| - } |
186 |
| - ]; |
187 |
| - |
188 |
| - /** set QBUsers */ |
189 |
| - var QBUsers = usersQuery === 'prod' ? QBUsersProd : usersQuery === 'dev' ? QBUsersDev : QBUsersQA; |
190 |
| - |
191 | 18 | var MESSAGES = {
|
192 | 19 | 'login': 'Login as any user on this computer and another user on another computer.',
|
193 | 20 | 'create_session': 'Creating a session...',
|
|
201 | 28 | 'no_internet': 'Please check your Internet connection and try again'
|
202 | 29 | };
|
203 | 30 |
|
204 |
| - /** |
205 |
| - * PRIVATE |
206 |
| - */ |
207 |
| - /** |
208 |
| - * [_getQueryVar get value of key from search string of url] |
209 |
| - * @param {[string]} q [name of query] |
210 |
| - * @return {[string]} [value of query] |
211 |
| - */ |
212 |
| - function _getQueryVar(q) { |
213 |
| - var query = window.location.search.substring(1), |
214 |
| - vars = query.split("&"), |
215 |
| - answ = false; |
216 |
| - |
217 |
| - vars.forEach(function(el, i){ |
218 |
| - var pair = el.split('='); |
219 |
| - |
220 |
| - if(pair[0] === q) { |
221 |
| - answ = pair[1]; |
222 |
| - } |
223 |
| - }); |
224 |
| - |
225 |
| - return answ; |
226 |
| - } |
227 |
| - |
228 |
| - /** |
229 |
| - * set configuration variables in global |
230 |
| - */ |
231 |
| - window.app = {}; |
232 |
| - window.app.CONFIG = { |
233 |
| - 'qbApp': QBApp, |
234 |
| - 'config': CONFIG, |
235 |
| - 'qbUsers': QBUsers, |
236 |
| - 'msgs': MESSAGES |
| 31 | + window.CONFIG = { |
| 32 | + 'CREDENTIALS': CREDENTIALS, |
| 33 | + 'APP_CONFIG': CONFIG, |
| 34 | + 'MESSAGES': MESSAGES |
237 | 35 | };
|
238 | 36 | }(window));
|
0 commit comments