@everymatrix/casino-tournaments-controller 1.44.0 → 1.45.2
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/components/CasinoTournamentsController-CQ5C1jDl.cjs +14 -0
- package/components/CasinoTournamentsController-Cr8b4j7l.js +5627 -0
- package/components/CasinoTournamentsFilterController-BtuK-ddv.cjs +1 -0
- package/components/CasinoTournamentsFilterController-Chy_sE0V.js +529 -0
- package/components/CasinoTournamentsListController-BinvLjvx.cjs +13 -0
- package/components/CasinoTournamentsListController-DXHqP9An.js +3103 -0
- package/components/CasinoTournamentsThumbnail-BFS6MlWH.js +865 -0
- package/components/CasinoTournamentsThumbnail-CM3Rfdn3.cjs +4 -0
- package/components/CasinoTournamentsThumbnailController-C71hXcQP.cjs +1 -0
- package/components/CasinoTournamentsThumbnailController-NEf6XMRB.js +1405 -0
- package/components/CasinoTournamentsThumbnailDuration-CrS_PUCZ.cjs +1 -0
- package/components/CasinoTournamentsThumbnailDuration-bu3Mm2Ay.js +495 -0
- package/components/CasinoTournamentsThumbnailGamesSlider-DNrAc-zm.cjs +1 -0
- package/components/CasinoTournamentsThumbnailGamesSlider-_haSuIUI.js +438 -0
- package/components/CasinoTournamentsThumbnailPrizes-BRcfU1P4.js +310 -0
- package/components/CasinoTournamentsThumbnailPrizes-E5pafLaj.cjs +1 -0
- package/es2015/casino-tournaments-controller.cjs +1 -0
- package/es2015/casino-tournaments-controller.js +16 -0
- package/package.json +18 -32
- package/.eslintrc +0 -84
- package/CHANGELOG.md +0 -11
- package/README.md +0 -0
- package/dist/casino-tournaments-controller.js +0 -2
- package/dist/casino-tournaments-controller.js.map +0 -1
- package/documentation.md +0 -170
- package/index.html +0 -29
- package/index.js +0 -1
- package/public/favicon.png +0 -0
- package/public/reset.css +0 -48
- package/rollup.config.js +0 -67
- package/src/CasinoTournamentsController.svelte +0 -527
- package/src/i18n.js +0 -27
- package/src/index.ts +0 -4
- package/src/translations.js +0 -62
- package/src/util.ts +0 -2
- package/stories/CasinoTournamentsController.stories.js +0 -13
- package/svelte.config.js +0 -7
- package/tsconfig.json +0 -6
|
@@ -1,527 +0,0 @@
|
|
|
1
|
-
<svelte:options tag={null} />
|
|
2
|
-
|
|
3
|
-
<script lang="ts">
|
|
4
|
-
import { onMount } from 'svelte';
|
|
5
|
-
import { getDevice } from 'rvhelper';
|
|
6
|
-
import { _, addNewMessages, setLocale, setupI18n } from './i18n';
|
|
7
|
-
import { TRANSLATIONS } from './translations';
|
|
8
|
-
import { EventSourcePolyfill } from 'event-source-polyfill';
|
|
9
|
-
|
|
10
|
-
import '@everymatrix/casino-tournaments-filter-controller';
|
|
11
|
-
import '@everymatrix/casino-tournaments-list-controller';
|
|
12
|
-
import { isValidSession } from './util';
|
|
13
|
-
|
|
14
|
-
// endpoint for NorWAy
|
|
15
|
-
export let session:string = '';
|
|
16
|
-
export let userid:string = '';
|
|
17
|
-
export let endpoint:string = '';
|
|
18
|
-
export let lang:string = 'en';
|
|
19
|
-
export let translationurl:string = '';
|
|
20
|
-
// number of default tournaments shown
|
|
21
|
-
export let numberoftournaments:string = '6';
|
|
22
|
-
// number of added elements to the list when showmore is clicked
|
|
23
|
-
export let showmorestep:string = '2';
|
|
24
|
-
export let filters:string = 'All';
|
|
25
|
-
export let loginevent:string = '';
|
|
26
|
-
export let registerevent:string = '';
|
|
27
|
-
export let loginurl:string = '';
|
|
28
|
-
export let registerurl:string = '';
|
|
29
|
-
export let currency:string = 'EUR';
|
|
30
|
-
export let keepbrowsercontext:string = 'false';
|
|
31
|
-
export let sorttype: string = '';
|
|
32
|
-
export let sortorder: string = ''
|
|
33
|
-
export let starttimeafter: string = '' // start time after how many days
|
|
34
|
-
export let showanonymoustournaments: string = 'true'
|
|
35
|
-
|
|
36
|
-
export let clientstyling:string = '';
|
|
37
|
-
export let clientstylingurl:string = '';
|
|
38
|
-
|
|
39
|
-
export let delaybeforeload = 1000;//to avoid duplicate initload
|
|
40
|
-
|
|
41
|
-
// Variables of topics for communication
|
|
42
|
-
let hasErrors:boolean = false;
|
|
43
|
-
let error:string = '';
|
|
44
|
-
let isLoggedIn:boolean = false;
|
|
45
|
-
let sessionID:string = '';
|
|
46
|
-
let playerID:string = '';
|
|
47
|
-
let userAgent:string = window.navigator.userAgent;
|
|
48
|
-
let isLoading:boolean = true;
|
|
49
|
-
let filtersLoaded:boolean = false;
|
|
50
|
-
let startingTournamentUpdater:boolean = false;
|
|
51
|
-
|
|
52
|
-
let customStylingContainer: HTMLElement;
|
|
53
|
-
let displayNone:boolean = false;
|
|
54
|
-
|
|
55
|
-
let filtersArray = 'All,Scheduled,Ongoing,Finished';
|
|
56
|
-
let tournamentsNumber:number = 0;
|
|
57
|
-
|
|
58
|
-
let isMounted = false;
|
|
59
|
-
// Default state
|
|
60
|
-
let tournamentsShownNumber:number = 6;
|
|
61
|
-
let allTournamentsShown:boolean = true;
|
|
62
|
-
let activeFilters:Array<string> = [];
|
|
63
|
-
|
|
64
|
-
let tournamentsSearchParams:string;
|
|
65
|
-
let tournamentsUpdateEventSource:EventSourcePolyfill;
|
|
66
|
-
let isLoadTriggered: boolean = false;
|
|
67
|
-
let clientTranslation: typeof TRANSLATIONS;
|
|
68
|
-
|
|
69
|
-
setupI18n({ withLocale: 'en', translations: {}});
|
|
70
|
-
|
|
71
|
-
const setTranslationUrl = ():void => {
|
|
72
|
-
let url:string = translationurl;
|
|
73
|
-
|
|
74
|
-
fetch(url).then((res:any) => res.json())
|
|
75
|
-
.then((res) => {
|
|
76
|
-
clientTranslation = res;
|
|
77
|
-
Object.keys(res).forEach((item:any):void => {
|
|
78
|
-
addNewMessages(item, res[item]);
|
|
79
|
-
});
|
|
80
|
-
}).catch((err:any) => {
|
|
81
|
-
console.log(err);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const applyTranslation = (translation: any) => {
|
|
86
|
-
if(!translation) return;
|
|
87
|
-
Object.keys(translation).forEach((item:any):void => {
|
|
88
|
-
addNewMessages(item, translation[item]);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
Object.keys(TRANSLATIONS).forEach((item:any) => {
|
|
93
|
-
addNewMessages(item, TRANSLATIONS[item]);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const messageHandler = (e:any) => {
|
|
97
|
-
if (e.data && e.data.type === 'UserSessionID') {
|
|
98
|
-
isLoggedIn = true;
|
|
99
|
-
sessionID = e.data.session;
|
|
100
|
-
playerID = e.data.userid;
|
|
101
|
-
|
|
102
|
-
getData(endpoint, 0, tournamentsShownNumber);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (e.data && e.data.type === 'TournamentsFiltersSelected') {
|
|
106
|
-
activeFilters = e.data.filters;
|
|
107
|
-
|
|
108
|
-
getData(endpoint, 0, tournamentsShownNumber);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if(e.data && e.data.type === 'TournamentThumbnailMounted'){
|
|
112
|
-
applyTranslation(clientTranslation);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const matchStatus = (status:string) => {
|
|
117
|
-
if (status == 'Scheduled') {
|
|
118
|
-
return 'Unstarted';
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (status == 'Ongoing') {
|
|
122
|
-
return 'Running';
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return 'Closing|Closed';
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const getData = async (url:string, offset:number, limit:number) => {
|
|
129
|
-
isLoading = true;
|
|
130
|
-
tournamentsNumber = 0;
|
|
131
|
-
|
|
132
|
-
const res = await fetcher(url, offset, limit)
|
|
133
|
-
|
|
134
|
-
setTimeout(() => {
|
|
135
|
-
window.postMessage({ type: 'TournamentList', tournamentList: res.items }, window.location.href);
|
|
136
|
-
}, 50)
|
|
137
|
-
|
|
138
|
-
isLoading = false;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const getDataWithoutfresh = async (url:string, offset:number, limit:number) => {
|
|
142
|
-
const res = await fetcher(url, offset, limit)
|
|
143
|
-
|
|
144
|
-
window.postMessage({ type: 'TournamentListShowMore', tournamentList: res.items }, window.location.href);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const getStartTimeAfter = () => {
|
|
148
|
-
|
|
149
|
-
const dateStartTimeAfter = new Date();
|
|
150
|
-
|
|
151
|
-
if(starttimeafter){
|
|
152
|
-
dateStartTimeAfter.setDate(
|
|
153
|
-
dateStartTimeAfter.getDate() - Number(starttimeafter)
|
|
154
|
-
);
|
|
155
|
-
}else{
|
|
156
|
-
dateStartTimeAfter.setMonth(
|
|
157
|
-
dateStartTimeAfter.getMonth() - 1
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return dateStartTimeAfter.toISOString().substring(0, 10);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const fetcher = async (url:string, offset:number, limit:number) => {
|
|
165
|
-
|
|
166
|
-
let tournamentsUrl:URL = new URL(`${url}/v1/tournaments`);
|
|
167
|
-
let reqHeaders:Headers = new Headers();
|
|
168
|
-
|
|
169
|
-
tournamentsUrl.searchParams.append('pagination', `offset=${offset},limit=${limit}`);
|
|
170
|
-
tournamentsUrl.searchParams.append('sortField', 'StartTime');
|
|
171
|
-
tournamentsUrl.searchParams.append('sortOrder', sortorder || 'desc');
|
|
172
|
-
tournamentsUrl.searchParams.append('language', lang);
|
|
173
|
-
|
|
174
|
-
const filterOptions: any = {
|
|
175
|
-
StartTimeAfter: getStartTimeAfter(),
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if(!isValidSession(session) && showanonymoustournaments === 'false'){
|
|
179
|
-
filterOptions.tags = 'no-role-set'
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (activeFilters.length > 0 && activeFilters[0] != 'All') {
|
|
183
|
-
filterOptions.state = activeFilters.map((item:any) => matchStatus(item)).join("|")
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const filter = Object.keys(filterOptions).map(k => `${k}=${filterOptions[k]}`).join(',')
|
|
187
|
-
tournamentsUrl.searchParams.append('filter', filter);
|
|
188
|
-
|
|
189
|
-
tournamentsUrl.searchParams.append('platform', getDevice(userAgent));
|
|
190
|
-
|
|
191
|
-
if(sorttype){
|
|
192
|
-
tournamentsUrl.searchParams.append('sortType', sorttype);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (isLoggedIn) {
|
|
196
|
-
reqHeaders.append("X-SessionID", sessionID);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
let requestOptions: RequestInit = {
|
|
200
|
-
method: 'GET',
|
|
201
|
-
headers: reqHeaders,
|
|
202
|
-
cache: 'no-cache'
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
return fetch(tournamentsUrl, requestOptions)
|
|
206
|
-
.then((res:any) => res.json())
|
|
207
|
-
.then((res:any) => {
|
|
208
|
-
tournamentsSearchParams = tournamentsUrl.searchParams.toString();
|
|
209
|
-
|
|
210
|
-
tournamentsNumber = res.total;
|
|
211
|
-
|
|
212
|
-
if (tournamentsShownNumber >= tournamentsNumber) {
|
|
213
|
-
allTournamentsShown = true;
|
|
214
|
-
} else {
|
|
215
|
-
allTournamentsShown = false;
|
|
216
|
-
}
|
|
217
|
-
if(!startingTournamentUpdater){
|
|
218
|
-
startupTouramentDataChangeListener();
|
|
219
|
-
}
|
|
220
|
-
return res
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
const tournamentsUpdateMessageHandler = (message: any)=>{
|
|
224
|
-
if(message.type != 'message'){
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
let messageData = message.data;
|
|
228
|
-
if(messageData){
|
|
229
|
-
try{
|
|
230
|
-
let updateTourData = JSON.parse(messageData);
|
|
231
|
-
if(!updateTourData || !updateTourData.item){
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
let updateInfo = updateTourData.item;
|
|
235
|
-
if(updateTourData.messageType == "TournamentUpdate"){
|
|
236
|
-
window.postMessage({type: 'UpdateTournamentView', tournamentData: updateInfo}, window.location.href);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if(updateTourData.messageType == 'TournamentRemove'){
|
|
240
|
-
//remove tournament from TournamentList by id
|
|
241
|
-
window.postMessage({ type: 'TournamentList', tournamentList: updateTourData.items }, window.location.href);
|
|
242
|
-
}
|
|
243
|
-
}catch(err){
|
|
244
|
-
console.error(err);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
const startupTouramentDataChangeListener = ()=>{
|
|
249
|
-
startingTournamentUpdater = true;
|
|
250
|
-
setTimeout(()=>{
|
|
251
|
-
startingTournamentUpdater = false;//to make sure only one eventsource work at the same time when query parameter changed
|
|
252
|
-
}, 1000)
|
|
253
|
-
if(tournamentsUpdateEventSource){
|
|
254
|
-
tournamentsUpdateEventSource.removeEventListener('message', tournamentsUpdateMessageHandler);
|
|
255
|
-
tournamentsUpdateEventSource.close();
|
|
256
|
-
}
|
|
257
|
-
let endpointURL: string = `${endpoint}/v1/tournaments/updates?${tournamentsSearchParams}`;
|
|
258
|
-
tournamentsUpdateEventSource = new EventSourcePolyfill(endpointURL, {headers: {'accept': 'text/event-stream','X-SessionId': session}});
|
|
259
|
-
if(typeof(tournamentsUpdateEventSource) != "undefined"){
|
|
260
|
-
tournamentsUpdateEventSource.addEventListener('message', tournamentsUpdateMessageHandler);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const showMoreAction = async () => {
|
|
265
|
-
let previousNumber = tournamentsShownNumber
|
|
266
|
-
|
|
267
|
-
const _showmorestep = parseInt(showmorestep, 10);
|
|
268
|
-
tournamentsShownNumber += _showmorestep
|
|
269
|
-
|
|
270
|
-
window.postMessage({ type: 'TournamentsPagination', offset: 0, limit: tournamentsShownNumber }, window.location.href);
|
|
271
|
-
|
|
272
|
-
await getDataWithoutfresh(endpoint, previousNumber, _showmorestep)
|
|
273
|
-
|
|
274
|
-
if (tournamentsShownNumber >= tournamentsNumber) {
|
|
275
|
-
allTournamentsShown = true;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
const checkAttrs = () => {
|
|
280
|
-
if (!endpoint) {
|
|
281
|
-
error = "Endpoint is missing! Please provide a valid endpointURL.";
|
|
282
|
-
hasErrors = true;
|
|
283
|
-
|
|
284
|
-
console.error(error);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
if (!lang || lang.length != 2) {
|
|
288
|
-
error = "Language is missing! Please provide a valid language (alpha2code)";
|
|
289
|
-
hasErrors = true;
|
|
290
|
-
|
|
291
|
-
console.error(error);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return hasErrors;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const initialLoad = () => {
|
|
298
|
-
if(!isMounted) return false;
|
|
299
|
-
if (!checkAttrs()) {
|
|
300
|
-
tournamentsShownNumber = parseInt(numberoftournaments, 10);
|
|
301
|
-
|
|
302
|
-
setLocale(lang);
|
|
303
|
-
|
|
304
|
-
getData(endpoint, 0, tournamentsShownNumber);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
const setActiveLanguage = ():void => {
|
|
309
|
-
setLocale(lang);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
const setActiveFilters = () => {
|
|
313
|
-
activeFilters = filters.split(',');
|
|
314
|
-
filtersLoaded = true;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
const setSession = () => {
|
|
318
|
-
if (isValidSession(session)) {
|
|
319
|
-
isLoggedIn = true;
|
|
320
|
-
sessionID = session;
|
|
321
|
-
} else {
|
|
322
|
-
isLoggedIn = false;
|
|
323
|
-
sessionID = ''
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// ensure multiple props (from session and others) change just trigger initialLoad only once
|
|
328
|
-
const shouldLoad = async () => {
|
|
329
|
-
if(!isLoadTriggered){
|
|
330
|
-
isLoadTriggered = true
|
|
331
|
-
await initialLoad()
|
|
332
|
-
isLoadTriggered = false
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const setPlayerID = () => {
|
|
337
|
-
playerID = userid;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const setClientStyling = ():void => {
|
|
341
|
-
let sheet = document.createElement('style');
|
|
342
|
-
sheet.innerHTML = clientstyling;
|
|
343
|
-
customStylingContainer.appendChild(sheet);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
const setClientStylingURL = ():void => {
|
|
347
|
-
displayNone = true;
|
|
348
|
-
|
|
349
|
-
let url:URL = new URL(clientstylingurl);
|
|
350
|
-
let cssFile:HTMLElement = document.createElement('style');
|
|
351
|
-
|
|
352
|
-
fetch(url.href)
|
|
353
|
-
.then((res:any) => res.text())
|
|
354
|
-
.then((data:any) => {
|
|
355
|
-
cssFile.innerHTML = data
|
|
356
|
-
|
|
357
|
-
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
358
|
-
setTimeout(() => { displayNone = false; }, 500);
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
onMount(() => {
|
|
363
|
-
setTimeout(()=>{
|
|
364
|
-
isMounted = true;
|
|
365
|
-
}, delaybeforeload);
|
|
366
|
-
window.addEventListener('message', messageHandler, false);
|
|
367
|
-
return () => {
|
|
368
|
-
window.removeEventListener('message', messageHandler);
|
|
369
|
-
if(tournamentsUpdateEventSource){
|
|
370
|
-
tournamentsUpdateEventSource.removeEventListener('message', tournamentsUpdateMessageHandler);
|
|
371
|
-
tournamentsUpdateEventSource.close();
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
$: customStylingContainer && clientstyling && setClientStyling();
|
|
377
|
-
$: customStylingContainer && clientstylingurl && setClientStylingURL();
|
|
378
|
-
$: userid && setPlayerID();
|
|
379
|
-
$: filters && setActiveFilters();
|
|
380
|
-
$: lang && setActiveLanguage();
|
|
381
|
-
$: translationurl && setTranslationUrl();
|
|
382
|
-
$: isMounted && initialLoad();
|
|
383
|
-
|
|
384
|
-
$: if(session === '' || session) setSession()
|
|
385
|
-
$: if(sessionID === '' || sessionID) shouldLoad()
|
|
386
|
-
$: if(endpoint && numberoftournaments && showmorestep && lang && showanonymoustournaments) shouldLoad()
|
|
387
|
-
</script>
|
|
388
|
-
|
|
389
|
-
<div bind:this={customStylingContainer}>
|
|
390
|
-
{#if hasErrors}
|
|
391
|
-
<p>{$_('500')}</p>
|
|
392
|
-
<p>{error}</p>
|
|
393
|
-
{:else}
|
|
394
|
-
<div class="TournamentsWrapper" part="TournamentsWrapper">
|
|
395
|
-
<div class="Tournaments" part="Tournaments">
|
|
396
|
-
<div class="FirstRow" part="FirstRow">
|
|
397
|
-
{#if filtersLoaded}
|
|
398
|
-
<casino-tournaments-filter-controller
|
|
399
|
-
{clientstyling}
|
|
400
|
-
{clientstylingurl}
|
|
401
|
-
filters={filtersArray}
|
|
402
|
-
activefilters={filters}
|
|
403
|
-
exportparts="FiltersController, MobileClass, Non-MobileClass/empty, Active, FilterButton, bi, bi-check, FiltersList, FiltersTitle, FiltersItem"
|
|
404
|
-
></casino-tournaments-filter-controller>
|
|
405
|
-
{/if}
|
|
406
|
-
</div>
|
|
407
|
-
<div class="SecondRow" part="SecondRow">
|
|
408
|
-
{#if tournamentsNumber == 0}
|
|
409
|
-
{#if isLoading}
|
|
410
|
-
<p class="LoadingMessage" part="LoadingMessage">{$_('loading')}</p>
|
|
411
|
-
{:else}
|
|
412
|
-
<p class="NoTournaments" part="NoTournaments">{$_('noTournaments')}</p>
|
|
413
|
-
{/if}
|
|
414
|
-
{:else}
|
|
415
|
-
<casino-tournaments-list-controller
|
|
416
|
-
{clientstyling}
|
|
417
|
-
{clientstylingurl}
|
|
418
|
-
userid={userid}
|
|
419
|
-
numberoftournaments={numberoftournaments}
|
|
420
|
-
loginurl={loginurl}
|
|
421
|
-
loginevent={loginevent}
|
|
422
|
-
registerurl={registerurl}
|
|
423
|
-
registerevent={registerevent}
|
|
424
|
-
{lang}
|
|
425
|
-
{currency}
|
|
426
|
-
{keepbrowsercontext}
|
|
427
|
-
session={session}
|
|
428
|
-
endpoint={endpoint}
|
|
429
|
-
exportparts="Thumbnail, Status, Enrolled, CardImg, CardImgFinished, Details, Title, Date, ScoreCriteria, ScoreCriteriaP, ScoreCriteriaSpan, Games, GamesP, GamesAnchor, TournamentPrizes, TournamentPrizesSvg, a, TournamentPrizesSvgA, PrizesTitle, Prizes, Prize, PrizeText, PrizeRank,
|
|
430
|
-
TournamentDuration, TournamentDates, StartDate, EndDate, ProgressBar, ProgressBarFillEnd, Finished, ProgressBarFillStarting, Remaining, ProgressBarFill,
|
|
431
|
-
TournamentsGamesSlider, SliderNavButton, items, item, PlayNowButton, itemHover, SliderNavButton
|
|
432
|
-
TournamentCard, CardMaxWidth, CardFullSize, elementToFadeOut, elementToFadeIn, ph-item, ph-col-12, ph-picture, ph-row, ph-col-6, big, ph-col-4, empty, ph-col-8, TournamentButtons, LoginButton, RegisterButton, DetailsButton, EnrolledButton, JoinButton, JoinButtonSpan, JoinButtonSvg, JoinButtonSvgA, JoinButtonFullSize, spinner, DetailsLargeButton, ErrorText, TournamentList, StatusUnstarted, StatusRunning, StatusClosed, StatusClosing, TournamentPrizesIconSection, TournamentPrizesIconWrapper"
|
|
433
|
-
></casino-tournaments-list-controller>
|
|
434
|
-
{/if}
|
|
435
|
-
</div>
|
|
436
|
-
{#if !allTournamentsShown}
|
|
437
|
-
<div class="ThirdRow" part="ThirdRow">
|
|
438
|
-
<div class="CenterButton" part="CenterButton">
|
|
439
|
-
<button class="ShowMoreButton" part="ShowMoreButton" on:click="{() => showMoreAction()}" title="Show More">{$_('showMore')}</button>
|
|
440
|
-
</div>
|
|
441
|
-
</div>
|
|
442
|
-
{/if}
|
|
443
|
-
</div>
|
|
444
|
-
</div>
|
|
445
|
-
{/if}
|
|
446
|
-
</div>
|
|
447
|
-
|
|
448
|
-
<style lang="scss">
|
|
449
|
-
$primary-background-color: var(--emfe-w-color-contrast, #07072A);
|
|
450
|
-
$font-stack: "Helvetica Neue", "Helvetica", sans-serif;
|
|
451
|
-
$primary-font-color: var(--emfe-w-color-white, #FFFFFF);
|
|
452
|
-
$primary-font-size: 1rem;
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
*,
|
|
457
|
-
*::before,
|
|
458
|
-
*::after {
|
|
459
|
-
margin: 0;
|
|
460
|
-
padding: 0;
|
|
461
|
-
list-style: none;
|
|
462
|
-
text-decoration: none;
|
|
463
|
-
outline: none;
|
|
464
|
-
box-sizing: border-box;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.ShowMoreButton {
|
|
468
|
-
background: var(--emfe-w-color-contrast, #07072A);
|
|
469
|
-
font-size: 18px;
|
|
470
|
-
width: 280px;
|
|
471
|
-
height: 60px;
|
|
472
|
-
text-align: center;
|
|
473
|
-
color: var(--emfe-w-color-green, #48952a);
|
|
474
|
-
border: solid var(--emfe-w-color-green, #48952a) 1px;
|
|
475
|
-
text-transform: uppercase;
|
|
476
|
-
margin-bottom: 20px;
|
|
477
|
-
cursor: pointer;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
.ShowMoreButton:hover {
|
|
481
|
-
opacity: 0.7;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
.TournamentsWrapper {
|
|
485
|
-
min-height: 100vh;
|
|
486
|
-
background: $primary-background-color;
|
|
487
|
-
overflow-x: hidden;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.Tournaments {
|
|
491
|
-
color: $primary-font-color;
|
|
492
|
-
display: flex;
|
|
493
|
-
flex-direction: column;
|
|
494
|
-
position: relative;
|
|
495
|
-
margin: 0 auto;
|
|
496
|
-
max-width: 1300px;
|
|
497
|
-
padding: 24px 0;
|
|
498
|
-
|
|
499
|
-
@media screen and (max-width: 1300px) {
|
|
500
|
-
padding: 24px 2.4%;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
.FirstRow {
|
|
504
|
-
width: 100%;
|
|
505
|
-
margin: 0 auto;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.SecondRow {
|
|
509
|
-
margin: 0 auto;
|
|
510
|
-
width: 100%;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
.ThirdRow {
|
|
514
|
-
display: flex;
|
|
515
|
-
flex-direction: column;
|
|
516
|
-
justify-content: center;
|
|
517
|
-
|
|
518
|
-
.CenterButton {
|
|
519
|
-
padding-top: 20px;
|
|
520
|
-
width: 100%;
|
|
521
|
-
display: flex;
|
|
522
|
-
justify-content: center;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
</style>
|
package/src/i18n.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dictionary,
|
|
3
|
-
locale,
|
|
4
|
-
addMessages,
|
|
5
|
-
_
|
|
6
|
-
} from 'svelte-i18n';
|
|
7
|
-
|
|
8
|
-
function setupI18n({ withLocale: _locale, translations }) {
|
|
9
|
-
locale.subscribe((data) => {
|
|
10
|
-
if (data == null) {
|
|
11
|
-
dictionary.set(translations);
|
|
12
|
-
locale.set(_locale);
|
|
13
|
-
}
|
|
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);*/
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function addNewMessages(lang, dict) {
|
|
20
|
-
addMessages(lang, dict);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function setLocale(_locale) {
|
|
24
|
-
locale.set(_locale);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { _, setupI18n, addNewMessages, setLocale };
|
package/src/index.ts
DELETED
package/src/translations.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export const TRANSLATIONS = {
|
|
2
|
-
"en": {
|
|
3
|
-
"500": "500 - Internal server error",
|
|
4
|
-
"showMore": "Show more",
|
|
5
|
-
"loading": "Loading, please wait ...",
|
|
6
|
-
"noTournaments": "No tournaments found"
|
|
7
|
-
},
|
|
8
|
-
"hr": {
|
|
9
|
-
"500": "500 - Interna pogreška poslužitelja",
|
|
10
|
-
"showMore": "Prikaži više",
|
|
11
|
-
"loading": "Učitavanje, molimo pričekajte ...",
|
|
12
|
-
"noTournaments": "Nema pronađenih turnira"
|
|
13
|
-
},
|
|
14
|
-
"zh-hk": {
|
|
15
|
-
"500": "500內部服務器錯誤",
|
|
16
|
-
"showMore": "顯示更多",
|
|
17
|
-
"loading": "加載請稍候 ...",
|
|
18
|
-
"noTournaments": "沒有找到比賽"
|
|
19
|
-
},
|
|
20
|
-
"fr": {
|
|
21
|
-
"500": "500 - erreur de serveur interne",
|
|
22
|
-
"showMore": "Afficher plus",
|
|
23
|
-
"loading": "Chargement , veuillez patienter ...",
|
|
24
|
-
"noTournaments": "Aucun tournoi trouvé"
|
|
25
|
-
},
|
|
26
|
-
"ro": {
|
|
27
|
-
"500": "500 - Internal server error",
|
|
28
|
-
"showMore": "Mai mult",
|
|
29
|
-
"loading": "Se încarcă, asteptati ...",
|
|
30
|
-
"noTournaments": "Niciun turneu gasit"
|
|
31
|
-
},
|
|
32
|
-
"tr": {
|
|
33
|
-
"500": "500 - Dahili sunucu hatası",
|
|
34
|
-
"showMore": "Daha fazla göster",
|
|
35
|
-
"loading": "Yükleniyor, lütfen bekleyin ...",
|
|
36
|
-
"noTournaments": "Turnuva bulunamadı"
|
|
37
|
-
},
|
|
38
|
-
"el": {
|
|
39
|
-
"500": "500 - Σφάλμα Διακομιστή",
|
|
40
|
-
"showMore": "Περισσότερα",
|
|
41
|
-
"loading": "Φορτώνει, παρακαλούμε περιμένετε ...",
|
|
42
|
-
"noTournaments": "Δεν βρέθηκαν τουρνουά"
|
|
43
|
-
},
|
|
44
|
-
"es": {
|
|
45
|
-
"500": "500 - Error servidor interno",
|
|
46
|
-
"showMore": "Mostrar más",
|
|
47
|
-
"loading": "Cargando …",
|
|
48
|
-
"noTournaments": "No se encontraron Torneos"
|
|
49
|
-
},
|
|
50
|
-
"hu": {
|
|
51
|
-
"500": "500 - Belső szerver hiba",
|
|
52
|
-
"showMore": "Mutass többet",
|
|
53
|
-
"loading": "Betöltés, kérjük várjon...",
|
|
54
|
-
"noTournaments": "Verseny nem található"
|
|
55
|
-
},
|
|
56
|
-
"pt": {
|
|
57
|
-
"500": "Erro 500 - Erro interno do servidor",
|
|
58
|
-
"showMore": "Ver mais",
|
|
59
|
-
"loading": "Carregando, por favor espere ...",
|
|
60
|
-
"noTournaments": "Nenhum torneio encontrado"
|
|
61
|
-
}
|
|
62
|
-
}
|
package/src/util.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit-element';
|
|
2
|
-
|
|
3
|
-
import CasinoTournamentsController from '../src/CasinoTournamentsController';
|
|
4
|
-
|
|
5
|
-
// This default export determines where your story goes in the story list
|
|
6
|
-
export default {
|
|
7
|
-
title: 'CasinoTournamentsController',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// 👇 We create a “template” of how args map to rendering
|
|
11
|
-
const CasinoTournamentsController = ({ aProperty }) => html`<casino-tournaments-controller></casino-tournaments-controller>`;
|
|
12
|
-
|
|
13
|
-
export const FirstStory = CasinoTournamentsController.bind({});
|
package/svelte.config.js
DELETED