@everymatrix/casino-tournaments-page-controller 0.0.115 → 0.0.119
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/index.html
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</h1>
|
|
30
30
|
</header>
|
|
31
31
|
|
|
32
|
-
<casino-tournaments-page-controller session="00dfe978-5f2d-4f1c-a215-e588d5d2dcce" userid="3657535" showleaderboard="true" endpoint="https://
|
|
32
|
+
<casino-tournaments-page-controller session="00dfe978-5f2d-4f1c-a215-e588d5d2dcce" userid="3657535" showleaderboard="true" endpoint="https://mavibet-api.stage.norway.everymatrix.com/v1" cmsendpoint="https://casinouat.pamestoixima.gr/apijson/en/tournaments/906333318049055456" lang="en" loginevent="Login" registerevent="Register" tourid="919351011811343804"></casino-tournaments-page-controller>
|
|
33
33
|
|
|
34
34
|
</body>
|
|
35
35
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-tournaments-page-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.119",
|
|
4
4
|
"main": "dist/casino-tournaments-page-controller.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6b98151ba25a6af088b7c9d63e625baceca5584a"
|
|
41
41
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="typescript">
|
|
4
4
|
import { onMount } from 'svelte';
|
|
5
5
|
import { isMobile, getDevice, checkSession } from 'rvhelper';
|
|
6
|
-
import { _, addNewMessages } from './i18n';
|
|
6
|
+
import { _, addNewMessages, setLocale, setupI18n } from './i18n';
|
|
7
7
|
import { TournamentsPageTranslations } from './translations';
|
|
8
8
|
|
|
9
9
|
import '@everymatrix/casino-tournaments-page';
|
|
@@ -11,23 +11,24 @@
|
|
|
11
11
|
import '@everymatrix/casino-tournaments-thumbnail-controller';
|
|
12
12
|
import '@everymatrix/casino-tournaments-table';
|
|
13
13
|
|
|
14
|
-
export let session:
|
|
15
|
-
export let userid:
|
|
16
|
-
export let tourid:
|
|
17
|
-
export let endpoint:
|
|
18
|
-
export let showleaderboard:
|
|
19
|
-
export let cmsendpoint:
|
|
20
|
-
export let lang:
|
|
14
|
+
export let session:string = '';
|
|
15
|
+
export let userid:string = '';
|
|
16
|
+
export let tourid:string = '';
|
|
17
|
+
export let endpoint:string = '';
|
|
18
|
+
export let showleaderboard:string = '';
|
|
19
|
+
export let cmsendpoint:string = '';
|
|
20
|
+
export let lang:string = '';
|
|
21
21
|
export let navigationbackbutton:string = 'Default';
|
|
22
|
-
export let currency:
|
|
22
|
+
export let currency:string = 'EUR';
|
|
23
|
+
export let tablelimit:string = '30';
|
|
23
24
|
|
|
24
25
|
// Variables of topics for communication
|
|
25
26
|
let sessionTopic;
|
|
26
27
|
|
|
27
|
-
let isLoggedIn:
|
|
28
|
-
let sessionID:
|
|
29
|
-
let playerID:
|
|
30
|
-
let isLoading:
|
|
28
|
+
let isLoggedIn:boolean = false;
|
|
29
|
+
let sessionID:string = '';
|
|
30
|
+
let playerID:string = '';
|
|
31
|
+
let isLoading:boolean = true;
|
|
31
32
|
let tournamentDescription:Array<any> = [];
|
|
32
33
|
|
|
33
34
|
let tournamentDetails:any = undefined;
|
|
@@ -35,11 +36,13 @@
|
|
|
35
36
|
|
|
36
37
|
let userAgent = window.navigator.userAgent;
|
|
37
38
|
|
|
38
|
-
let showTable:
|
|
39
|
-
let firstRowData = {};
|
|
40
|
-
let firstRowAvailable:
|
|
39
|
+
let showTable:boolean = false;
|
|
40
|
+
let firstRowData:any = {};
|
|
41
|
+
let firstRowAvailable:boolean = false;
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
setupI18n({ withLocale: 'en', translations: {}});
|
|
44
|
+
|
|
45
|
+
Object.keys(TournamentsPageTranslations).forEach((item:any) => {
|
|
43
46
|
addNewMessages(item, TournamentsPageTranslations[item]);
|
|
44
47
|
});
|
|
45
48
|
|
|
@@ -51,7 +54,7 @@
|
|
|
51
54
|
let tableData:any = [];
|
|
52
55
|
|
|
53
56
|
if (data && data.length > 0) {
|
|
54
|
-
data.forEach((item) => {
|
|
57
|
+
data.forEach((item:any) => {
|
|
55
58
|
if (item.unqualified == false) {
|
|
56
59
|
if (item.userID == playerID) {
|
|
57
60
|
firstRowAvailable = true;
|
|
@@ -88,7 +91,7 @@
|
|
|
88
91
|
headers: reqHeaders,
|
|
89
92
|
};
|
|
90
93
|
|
|
91
|
-
fetch(url, requestOptions)
|
|
94
|
+
fetch(url.href, requestOptions)
|
|
92
95
|
.then((res:any) => res.json())
|
|
93
96
|
.then((res:any) => {
|
|
94
97
|
tournamentDetails = res.item;
|
|
@@ -119,7 +122,7 @@
|
|
|
119
122
|
showTable = true;
|
|
120
123
|
|
|
121
124
|
// @TODO data is not iterable error fix
|
|
122
|
-
window.postMessage({ type: 'CasinoTableData', tableData: tournamentTableData }, window.location.href);
|
|
125
|
+
window.postMessage({ type: 'CasinoTableData', tableData: tournamentTableData.slice(0, tablelimit) }, window.location.href);
|
|
123
126
|
window.postMessage({ type: 'CasinoTableColumns', tableColumns }, window.location.href);
|
|
124
127
|
if (firstRowAvailable) {
|
|
125
128
|
window.postMessage({ type: 'CasinoTableFirstRowData', tableData: firstRowData }, window.location.href);
|
|
@@ -162,6 +165,7 @@
|
|
|
162
165
|
}
|
|
163
166
|
|
|
164
167
|
const initialLoad = () => {
|
|
168
|
+
setLocale(lang);
|
|
165
169
|
getData(endpoint, tourid);
|
|
166
170
|
getTableData(endpoint, tourid);
|
|
167
171
|
}
|
|
@@ -185,7 +189,7 @@
|
|
|
185
189
|
});
|
|
186
190
|
|
|
187
191
|
$: session && userid && setSession();
|
|
188
|
-
$: tourid && endpoint && session && initialLoad();
|
|
192
|
+
$: tourid && endpoint && session && lang && initialLoad();
|
|
189
193
|
$: tourid && cmsendpoint && getDataFromCMS();
|
|
190
194
|
</script>
|
|
191
195
|
|
|
@@ -229,6 +233,7 @@
|
|
|
229
233
|
showslider="true"
|
|
230
234
|
showenrolled="true"
|
|
231
235
|
fullsize={!!showleaderboard}
|
|
236
|
+
{lang}
|
|
232
237
|
{currency}
|
|
233
238
|
></casino-tournaments-thumbnail-controller>
|
|
234
239
|
{/if}
|
|
@@ -243,7 +248,7 @@
|
|
|
243
248
|
<div class="{showleaderboard == 'true' ? 'TournamentTableDetails ' : 'DisplayNone'}">
|
|
244
249
|
{#if showleaderboard == "true"}
|
|
245
250
|
{#if showTable == true}
|
|
246
|
-
<casino-tournaments-table firstrow="true" sortable="false"></casino-tournaments-table>
|
|
251
|
+
<casino-tournaments-table firstrow="true" sortable="false" {lang}></casino-tournaments-table>
|
|
247
252
|
{/if}
|
|
248
253
|
{/if}
|
|
249
254
|
</div>
|
package/src/translations.js
CHANGED
|
@@ -9,10 +9,10 @@ export const TournamentsPageTranslations = {
|
|
|
9
9
|
},
|
|
10
10
|
tr: {
|
|
11
11
|
tournamentsPage: {
|
|
12
|
-
loading: '
|
|
13
|
-
back: '
|
|
14
|
-
previous: '
|
|
15
|
-
next: '
|
|
12
|
+
loading: 'Yükelniyor, lütfen bekleyin…',
|
|
13
|
+
back: 'Geri',
|
|
14
|
+
previous: 'Önceki',
|
|
15
|
+
next: 'Sonraki',
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
};
|