@everymatrix/player-account-controller 0.0.258 → 0.0.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/player-account-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.261",
|
|
4
4
|
"main": "dist/player-account-controller.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"typescript": "^3.9.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@everymatrix/player-account-menu": "^0.0.
|
|
33
|
-
"@everymatrix/player-account-notifications": "^0.0.
|
|
32
|
+
"@everymatrix/player-account-menu": "^0.0.261",
|
|
33
|
+
"@everymatrix/player-account-notifications": "^0.0.261",
|
|
34
34
|
"cross-env": "^7.0.3",
|
|
35
35
|
"sirv-cli": "^1.0.0",
|
|
36
36
|
"svelte": "^3.0.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "a93c0ae8104c039af7d54949a0889c11bca83acb"
|
|
42
42
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { onMount, tick } from 'svelte';
|
|
5
5
|
import { getDevice } from 'rvhelper';
|
|
6
6
|
import { _, addNewMessages, setLocale, setupI18n } from './i18n';
|
|
7
|
+
import { PlayerAccountControllerTranslations } from './translations';
|
|
7
8
|
|
|
8
9
|
import '@everymatrix/player-account-menu';
|
|
9
10
|
import '@everymatrix/player-account-notifications';
|
|
@@ -90,6 +91,10 @@
|
|
|
90
91
|
|
|
91
92
|
let switchContent:boolean = false;
|
|
92
93
|
|
|
94
|
+
Object.keys(PlayerAccountControllerTranslations).forEach((item:any) => {
|
|
95
|
+
addNewMessages(item, PlayerAccountControllerTranslations[item]);
|
|
96
|
+
});
|
|
97
|
+
|
|
93
98
|
const messageHandler = (e:any):void => {
|
|
94
99
|
let url:URL;
|
|
95
100
|
|
|
@@ -104,6 +109,9 @@
|
|
|
104
109
|
switchContent = true;
|
|
105
110
|
pagePath = e.data.page.path;
|
|
106
111
|
selected = e.data.page.id;
|
|
112
|
+
if(pagePath == '/profile-info') {
|
|
113
|
+
getUserProfileInfo();
|
|
114
|
+
}
|
|
107
115
|
break;
|
|
108
116
|
|
|
109
117
|
case 'SetActivePage':
|
|
@@ -174,7 +182,7 @@
|
|
|
174
182
|
if (res.status == 200) {
|
|
175
183
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
176
184
|
type: 'success',
|
|
177
|
-
message: '
|
|
185
|
+
message: $_('playerAccount.profileUpdateSuccess')
|
|
178
186
|
}}, window.location.href);
|
|
179
187
|
window.postMessage({ type: 'ConfirmProfileInfoSave' }, window.location.href);
|
|
180
188
|
}
|
|
@@ -187,6 +195,8 @@
|
|
|
187
195
|
|
|
188
196
|
case 'SetPlayerAccountTimeout':
|
|
189
197
|
url = new URL(`${endpoint}/player/${userId}/limits`);
|
|
198
|
+
url.searchParams.append('playerId', userId);
|
|
199
|
+
|
|
190
200
|
let timeoutValue = e.data.timeoutSelected;
|
|
191
201
|
|
|
192
202
|
let dataTimeout = {
|
|
@@ -197,7 +207,6 @@
|
|
|
197
207
|
let setTimeout = {
|
|
198
208
|
method: "PUT",
|
|
199
209
|
headers: {
|
|
200
|
-
'playerId': userId,
|
|
201
210
|
'X-SessionID': sessionId,
|
|
202
211
|
'Content-Type': "application/json",
|
|
203
212
|
'Accept': 'application/json',
|
|
@@ -210,7 +219,7 @@
|
|
|
210
219
|
if (res.status == 200) {
|
|
211
220
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
212
221
|
type: 'success',
|
|
213
|
-
message: '
|
|
222
|
+
message: $_('playerAccount.timeoutSuccess')
|
|
214
223
|
}}, window.location.href);
|
|
215
224
|
window.postMessage({ type: 'LogoutSuccessfull' }, window.location.href);
|
|
216
225
|
} else {
|
|
@@ -221,6 +230,7 @@
|
|
|
221
230
|
|
|
222
231
|
case 'SetSelfExclusion':
|
|
223
232
|
url = new URL(`${endpoint}/player/${userId}/limits`);
|
|
233
|
+
url.searchParams.append('playerId', userId);
|
|
224
234
|
|
|
225
235
|
let selfExclusionPeriod = e.data.selfExclusionPeriod;
|
|
226
236
|
let selfExclusionExpiryDate = e.data.selfExclusionExpiryDate;
|
|
@@ -235,7 +245,6 @@
|
|
|
235
245
|
let setSelfExclusion = {
|
|
236
246
|
method: "PUT",
|
|
237
247
|
headers: {
|
|
238
|
-
'playerId': userId,
|
|
239
248
|
'X-SessionID': sessionId,
|
|
240
249
|
'Content-Type': "application/json",
|
|
241
250
|
'Accept': 'application/json',
|
|
@@ -248,7 +257,7 @@
|
|
|
248
257
|
if (res.status == 200) {
|
|
249
258
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
250
259
|
type: 'success',
|
|
251
|
-
message: '
|
|
260
|
+
message: $_('playerAccount.selfExclusionSuccess')
|
|
252
261
|
}}, window.location.href);
|
|
253
262
|
window.postMessage({ type: 'LogoutSuccessfull'}, window.location.href);
|
|
254
263
|
} else {
|
|
@@ -259,6 +268,7 @@
|
|
|
259
268
|
|
|
260
269
|
case 'AccountClosure':
|
|
261
270
|
url = new URL(`${endpoint}/player/${userId}/limits`);
|
|
271
|
+
url.searchParams.append('playerId', userId);
|
|
262
272
|
|
|
263
273
|
let accountClosureData = 'UserRequest';
|
|
264
274
|
let accountClosureSelection = {
|
|
@@ -272,7 +282,6 @@
|
|
|
272
282
|
let optionsAccountClosure = {
|
|
273
283
|
method: "PUT",
|
|
274
284
|
headers: {
|
|
275
|
-
'playerId': userId,
|
|
276
285
|
'X-SessionID': sessionId,
|
|
277
286
|
'Content-Type': "application/json",
|
|
278
287
|
'Accept': 'application/json',
|
|
@@ -285,7 +294,7 @@
|
|
|
285
294
|
if (res.status == 200) {
|
|
286
295
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
287
296
|
type: 'success',
|
|
288
|
-
message: '
|
|
297
|
+
message: $_('playerAccount.accountClosureSuccess')
|
|
289
298
|
}}, window.location.href);
|
|
290
299
|
window.postMessage({ type: 'LogoutSuccessfull'}, window.location.href);
|
|
291
300
|
} else {
|
|
@@ -325,7 +334,7 @@
|
|
|
325
334
|
|
|
326
335
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
327
336
|
type: 'success',
|
|
328
|
-
message: '
|
|
337
|
+
message: $_('playerAccount.limitsUpdateSuccess')
|
|
329
338
|
}}, window.location.href);
|
|
330
339
|
|
|
331
340
|
getGamingLimits(new URL(`${endpoint}/player/${playerid}/limits`));
|
|
@@ -393,7 +402,7 @@
|
|
|
393
402
|
showdeletenotification = true;
|
|
394
403
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
395
404
|
type: 'success',
|
|
396
|
-
message: '
|
|
405
|
+
message: $_('playerAccount.limitsDeleteSuccess')
|
|
397
406
|
}}, window.location.href);
|
|
398
407
|
getGamingLimits(new URL(`${endpoint}/player/${playerid}/limits`));
|
|
399
408
|
} else {
|
|
@@ -477,7 +486,7 @@
|
|
|
477
486
|
window.postMessage({ type: 'PasswordChangedSuccessfully' }, window.location.href);
|
|
478
487
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
479
488
|
type: 'success',
|
|
480
|
-
message: '
|
|
489
|
+
message: $_('playerAccount.passwordChangedSuccess')
|
|
481
490
|
}}, window.location.href);
|
|
482
491
|
} else {
|
|
483
492
|
let dataResponse:any = await response.json();
|
|
@@ -532,7 +541,7 @@
|
|
|
532
541
|
window.postMessage({ type: 'RealityCheckValueUpdated' }, window.location.href);
|
|
533
542
|
window.postMessage({ type: 'WidgetNotification', data: {
|
|
534
543
|
type: 'success',
|
|
535
|
-
message: '
|
|
544
|
+
message: $_('playerAccount.realityCheckSuccess')
|
|
536
545
|
}}, window.location.href);
|
|
537
546
|
}
|
|
538
547
|
}, (err:any) => {
|
|
@@ -725,13 +734,6 @@
|
|
|
725
734
|
{/if}
|
|
726
735
|
|
|
727
736
|
<style lang="scss">
|
|
728
|
-
//This function does a multiplication
|
|
729
|
-
// in order to work with px the
|
|
730
|
-
// same way as working with em
|
|
731
|
-
@function ttp($value) {
|
|
732
|
-
$multiplicator: 16px;
|
|
733
|
-
@return $value * $multiplicator;
|
|
734
|
-
}
|
|
735
737
|
|
|
736
738
|
:host {
|
|
737
739
|
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const PlayerAccountControllerTranslations = {
|
|
2
|
+
en: {
|
|
3
|
+
playerAccount: {
|
|
4
|
+
profileUpdateSuccess: 'Profile updated!',
|
|
5
|
+
timeoutSuccess: 'Timeout active',
|
|
6
|
+
selfExclusionSuccess: 'Self exclusion active',
|
|
7
|
+
accountClosureSuccess: 'Account closed',
|
|
8
|
+
limitsUpdateSuccess: 'Limits updated',
|
|
9
|
+
limitsDeleteSuccess: 'Limits deleted',
|
|
10
|
+
passwordChangedSuccess: 'Password changed successfully',
|
|
11
|
+
realityCheckSuccess: 'Reality check options saved'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
ro: {
|
|
15
|
+
playerAccount: {
|
|
16
|
+
profileUpdateSuccess: 'Profil updatat!',
|
|
17
|
+
timeoutSuccess: 'Timeout activ',
|
|
18
|
+
selfExclusionSuccess: 'Auto-excludere activa',
|
|
19
|
+
accountClosureSuccess: 'Cont inchis',
|
|
20
|
+
limitsUpdateSuccess: 'Limite updatate',
|
|
21
|
+
limitsDeleteSuccess: 'Limite sterse',
|
|
22
|
+
passwordChangedSuccess: 'Parola schimbata cu success',
|
|
23
|
+
realityCheckSuccess: 'Optiunile de verificare de timp salvate'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|