/
index.html
66 lines (60 loc) · 2.31 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" id="viewport" content="width=device-width, user-scalable=no">
</head>
<body onresize="didSizeChange()">
<div class="widgets" id="lmtWidget">
<div class="sr-widget sr-widget-1"></div>
</div>
</body>
<script>
var config = {
"clientId": "lmtdemo",
"matchId": 0,
"language": "en",
"layout": "single",
"disableComponents": false,
"scoreboard": "disable",
"detailedScoreboard": "disable",
"tabsPosition": "top",
"disableWidgetHeader": true,
"disableFooterStats": false,
"adsFrequency": false,
"disableAds": true
};
function updateProps(props) {
config.matchId = props.matchId
config.language = props.language
config.clientId = props.clientId
if (props.widget.isFloating) {
config.tabsPosition = "disable";
} else {
config.tabsPosition = "top";
}
SIR("updateWidget", ".sr-widget-1", config);
}
function didSizeChange() {
var widgetHeight = document.getElementById('lmtWidget').offsetHeight;
webkit.messageHandlers['didHeightChange'].postMessage(widgetHeight);
}
(function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
)})(window,document, "script", "https://widgets.sir.sportradar.com/" + config.clientId + "/widgetloader", "SIR", {
theme: true, // using custom theme
language: config.language
});
SIR("addWidget", ".sr-widget-1", "match.lmtPlus", config);
let resp = fetch('https://cdn.sbtech.com/native-config-staging/sbtech-demo/v12/config', {
method: 'GET',
headers: { 'Access-Control-Allow-Origin': '*' }
}).then(function(response) {
console.log("Dasdasdsadas", response);
}).catch(function(err) {
console.log("ERROR", err);
// Error :(
});
console.log("RESP", resp);
</script>
</html>