@everymatrix/casino-footer 1.0.13 → 1.0.14

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-footer",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "main": "dist/casino-footer.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": "4b2bbc7cb2c3424950a39147a985ac5d38207cdf"
39
+ "gitHead": "5da9a4e3b1b2d635a921ce3981f56157191f5aa7"
40
40
  }
@@ -15,6 +15,7 @@
15
15
  export let env:string = '';
16
16
  export let clientstyling:string = '';
17
17
  export let clientstylingurl:string = '';
18
+ export let translationUrl:string = '';
18
19
  // Clock exposed attributes - If the clock is enabled, all attributes should be given a value, otherwise they can be ignored safely
19
20
  export let clockenabled:string = ''; // "true" to enable, anything to disable
20
21
  export let clocksecondsenabled:string = ''; // "true" to display seconds in our default format and to refresh the clock every 1000ms
@@ -73,6 +74,19 @@
73
74
 
74
75
  let timeString:string = '';
75
76
 
77
+ const setTranslationUrl = ():void => {
78
+ let url:string = translationUrl;
79
+
80
+ fetch(url).then((res:any) => res.json())
81
+ .then((res) => {
82
+ Object.keys(res).forEach((item:any):void => {
83
+ addNewMessages(item, res[item]);
84
+ });
85
+ }).catch((err:any) => {
86
+ console.log(err);
87
+ });
88
+ }
89
+
76
90
  let customStylingContainer:HTMLElement;
77
91
  let displayNoneCustomStyling:Boolean = false;
78
92
 
@@ -297,6 +311,7 @@
297
311
  $: clientstyling && customStylingContainer && setClientStyling();
298
312
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
299
313
  $: endpoint && lang && env && userroles && getCmsData();
314
+ $: translationUrl && setTranslationUrl();
300
315
  $: clockenabled !== 'false' && clocksecondsenabled && clockcustomformat && clockDisplay();
301
316
  $: clockenabled !== 'false' && clocksecondsenabled && (refreshRate = clocksecondsenabled == "true" ? 1000 : 60000) && refreshClock();
302
317
  $: lang && (selectedLanguage = lang) && languages && (languages.length > 0) && updateLanguageDisplayName();