@everymatrix/casino-page 0.0.235 → 0.0.239
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/dist/casino-page.js +1 -1
- package/dist/casino-page.js.map +1 -1
- package/package.json +2 -2
- package/src/CasinoPage.svelte +50 -7
- package/src/i18n.js +8 -2
- package/src/translations.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-page",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.239",
|
|
4
4
|
"main": "dist/casino-page.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "3514a454516ab9691e0154509b1a13d332315cc5"
|
|
40
40
|
}
|
package/src/CasinoPage.svelte
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import { onMount } from "svelte";
|
|
5
5
|
import { getDevice } from 'rvhelper';
|
|
6
|
-
import { _, addNewMessages, setupI18n } from './i18n';
|
|
6
|
+
import { _, addNewMessages, setupI18n, setLocale } from './i18n';
|
|
7
7
|
import { CasinoPageTranslations } from './translations';
|
|
8
8
|
import type {
|
|
9
9
|
CategoriesData,
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
export let endpoint:string = '';
|
|
18
18
|
export let datasource:string = '';
|
|
19
|
+
export let currency:string = '';
|
|
19
20
|
export let lang:string = ''; // Language
|
|
20
21
|
export let session:string = ''; // Value for sessionID
|
|
21
22
|
export let userid:string = ''; // Value for UserID;
|
|
@@ -27,13 +28,13 @@
|
|
|
27
28
|
export let alternativesearch:string = 'false';
|
|
28
29
|
export let favorites:string = '';
|
|
29
30
|
export let mostplayed:string = '';
|
|
31
|
+
export let containermaxwidth:string = '1300';
|
|
30
32
|
export let lobbyid:string = 'casinodefault'; // identifier for recent searched
|
|
31
|
-
|
|
32
|
-
export let containermaxwidth:string = '';
|
|
33
33
|
export let haspanicbutton:string = 'false';
|
|
34
34
|
|
|
35
35
|
export let mostplayedrounds:string = '';
|
|
36
36
|
export let activecategory:string = '';
|
|
37
|
+
export let livecasino:string = 'false';
|
|
37
38
|
|
|
38
39
|
// CasinoPage loading state
|
|
39
40
|
let isLoading:boolean = false;
|
|
@@ -92,6 +93,7 @@
|
|
|
92
93
|
let currentCategoryId:string = '';
|
|
93
94
|
let activeCategoryAux:any = undefined;
|
|
94
95
|
let customStylingContainer:HTMLElement;
|
|
96
|
+
let urlCasino:any;
|
|
95
97
|
|
|
96
98
|
setupI18n({ withLocale: 'en', translations: {}});
|
|
97
99
|
|
|
@@ -110,6 +112,12 @@
|
|
|
110
112
|
activeCategory = '';
|
|
111
113
|
mostPlayedScreen = false;
|
|
112
114
|
scrollTop = true;
|
|
115
|
+
|
|
116
|
+
// needs to be executed after the lobby has been repopulated
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
window.postMessage({ type: 'WidgetTopReference', scrollTop }, window.location.href);
|
|
119
|
+
}, 1);
|
|
120
|
+
|
|
113
121
|
break;
|
|
114
122
|
|
|
115
123
|
case 'FAVORITES':
|
|
@@ -133,12 +141,18 @@
|
|
|
133
141
|
if (res.count > 0) {
|
|
134
142
|
let promises:any = [];
|
|
135
143
|
|
|
144
|
+
if(livecasino) {
|
|
145
|
+
res.items = [{gameId: '15786'}, {gameId: '15788'}];
|
|
146
|
+
}
|
|
136
147
|
res.items.forEach((item:any) => {
|
|
137
148
|
let url = new URL(`${endpoint}/casino/games/${item.gameId}`);
|
|
138
149
|
|
|
139
150
|
url.searchParams.append('datasource', datasource);
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
if(livecasino) {
|
|
152
|
+
promises.push(fetch(url).then((res:any) => res.json()));
|
|
153
|
+
} else {
|
|
154
|
+
promises.push(fetch(url.href).then((res:any) => res.json()));
|
|
155
|
+
}
|
|
142
156
|
});
|
|
143
157
|
|
|
144
158
|
Promise.all(promises).then((values:any) => {
|
|
@@ -165,7 +179,7 @@
|
|
|
165
179
|
activeCategory = categoryEvent.data.itemId;
|
|
166
180
|
|
|
167
181
|
setTimeout(() => {
|
|
168
|
-
window.postMessage({ type: 'CategoryUpdate', itemId: activeCategory }, window.location.href);
|
|
182
|
+
window.postMessage({ type: 'CategoryUpdate', itemId: activeCategory, index: categoryEvent.data.index }, window.location.href);
|
|
169
183
|
}, 100);
|
|
170
184
|
break;
|
|
171
185
|
}
|
|
@@ -272,8 +286,9 @@
|
|
|
272
286
|
url.searchParams.append('rounds', options.rounds);
|
|
273
287
|
}
|
|
274
288
|
|
|
289
|
+
urlCasino = livecasino ? url : url.href;
|
|
275
290
|
return new Promise((resolve, reject) => {
|
|
276
|
-
fetch(
|
|
291
|
+
fetch(urlCasino)
|
|
277
292
|
.then((res:any) => res.json())
|
|
278
293
|
.then((data:any) => {
|
|
279
294
|
resolve(data);
|
|
@@ -734,6 +749,8 @@
|
|
|
734
749
|
getFavoredGames(endpoint, sessionID, playerID);
|
|
735
750
|
}
|
|
736
751
|
|
|
752
|
+
setLocale(lang);
|
|
753
|
+
|
|
737
754
|
let categoriesUrl = new URL(`${endpoint}/casino/groups/${datasource}`);
|
|
738
755
|
|
|
739
756
|
categoriesUrl.searchParams.append('language', lang);
|
|
@@ -830,6 +847,22 @@
|
|
|
830
847
|
<div class="SearchBarPlaceholder"></div>
|
|
831
848
|
{/if}
|
|
832
849
|
|
|
850
|
+
{#if livecasino}
|
|
851
|
+
{#if !favoritesScreen && !lobbyScreen && !mobileSearchViewActive && numberOfFilters && getDevice(userAgent) !== 'PC'}
|
|
852
|
+
<div class="ClearFilterMobileButtonWrapper" on:click="{() => clearVendorFilter()}">
|
|
853
|
+
<div class="ClearButton">Clear
|
|
854
|
+
<span class="ClearIcon">
|
|
855
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
856
|
+
viewBox="0 0 378.303 378.303" style="enable-background:new 0 0 378.303 378.303;" xml:space="preserve">
|
|
857
|
+
<polygon style="fill:var(--emfe-w-color-secondary, #FD2839);" points="378.303,28.285 350.018,0 189.151,160.867 28.285,0 0,28.285 160.867,189.151 0,350.018
|
|
858
|
+
28.285,378.302 189.151,217.436 350.018,378.302 378.303,350.018 217.436,189.151 "/>
|
|
859
|
+
</svg>
|
|
860
|
+
</span>
|
|
861
|
+
</div>
|
|
862
|
+
</div>
|
|
863
|
+
{/if}
|
|
864
|
+
{/if}
|
|
865
|
+
|
|
833
866
|
{#if alternativesearch === 'false'}
|
|
834
867
|
<!-- main search layout -->
|
|
835
868
|
<div bind:this={searchWrapper} class="CategoriesHeaderSection {(getDevice(userAgent) !== 'PC') ? 'CategoriesHeaderMobileSection' : ''} {mobileSearchViewActive ? 'SearchMobileActive' : ''} {mobileSearchViewActive || (searched && !(getDevice(userAgent) === 'PC') && !closeSearch) ? "CategoriesHeaderSearchActive" : ''} {(adjustingScroll && mobileSearchViewActive) ? 'SearchStickTop' : ''}"
|
|
@@ -958,6 +991,7 @@
|
|
|
958
991
|
endpoint={endpoint}
|
|
959
992
|
datasource={datasource}
|
|
960
993
|
lang={lang}
|
|
994
|
+
currency={currency}
|
|
961
995
|
session={session}
|
|
962
996
|
userid={userid}
|
|
963
997
|
use:sendSearchData={searchArray}
|
|
@@ -967,6 +1001,7 @@
|
|
|
967
1001
|
class="CategoryContainer"
|
|
968
1002
|
{clientstyling}
|
|
969
1003
|
{clientstylingurl}
|
|
1004
|
+
{livecasino}
|
|
970
1005
|
/>
|
|
971
1006
|
{:else}
|
|
972
1007
|
{#if lobbyScreen}
|
|
@@ -977,6 +1012,7 @@
|
|
|
977
1012
|
endpoint={endpoint}
|
|
978
1013
|
datasource={datasource}
|
|
979
1014
|
lang={lang}
|
|
1015
|
+
currency={currency}
|
|
980
1016
|
use:sendCategoryData={category}
|
|
981
1017
|
categoryid={category}
|
|
982
1018
|
categoryindex={index}
|
|
@@ -986,6 +1022,7 @@
|
|
|
986
1022
|
style="background-color: {(index % 2 !== 0) ? categorybackground : 'transparent'}"
|
|
987
1023
|
{clientstyling}
|
|
988
1024
|
{clientstylingurl}
|
|
1025
|
+
{livecasino}
|
|
989
1026
|
/>
|
|
990
1027
|
{/each}
|
|
991
1028
|
{:else if favoritesScreen}
|
|
@@ -995,12 +1032,14 @@
|
|
|
995
1032
|
endpoint={endpoint}
|
|
996
1033
|
datasource={datasource}
|
|
997
1034
|
lang={lang}
|
|
1035
|
+
currency={currency}
|
|
998
1036
|
favorites={favorites}
|
|
999
1037
|
use:showFavoriteGames={`${endpoint}/player/${playerID}/favorites/`, sessionID, playerID}
|
|
1000
1038
|
categoryid={"FAVORITES"}
|
|
1001
1039
|
class="CategoryContainer"
|
|
1002
1040
|
{clientstyling}
|
|
1003
1041
|
{clientstylingurl}
|
|
1042
|
+
{livecasino}
|
|
1004
1043
|
/>
|
|
1005
1044
|
{:else if mostPlayedScreen}
|
|
1006
1045
|
{#if mostPlayedEmpty}
|
|
@@ -1012,6 +1051,7 @@
|
|
|
1012
1051
|
endpoint={endpoint}
|
|
1013
1052
|
datasource={datasource}
|
|
1014
1053
|
lang={lang}
|
|
1054
|
+
currency={currency}
|
|
1015
1055
|
favorites={favorites}
|
|
1016
1056
|
categoryid="MOSTPLAYED"
|
|
1017
1057
|
categoryindex="1"
|
|
@@ -1019,6 +1059,7 @@
|
|
|
1019
1059
|
class="CategoryContainer"
|
|
1020
1060
|
{clientstyling}
|
|
1021
1061
|
{clientstylingurl}
|
|
1062
|
+
{livecasino}
|
|
1022
1063
|
/>
|
|
1023
1064
|
{/if}
|
|
1024
1065
|
{:else}
|
|
@@ -1029,12 +1070,14 @@
|
|
|
1029
1070
|
datasource={datasource}
|
|
1030
1071
|
favorites={favorites}
|
|
1031
1072
|
lang={lang}
|
|
1073
|
+
currency={currency}
|
|
1032
1074
|
session={session}
|
|
1033
1075
|
categoryid={activeCategory}
|
|
1034
1076
|
categorygames="9"
|
|
1035
1077
|
class="CategoryContainer"
|
|
1036
1078
|
{clientstyling}
|
|
1037
1079
|
{clientstylingurl}
|
|
1080
|
+
{livecasino}
|
|
1038
1081
|
/>
|
|
1039
1082
|
{/if}
|
|
1040
1083
|
{/if}
|
package/src/i18n.js
CHANGED
|
@@ -11,11 +11,17 @@ function setupI18n({ withLocale: _locale, translations }) {
|
|
|
11
11
|
dictionary.set(translations);
|
|
12
12
|
locale.set(_locale);
|
|
13
13
|
}
|
|
14
|
-
});
|
|
14
|
+
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
15
|
+
/*dictionary.set(translations);
|
|
16
|
+
locale.set(_locale);*/
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
function addNewMessages(lang, dict) {
|
|
18
20
|
addMessages(lang, dict);
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
function setLocale(_locale) {
|
|
24
|
+
locale.set(_locale);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { _, setupI18n, addNewMessages, setLocale };
|
package/src/translations.js
CHANGED