@everymatrix/casino-games-category-section 1.30.1 → 1.31.1
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
|
@@ -30,7 +30,17 @@
|
|
|
30
30
|
</header>
|
|
31
31
|
|
|
32
32
|
<div class="webcomponent">
|
|
33
|
-
<casino-games-category-section
|
|
33
|
+
<casino-games-category-section
|
|
34
|
+
displayedgamecount=""
|
|
35
|
+
endpoint="https://demo-api.stage.norway.everymatrix.com"
|
|
36
|
+
lang="en"
|
|
37
|
+
datasource="RNG"
|
|
38
|
+
categoryid="RNG$jacpots"
|
|
39
|
+
fetchviaevent="false"
|
|
40
|
+
gamepagemodalurl="true"
|
|
41
|
+
integratedgameframedesktop="true"
|
|
42
|
+
integratedgameframemobile="true">
|
|
43
|
+
</casino-games-category-section>
|
|
34
44
|
</div>
|
|
35
45
|
|
|
36
46
|
</body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-games-category-section",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.1",
|
|
4
4
|
"main": "dist/casino-games-category-section.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "0b3995d8c9121bfc27eb9aed6a034bbd1583400b"
|
|
39
39
|
}
|
package/rollup.config.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
import { onMount } from "svelte";
|
|
5
5
|
import { platformFavorite, getDevice, isMobile } from 'rvhelper';
|
|
6
|
-
import { _, addNewMessages } from './i18n';
|
|
6
|
+
import { _, addNewMessages, setLocale } from './i18n';
|
|
7
7
|
import type { CategoryData } from './CasinoGamesCategorySection.type';
|
|
8
8
|
import { TRANSLATIONS } from './translations';
|
|
9
9
|
import moment from 'moment';
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
export let categoryid:string = '';
|
|
29
29
|
export let showgamename:string = '';
|
|
30
30
|
export let livecasino:string = 'false';
|
|
31
|
-
export let gamepagemodalurl:string = '
|
|
31
|
+
export let gamepagemodalurl:string = 'true';
|
|
32
32
|
export let integratedgameframedesktop:string = 'false';
|
|
33
33
|
export let integratedgameframemobile:string = 'false';
|
|
34
34
|
export let casinomygames:string = 'false';
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
export let addsortingselector:string = 'false';
|
|
37
37
|
export let filterbylogo:string = '';
|
|
38
38
|
export let casinogamesgridslider:string = 'false';
|
|
39
|
+
export let fetchviaevent:string = 'false';
|
|
40
|
+
export let displayedgamecount:string = '10';
|
|
39
41
|
|
|
40
42
|
//Revert manually
|
|
41
43
|
// let livelobbyendpoint = `${endpoint}/lobby/tables`;
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
let hidden;
|
|
84
86
|
let visibilityChange;
|
|
85
87
|
let dataloaded;
|
|
86
|
-
|
|
88
|
+
|
|
87
89
|
let favoriteGamesData:any = {
|
|
88
90
|
items: [],
|
|
89
91
|
count: 0,
|
|
@@ -266,7 +268,32 @@
|
|
|
266
268
|
});
|
|
267
269
|
}
|
|
268
270
|
|
|
271
|
+
//Standalone fetching games using categoryid when fetchviaevent is false
|
|
272
|
+
const fetchGamesByCategory = (categoryid, displayedgamecount) => {
|
|
273
|
+
if(categoryid !== ''){
|
|
274
|
+
searched = false;
|
|
275
|
+
lobbyView = true;
|
|
276
|
+
addfilterselector = 'false';
|
|
277
|
+
addsortingselector = 'false';
|
|
278
|
+
showLoadCategory = true;
|
|
279
|
+
searchItem = false;
|
|
280
|
+
validObservers = false;
|
|
281
|
+
|
|
282
|
+
getData(categoryid, 0, +displayedgamecount).then((res:any) => {
|
|
283
|
+
categoryData = res;
|
|
284
|
+
shownCategoryData = categoryData.games.items;
|
|
285
|
+
if (shownCategoryData) {
|
|
286
|
+
shownCategoryData.forEach((item:any) => {
|
|
287
|
+
item.isFavorite = checkFavorite(item.id);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
269
295
|
const messageHandler = (e:any) => {
|
|
296
|
+
|
|
270
297
|
if (e.data) {
|
|
271
298
|
switch(e.data.type) {
|
|
272
299
|
case 'MostPlayedData':
|
|
@@ -477,7 +504,7 @@
|
|
|
477
504
|
// do nothing
|
|
478
505
|
break;
|
|
479
506
|
}
|
|
480
|
-
}
|
|
507
|
+
}
|
|
481
508
|
}
|
|
482
509
|
|
|
483
510
|
// @TODO categoryId type fix
|
|
@@ -589,6 +616,10 @@
|
|
|
589
616
|
}
|
|
590
617
|
}
|
|
591
618
|
|
|
619
|
+
const setActiveLanguage = ():void => {
|
|
620
|
+
setLocale(lang);
|
|
621
|
+
}
|
|
622
|
+
|
|
592
623
|
const setClientStyling = ():void => {
|
|
593
624
|
let sheet = document.createElement('style');
|
|
594
625
|
sheet.innerHTML = clientstyling;
|
|
@@ -609,18 +640,22 @@
|
|
|
609
640
|
}
|
|
610
641
|
|
|
611
642
|
onMount(() => {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
643
|
+
if(fetchviaevent === 'true'){
|
|
644
|
+
window.addEventListener('visibilitychange', (e) => handleVisibilityChange())
|
|
645
|
+
window.addEventListener('message', messageHandler, false);
|
|
646
|
+
if(categoryid === 'FAVORITES') {
|
|
647
|
+
window.postMessage({ type: 'GetFavoredGame' }, window.location.href);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
return () => {
|
|
651
|
+
window.removeEventListener('message', messageHandler);
|
|
652
|
+
window.removeEventListener('visibilitychange', messageHandler);
|
|
653
|
+
}
|
|
621
654
|
}
|
|
622
655
|
});
|
|
623
|
-
|
|
656
|
+
|
|
657
|
+
$: lang && setActiveLanguage();
|
|
658
|
+
$: (fetchviaevent === 'false' || fetchviaevent === '') && endpoint && lang && categoryid && datasource && displayedgamecount && fetchGamesByCategory(categoryid, displayedgamecount);
|
|
624
659
|
$: dataloaded && thumbnailContainer && setupObserver();
|
|
625
660
|
$: lang && categoryid && initialSetup();
|
|
626
661
|
$: translationurl && setTranslationUrl();
|
package/src/i18n.js
CHANGED