@everymatrix/casino-tournaments-page-controller 0.0.400 → 0.0.402
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/casino-tournaments-page-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.402",
|
|
4
4
|
"main": "dist/casino-tournaments-page-controller.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": "c34a1b1831353cf2d35cc737b5b85cbfd12f9e62"
|
|
40
40
|
}
|
|
@@ -39,6 +39,8 @@
|
|
|
39
39
|
export let leaderboardoffset:string = '0';
|
|
40
40
|
export let leaderboardlimit:string = '15';
|
|
41
41
|
export let keepbrowsercontext:string = 'false';
|
|
42
|
+
export let clientstyling:string = '';
|
|
43
|
+
export let clientstylingurl:string = '';
|
|
42
44
|
// Variables of topics for communication
|
|
43
45
|
let sessionTopic;
|
|
44
46
|
|
|
@@ -68,6 +70,7 @@
|
|
|
68
70
|
let latestRank:number;
|
|
69
71
|
let isMiniMode:boolean;
|
|
70
72
|
let shownStatus:any = '';
|
|
73
|
+
let customStylingContainer:HTMLElement;
|
|
71
74
|
|
|
72
75
|
setupI18n({ withLocale: 'en', translations: {}});
|
|
73
76
|
|
|
@@ -81,7 +84,7 @@
|
|
|
81
84
|
const transFormCurrentUserData = (item:any) => {
|
|
82
85
|
let userData = {
|
|
83
86
|
Rank: showunqualifiedplayer == "false" ? item.rankWithoutUnqualified : item.rank,
|
|
84
|
-
Player: item.shortName,
|
|
87
|
+
Player: item.userID == playerID ? "me" : item.shortName,
|
|
85
88
|
Points: item.score,
|
|
86
89
|
Prize: item.prizeName,
|
|
87
90
|
Unqualified: item.unqualified,
|
|
@@ -379,6 +382,27 @@
|
|
|
379
382
|
window.postMessage({type: 'TournamentsTabLocaleTextUpdate','state': 'games', 'text': $_('tournamentsPage.games')}, window.location.href)
|
|
380
383
|
}
|
|
381
384
|
|
|
385
|
+
const setClientStyling = ():void => {
|
|
386
|
+
let sheet = document.createElement('style');
|
|
387
|
+
sheet.innerHTML = clientstyling;
|
|
388
|
+
customStylingContainer.appendChild(sheet);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const setClientStylingURL = ():void => {
|
|
392
|
+
let url:URL = new URL(clientstylingurl);
|
|
393
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
394
|
+
|
|
395
|
+
fetch(url.href)
|
|
396
|
+
.then((res:any) => res.text())
|
|
397
|
+
.then((data:any) => {
|
|
398
|
+
cssFile.innerHTML = data
|
|
399
|
+
|
|
400
|
+
if (customStylingContainer) {
|
|
401
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
|
|
382
406
|
onMount(() => {
|
|
383
407
|
window.addEventListener('message', messageHandler, false);
|
|
384
408
|
return () => {
|
|
@@ -400,6 +424,8 @@
|
|
|
400
424
|
$: initialParameters && initialLoad();
|
|
401
425
|
$: cmsendpoint && tourid && getDataFromCMS();
|
|
402
426
|
$: isMiniMode = (viewmode != 'desktop') && isMobile(userAgent); // forward this page from tournamentslider
|
|
427
|
+
$: clientstyling && setClientStyling();
|
|
428
|
+
$: clientstylingurl && setClientStylingURL();
|
|
403
429
|
</script>
|
|
404
430
|
|
|
405
431
|
{#if isLoading}
|
|
@@ -408,7 +434,7 @@
|
|
|
408
434
|
</p>
|
|
409
435
|
{/if}
|
|
410
436
|
{#if !isMiniMode}
|
|
411
|
-
<div class="TournamentsPage" part="TournamentsPage">
|
|
437
|
+
<div class="TournamentsPage" part="TournamentsPage" bind:this={customStylingContainer}>
|
|
412
438
|
<div class="TournamentsSectionWrapper" part="TournamentsSectionWrapper">
|
|
413
439
|
|
|
414
440
|
<div class="TopButtons" part="TopButtons">
|
|
@@ -492,7 +518,7 @@
|
|
|
492
518
|
</div>
|
|
493
519
|
{/if}
|
|
494
520
|
{#if isMiniMode }
|
|
495
|
-
<div class="TournamentsPage MiniMode {tournamentDetails ? 'hidden':''}" part="MiniTournamentPage">
|
|
521
|
+
<div class="TournamentsPage MiniMode {tournamentDetails ? 'hidden':''}" part="MiniTournamentPage" bind:this={customStylingContainer}>
|
|
496
522
|
<div class="TournamentContentDetails {isMobile(userAgent) ? 'MobileClass' : ''}" part="TournamentContentDetails">
|
|
497
523
|
<div class="{isMobile(userAgent) ? 'MobileClass' : ''}{showleaderboard == 'true' ? ' TournamentCardDetails' : ' FullSize'}" part="MobileTournamentCardDetails">
|
|
498
524
|
{#if !tournamentDetails}
|