Trinidad T10 Blast Live Score

Publish date: 2024-04-30

Trinidad T10 Blast

More

chevron-down

9 Jun 2023 - 23 Jun 2023

"; if (match.status == 'live' && match.in_play) { matchCardHeadingHtml += createLiveTagElement(); } return matchCardHeadingHtml; } function getFormattedCricketMatchType (match) { var matchNumberWithOrdinal = ""; if (match.description.toLowerCase().indexOf("final") > -1) { return match.description; } if (match.description.toLowerCase().indexOf("eliminator") > -1) { return match.description; } if (match.description.toLowerCase().indexOf("practice") > -1) { return match.description; } var matchFormatByCode = { 1 : "ODI", 2 : "Test", 3 : "T20I", 4 : "ODI", 5 : "Test", 6 : "T20", 7 : "ODI", 8 : "T20", 9 : "ODI", 10 : "T20", 11 : "Match", 17 : "T10", 18 : "Match", 19 : "Match", }; var matchFormat = "Match"; if (match.format_code) { matchFormat = matchFormatByCode[parseInt(match.format_code)]; } else if (match.game_format) { matchFormat = matchFormatByCode[parseInt(match.game_format)]; } if (parseInt(match.match_number)) { matchNumberWithOrdinal = getOrdinal(parseInt(match.match_number)); } if (matchNumberWithOrdinal == "th") { return match.description; } return [matchNumberWithOrdinal, matchFormat].join(" "); } function getOrdinal (number) { var suffix = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"]; var ordinal = ""; if (((number % 100) >= 11) && ((number % 100) <= 13)) { ordinal = number + "th"; } else { ordinal = number + suffix[number % 10]; } return ordinal; } function makeTossInfo (data) { var tossText = ""; var teamShortName = ""; if (data.score_strip) { for (i = 0; i < data.score_strip.length; i++) { if (data.score_strip[i].team_id == data.toss_won_by) { teamShortName = data.score_strip[i].short_name; break; } } } else { if (data.t1_provider_id == data.toss_won_by) { teamShortName = data.t1_key; } else if (data.t2_provider_id == data.toss_won_by) { teamShortName = data.t2_key; } } tossText = "

Toss: " + teamShortName + " elect to " + data.toss_decision + "

"; return tossText; } function makeResultInfo (data) { var resultText = ""; var teamShortName = ""; if (data.score_strip) { for (i = 0; i < data.score_strip.length; i++) { if (data.score_strip[i].team_id == data.winning_team) { teamShortName = data.score_strip[i].short_name; break; } } } else { if (data.t1_provider_id == data.winning_team) { teamShortName = data.t1_key; } else if (data.t2_provider_id == data.winning_team) { teamShortName = data.t2_key; } } var marginText = data.winning_margin.replace(/\./g,""); var regexRuns = new RegExp(/\S+(?=\s+runs)/g); var regexWickets = new RegExp(/\S+(?=\s+wickets)/g); var resultRuns = marginText.match(regexRuns); var resultWickets = marginText.match(regexWickets); if (resultRuns && resultRuns.length && parseInt(resultRuns[0]) <= 1) { marginText = marginText.replace("runs", "run"); } if (resultWickets && resultWickets.length && parseInt(resultWickets[0]) <= 1) { marginText = marginText.replace("wickets", "wicket"); } resultText = "

" + teamShortName + " won by " + marginText + "

"; return resultText; } function makeTargetInfo (info) { var targetText = info.replace("remaining", ""); var regexRuns = new RegExp(/\S+(?=\s+runs)/g); var regexBalls = new RegExp(/\S+(?=\s+balls)/g); var regexOvers = new RegExp(/\S+(?=\s+overs)/g); var resultRuns = targetText.match(regexRuns); var resultBalls = targetText.match(regexBalls); var resultOvers = targetText.match(regexOvers); if (resultRuns && resultRuns.length) { targetText = targetText.replace(regexRuns, "" + resultRuns[0] + "") if (parseInt(resultRuns[0]) <= 1) { targetText = targetText.replace("runs", "run"); } } if (resultBalls && resultBalls.length) { targetText = targetText.replace(regexBalls, "" + resultBalls[0] + "") if (parseInt(resultBalls[0]) <= 1) { targetText = targetText.replace("balls", "ball"); } } if (resultOvers && resultOvers.length) { var splitOverArr = resultOvers[0].split("."); if (splitOverArr.length > 0) { var remainingBalls = parseInt(splitOverArr[0]) * 6 + (splitOverArr[1] ? parseInt(splitOverArr[1]) : 0); if (remainingBalls < 100) { targetText = targetText.replace(regexOvers, "" + remainingBalls + ""); var ballLabel = "balls"; if (remainingBalls <= 1) { ballLabel = "ball"; } targetText = targetText.replace("overs", ballLabel); } else { targetText = targetText.replace(regexOvers, "" + resultOvers[0] + ""); } } } return "

" + targetText + "

"; } function getCountdown (seconds) { if (seconds < 0) { return []; } var hrs = Math.floor(seconds / 3600); seconds -= hrs * 3600; var mnts = Math.floor(seconds / 60); seconds -= mnts * 60; seconds = parseInt(seconds); hrs = hrs.toString(); mnts = mnts.toString(); seconds = seconds.toString(); if (hrs.length == 1) { hrs = "0" + hrs; } if (mnts.length == 1) { mnts = "0" + mnts; } if (seconds.length == 1) { seconds = "0" + seconds; } var resultArray = []; // seconds resultArray.push(seconds); // minutes resultArray.push(mnts); return resultArray; } function clearTickers (tickers) { Object.keys(tickers).forEach(function (key) { clearInterval(tickers[key]); }); tickers = []; return tickers; } function getUserFriendlyDayString (date) { var formattedDate = new Date(date).toDateString(); var today = new Date(); if (today.toDateString() == formattedDate) { return "Today"; } today.setDate(today.getDate() + 1); if (today.toDateString() == formattedDate) { return "Tomorrow"; } return getDateString(date); } function getDateString (date, matchStatus) { var matchDate = new Date(date); var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; var dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; var date = matchDate.getDate() + ""; if (date.length < 2) { date = '0' + date; } var day = dayNames[matchDate.getDay()]; var dateString = day + ", " + date + " " + monthNames[matchDate.getMonth()]; if (matchStatus == "post") { var dateString = date + " " + monthNames[matchDate.getMonth()]; } return dateString; } function createLiveTagElement () { return '

LIVE

'; } return { generateMatchCardHeadingText: generateMatchCardHeadingText, getFormattedCricketMatchType: getFormattedCricketMatchType, getOrdinal: getOrdinal, makeTossInfo: makeTossInfo, makeResultInfo: makeResultInfo, makeTargetInfo: makeTargetInfo, getCountdown: getCountdown, clearTickers: clearTickers, getUserFriendlyDayString: getUserFriendlyDayString, getDateString: getDateString, createLiveTagElement: createLiveTagElement } })(); var CricketWidget = function() { Widget.call(this, 'cricket'); this.isScoreCarousel = false; if ("Eventpage" == "Homepage") { this.isScoreCarousel = true; } this.selectedEventSlug = "trinidad-t20-blast"; if (!this.selectedEventSlug) { this.selectedEventSlug = 'featured_v2'; } this.onWidgetItemsChangeSubscribers = []; this.timeTickerFunctions = {}; var self = this; window.addEventListener("DOMContentLoaded", function(event) { self.setTimeTicker(); }); } CricketWidget.prototype = Object.create(Widget.prototype); CricketWidget.prototype.init = function() { this.setContentAPIBase('https://push.sportskeeda.com/get-cricket-matches/'); this.setLiveAPIBase('https://cmc2.sportskeeda.com/live-cricket-score/cricket-score/ajax/'); this.addTimeZoneToHeader(); if(this.isScoreCarousel) { this.initScrollItems(this.selectedEventSlug); } } CricketWidget.prototype.setIsScoreCarousel = function(value) { this.isScoreCarousel = value; } // for setting domestic/international in cricket category CricketWidget.prototype.setFilterType = function(value) { this.filterType = value; } CricketWidget.prototype.populateMatchListing = function(matchListing) { Widget.prototype.populateMatchListing.call(this, matchListing); var self = this; var listingHTML = ""; for (var i = 0; i < matchListing.length; i += 1) { var match = matchListing[i]; var matchDate = match.datetime; var matchDescription = match.description; match.t1_score = match.t1_score.replace(/
()*/, "").replace(" ov", ""); match.t2_score = match.t2_score.replace(/
()*/, "").replace(" ov", ""); match.result = match.result.replace(match.t1, match.t1_key); match.result = match.result.replace(match.t2, match.t2_key); match.result = match.result.replace("Day Break", "Stumps"); match.result = match.result.replace("bowl", "field"); var showPanelScorecardTimer = false; var startsIn = ((new Date(match.datetime).getTime() - new Date()) / 1000) - 1; if (startsIn > 0 && startsIn <= 3600) { showPanelScorecardTimer = true; } var matchInfo = CricketWidgetUtils.generateMatchCardHeadingText(match); var dateInfo = '

' + matchInfo + '

'; var teamOneInfo = { team: 'one', name : match.t1, key: match.t1_key, flag: match.t1_flag, score: match.t1_score, winStatus: match.winning_team ? (match.winning_team == match.t1_provider_id ? "win" : "lost") : "", slug: match.t1_slug }; var teamTwoInfo = { team: 'two', name : match.t2, key: match.t2_key, flag: match.t2_flag, score: match.t2_score, winStatus: match.winning_team ? (match.winning_team == match.t2_provider_id ? "win" : "lost") : "", slug: match.t2_slug }; if(!teamOneInfo.flag || !teamTwoInfo.flag) { teamOneInfo.flag = ''; teamTwoInfo.flag = ''; } var teamDivElements = self.createTeamDivElement(teamOneInfo, match.status, showPanelScorecardTimer) + self.createTeamDivElement(teamTwoInfo, match.status, showPanelScorecardTimer); var liveClick = " "; if(typeof isPartner != 'undefined' && isPartner==true){ if(match.status == "live") { liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' live score'; } else if(match.status == 'post') { liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' live score'; } else if(match.status == 'pre' && ((new Date(match.datetime).getTime() - new Date().getTime()) < 30 * 60 * 1000)) { //set live link if match is about to start in 30 mins liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' live score'; } else { liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' preview'; } }else{ if(match.status == "live") { liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' live score'; } else if(match.status == 'post') { liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' live score'; } else if(match.status == 'pre' && ((new Date(match.datetime).getTime() - new Date().getTime()) < 30 * 60 * 1000)) { //set live link if match is about to start in 30 mins liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' live score'; } else { liveClick = '' + match.t1_key + ' VS ' + match.t2_key + ' preview'; } } var matchScorecardTimeInfo = ""; if (match.status == "pre") { matchScorecardTimeInfo = "

" + " " + CricketWidgetUtils.getUserFriendlyDayString(matchDate) + "" + this.formatAMPM(matchDate) + "

"; } if (match.status == 'pre' || match.status == 'live') { matchScorecardTimeInfo += "" + ""; if (match.toss_decision) { matchScorecardTimeInfo += "

Lineups out

"; } else { matchScorecardTimeInfo += "Starts In"; } matchScorecardTimeInfo +="" + "" + "" + "" + "m" + "" + "" + "" + "" + "s"; } var resultInfo = '

'; if ((match.status == "live" || match.status == "post") && !showPanelScorecardTimer) { if (match.winning_team && match.winning_margin != "" && !match.result.includes("tied") && !match.result.includes("draw")) { resultInfo += CricketWidgetUtils.makeResultInfo(match); } else { resultInfo += CricketWidgetUtils.makeTargetInfo(match.result); } } if (showPanelScorecardTimer && match.toss_decision) { resultInfo += CricketWidgetUtils.makeTossInfo(match); } resultInfo += '

'; var footerInfo = '"; var carouselAdUnit = ""; var carousel_ad_added = false; if (carousel_ad_added == false && (match.status == 'live' || match.status == 'pre')) { carousel_ad_added = true; carouselAdUnit = ''; } var template = '' + '' + dateInfo + '' + resultInfo + '' + footerInfo + liveClick + '' + carouselAdUnit; listingHTML = listingHTML + template; } if(this.isScoreCarousel) { this.cardLength = matchListing.length; } this.matchListing.innerHTML = listingHTML; if(typeof isPartner === 'undefined' && this.selectedEventSlug != "featured_v2"){ if (matchListing[0] && matchListing[0].event_slug) { this.matchListing.innerHTML += '' lazyLoadAll(); } } if(this.selectedEventSlug != "featured_v2" ) { this.initInitialScroll(true); } else if (this.selectedEventSlug == "featured_v2" && typeof showMultiSportIconsInCarousal !== "undefined" && showMultiSportIconsInCarousal && typeof updateContextualHPTabs === "function") { // show two tabs cricket & football on homepage carousal updateContextualHPTabs("", "cricket"); } this.carousalControlsHelper.observeTarget(); this.onWidgetItemsChangeSubscribers.forEach(function(subscriber) { subscriber(matchListing); }); this.setTimeTicker(); this.updateLiveScoresAndPreLiveScores(); window.dispatchEvent(new CustomEvent("custom:sk:utils:lazyLoadAssetImages")); } CricketWidget.prototype.subscribeToWidgetItemsChange = function(callback) { if (typeof callback !== "function") { return; } this.onWidgetItemsChangeSubscribers.push(callback); } CricketWidget.prototype.createTeamDivElement = function(teamInfo, matchStatus, showPanelScorecardTimer) { var teamFlagElement = ''; var defaultTeamFlag = "//staticg.sportskeeda.com/assets/team-default.png"; var teamAssetImage = generateTeamAssetImage(teamInfo.slug, "cricket", [ teamInfo.flag, defaultTeamFlag ]); if (teamInfo.flag) { if (typeof isPartner != 'undefined' && isPartner==true){ teamFlagElement = ''; } else { teamFlagElement = "\"team-flag\"\" class=\"keeda_widget_cricket_flag img-with-fallbacks\" data-img-fallbacks=\"" + teamAssetImage + "\" data-img-params=\"?w=108\" />"; } } var teamScoreElement = ''; var teamName = teamInfo.key; var teamKey = teamInfo.key.replace("&","").replace("(","").replace(")",""); var teamNameElement = ''+ teamName +''; var element = '

' + teamFlagElement + teamNameElement + teamScoreElement + '

'; return element; } CricketWidget.prototype.updateTeamScoreElement = function(teamInfo, liveTeamGroup) { var teamKey = teamInfo.key.replace("&","").replace("(","").replace(")",""); if (teamKey) { var element = liveTeamGroup.querySelector('[data-team-name=' + teamKey + ']'); if (element) { element.className = "keeda_widget_team " + teamInfo.winStatus; var teamScoreElement = element.querySelector(".keeda_widget_score.cricket"); if (teamScoreElement) { teamScoreElement.innerText = teamInfo.score; } } } } CricketWidget.prototype.createLineUpsOutElement = function() { return '

Lineups out

'; } CricketWidget.prototype.createResultTagElement = function() { } if(typeof isPartner === 'undefined'){ CricketWidget.prototype.changeFixturesLink = function(eventSlug) { Widget.prototype.changeFixturesLink.call(this, eventSlug); if(eventSlug != 'featured_v2') { var allFixturesCTA = this.widget.querySelector('.keeda_widget_all_fixtures a'); if (allFixturesCTA) { allFixturesCTA.setAttribute('href', '/go/'+ eventSlug + '/schedule'); } } if(typeof(loadAdsForScoreIntegration) === "function") { loadAdsForScoreIntegration(); } } } CricketWidget.prototype.fetchAndPopulateData = function(eventSlug, eventName) { this.selectedEventSlug = eventSlug; Widget.prototype.fetchAndPopulateData.call(this, eventSlug, eventName); } CricketWidget.prototype.loadEventData = function (target) { if (!hasClass(target, 'active')) { this.timeTickerFunctions = CricketWidgetUtils.clearTickers(this.timeTickerFunctions); } Widget.prototype.loadEventData.call(this, target); setTimeout(function() { if ("onCricketWidgetEventDataLoaded" in window) { if (typeof onCricketWidgetEventDataLoaded == "function") { onCricketWidgetEventDataLoaded(); } } }, 3000); }; CricketWidget.prototype.updateLiveScoresAndPreLiveScores = function() { var self = this; var finalLiveMatches = []; var liveMatches = this.matchListing.getElementsByClassName('keeda_cricket_match_list live'); var liveMatchesLength = liveMatches.length; for (var i = 0; i < liveMatchesLength; i += 1) { finalLiveMatches.push(liveMatches[i]); } var preMatches = this.matchListing.getElementsByClassName('keeda_cricket_match_list pre'); var preMatchesLength= preMatches.length; var currentTime = new Date(); for (var i = 0; i < preMatchesLength; i += 1) { var preMatchTime = new Date(preMatches[i].getAttribute('data-match-time')); if ((preMatchTime.getTime() - currentTime.getTime()) < 30 * 60 * 1000 ) { finalLiveMatches.push(preMatches[i]); } } var finalLiveMatchesLength = finalLiveMatches.length; for (var i = 0; i < finalLiveMatchesLength; i += 1) { var matchSlug = finalLiveMatches[i].getAttribute('data-match-id'); (function(liveMatchElement) { self.getLiveData(matchSlug, function(err, status, response) { self.updateLiveDivElements(response, liveMatchElement); self.updateNextGameMarker(); if(typeof isPartner === 'undefined'){ lazyLoadAll(); } }); })( finalLiveMatches[i] ) } this.updateNextGameMarker(); } CricketWidget.prototype.updateNextGameMarker = function() { var nextGameInDOM = this.matchListing.querySelector(".keeda_cricket_single_match.next-game"); removeClass(nextGameInDOM, "next-game"); if (this.selectedEventSlug.includes("featured")) return; var liveMatches = this.matchListing.querySelectorAll(".keeda_cricket_match_list.live"); if (liveMatches.length) return; var preMatches = this.matchListing.querySelectorAll(".keeda_cricket_match_list.pre"); if (!preMatches.length) return; var firstPreMatch = preMatches[0]; if (!firstPreMatch) return; var widgetContainer = firstPreMatch.closest(".keeda_cricket_single_match"); if (!widgetContainer) return; addClass(widgetContainer, "next-game"); } CricketWidget.prototype.updateLiveDivElements = function(response, liveMatchElement) { var liveTeamGroup = liveMatchElement.querySelector('.keeda_widget_team_group'); var parsedData = JSON.parse(response); parsedData['info'] = parsedData['info'].replace(parsedData['score_strip'][0].name, parsedData['score_strip'][0].short_name); parsedData['info'] = parsedData['info'].replace(parsedData['score_strip'][1].name, parsedData['score_strip'][1].short_name); parsedData['info'] = parsedData['info'].replace("Day Break", "Stumps"); var scoreObject = parsedData['score_strip']; if(!scoreObject) { console.error("Failed to get score"); return; } var matchStatus = parsedData['match_status']; var matchInPlay = parsedData['in_play']; var gameState = parsedData['game_state']; var teamOneInfo = { key: scoreObject[0].short_name, score: scoreObject[0].score.replace(" ov", ""), winStatus: parsedData.winning_team ? (parsedData.winning_team == scoreObject[0].team_id ? "win" : "lost") : "" }; var teamTwoInfo = { key: scoreObject[1].short_name, score: scoreObject[1].score.replace(" ov", ""), winStatus: parsedData.winning_team ? (parsedData.winning_team == scoreObject[1].team_id ? "win" : "lost") : "" }; this.updateTeamScoreElement(teamOneInfo, liveTeamGroup); this.updateTeamScoreElement(teamTwoInfo, liveTeamGroup); var scorecardCountDownTimer = liveMatchElement.querySelector("#scorecard-countdown-timer"); var matchScorecardTime = liveMatchElement.querySelector("#match-scorecard-time"); var countdownTimerTitle = liveMatchElement.querySelector(".countdown-timer-title"); var matchResultEle = liveMatchElement.querySelector(".keeda_widget_result_info"); //result info if(matchStatus == 'live' && matchInPlay && gameState != 7 && !liveMatchElement.querySelector('.keeda_widget_live_info')) { if(this.isScoreCarousel) { liveMatchElement.querySelector('.keeda_widget_result_info').innerHTML = liveMatchElement.querySelector('.keeda_widget_result_info').innerHTML; } else { liveMatchElement.querySelector('.keeda_widget_result_info').innerHTML = CricketWidgetUtils.createLiveTagElement() + liveMatchElement.querySelector('.keeda_widget_result_info').innerHTML; } liveMatchElement.querySelector('.keeda_widget_info').innerHTML = liveMatchElement.querySelector('.keeda_widget_info').innerHTML + CricketWidgetUtils.createLiveTagElement(); } else if(matchStatus == 'live' && (!matchInPlay || gameState == 7) && liveMatchElement.querySelector('.keeda_widget_live_info')){ if(liveMatchElement.querySelector('.keeda_widget_live_info')) { liveMatchElement.querySelector('.keeda_widget_live_info').remove(); } } if(matchStatus == 'post') { liveMatchElement.querySelector('.keeda_widget_result_info').className = 'keeda_widget_result_info post'; } removeClass(liveMatchElement, "pre"); removeClass(liveMatchElement, "live"); removeClass(liveMatchElement, "post"); addClass(liveMatchElement, matchStatus); if(matchStatus == 'live') { liveMatchElement.setAttribute('data-match-status', 'live'); } if(matchStatus =='live' || matchStatus =='pre') { //set href tag if not preset var matchId = liveMatchElement.getAttribute('data-match-id'); //if match link element is not present create it if(typeof isPartner != 'undefined' && isPartner==true){ if(!liveMatchElement.parentNode.querySelector('.keeda_cricket_match_link')) { var liveClickElement = document.createElement('a'); liveClickElement.setAttribute('href', '/001/digest?next=cmc|'+matchId+'&ud=ok|no msisdn|1'); liveClickElement.className = "keeda_cricket_match_link"; liveClickElement.innerHTML = teamOneInfo.key + ' VS ' + teamTwoInfo.key + ' live score'; liveMatchElement.parentNode.append(liveClickElement); } else { //these statements handle the condition where a pre match game has preview link and has to be set to the live link var liveClickElement = liveMatchElement.parentNode.querySelector('.keeda_cricket_match_link'); liveClickElement.setAttribute('href', '/001/digest?next=cmc|'+matchId+'&ud=ok|no msisdn|1'); } }else{ if(!liveMatchElement.parentNode.querySelector('.keeda_cricket_match_link')) { var liveClickElement = document.createElement('a'); liveClickElement.setAttribute('href', '/live-cricket-score/' + matchId); liveClickElement.className = "keeda_cricket_match_link"; liveClickElement.innerHTML = teamOneInfo.key + ' VS ' + teamTwoInfo.key + ' live score'; liveMatchElement.parentNode.append(liveClickElement); } else { //these statements handle the condition where a pre match game has preview link and has to be set to the live link var liveClickElement = liveMatchElement.parentNode.querySelector('.keeda_cricket_match_link'); liveClickElement.setAttribute('href', '/live-cricket-score/' + matchId); } } if (scorecardCountDownTimer) { if (parsedData.toss_decision) { addClass(scorecardCountDownTimer, "toss-info"); } var match_time = parsedData.match_start_time + "000"; var startsIn = (new Date(parseInt(match_time)) - new Date()) / 1000; startsIn = startsIn - 1; if (startsIn <= 0 || startsIn > 3600) { addClass(scorecardCountDownTimer, "hidden"); if (startsIn <= 0) { if (matchResultEle && parsedData.winning_team && parsedData.winning_margin != "" && !parsedData.info.includes("tied") && !parsedData.info.includes("draw")) { matchResultEle.innerHTML = CricketWidgetUtils.makeResultInfo(parsedData); } else { matchResultEle.innerHTML = CricketWidgetUtils.makeTargetInfo(parsedData.info); } var teamScoreEle = liveTeamGroup.querySelectorAll(".keeda_widget_score.cricket"); teamScoreEle.forEach(function (scoreEle) { removeClass(scoreEle, "hidden"); }); if (matchScorecardTime) { addClass(matchScorecardTime, "hidden"); } } } else { if (matchScorecardTime) { addClass(matchScorecardTime, "hidden"); } if (countdownTimerTitle && parsedData.toss_decision) { countdownTimerTitle.innerHTML = this.createLineUpsOutElement(); matchResultEle.innerHTML = CricketWidgetUtils.makeTossInfo(parsedData); removeClass(matchResultEle, "hidden"); } removeClass(scorecardCountDownTimer, "hidden"); } } } if(matchStatus == 'post') { liveMatchElement.setAttribute('data-match-status', 'post'); if(liveMatchElement.querySelector('.keeda_widget_live_info')) { liveMatchElement.querySelector('.keeda_widget_live_info').remove(); } addClass(scorecardCountDownTimer, "hidden"); var teamScoreEle = liveTeamGroup.querySelectorAll(".keeda_widget_score.cricket"); teamScoreEle.forEach(function (scoreEle) { removeClass(scoreEle, "hidden"); }); if (matchResultEle && parsedData.winning_team && parsedData.winning_margin != "" && !parsedData.info.includes("tied") && !parsedData.info.includes("draw")) { matchResultEle.innerHTML = CricketWidgetUtils.makeResultInfo(parsedData); } } var resultEle = liveMatchElement.querySelector(".keeda_widget_result_info"); if (resultEle) { removeClass(resultEle, "marquee-container"); if (resultEle.offsetWidth < resultEle.scrollWidth) { addClass(resultEle, "marquee-container"); } } } if(typeof isPartner === 'undefined'){ CricketWidget.prototype.toggleMenu = function() { Widget.prototype.toggleMenu.call(this, true); gtag('event', 'toggle', { 'event_category': 'cricket_widget', 'event_label': true, 'non_interaction': true }); } } CricketWidget.prototype.openDropDownMenu = function() { Widget.prototype.openDropDownMenu.call(this); } CricketWidget.prototype.closeDropDownMenu = function() { Widget.prototype.closeDropDownMenu.call(this); } CricketWidget.prototype.searchDropDownList = function(event) { Widget.prototype.searchDropDownList.call(this, event); gtag('event', 'toggle', { 'event_category': 'cricket_widget', 'event_label': true, 'non_interaction': true }); } CricketWidget.prototype.reformatWidgetInfoToLocalTime = function() { var widgetElements = this.widget.querySelectorAll('.keeda_cricket_single_match .keeda_cricket_match_list'); for (var i = 0; i < widgetElements.length; i++) { var matchTime = widgetElements[i].getAttribute('data-match-time'); var matchStatus = widgetElements[i].getAttribute('data-match-status'); var matchDescription = widgetElements[i].getAttribute('data-match-description'); var widgetInfo = widgetElements[i].querySelector('.keeda_widget_info'); widgetInfo.innerHTML = this.getWidgetInfo(matchDescription, matchTime, matchStatus); } } CricketWidget.prototype.getWidgetInfo = function(matchDescription, matchTime, matchStatus) { var formattedDate = this.getFormattedDate(matchTime, matchStatus); var formattedTime = this.getFormattedTime(matchTime, matchStatus); if(!matchDescription) { return formattedDate + " " + formattedTime; } else if (!formattedDate && !formattedTime) { return matchDescription; } else { return matchDescription + " | " + formattedDate + " " + formattedTime; } } CricketWidget.prototype.getFormattedDate = function(isoDateString, matchStatus) { if(matchStatus == "live") { return ""; } else { return this.getReadableHumanDate(isoDateString); } } CricketWidget.prototype.getFormattedTime = function(isoDateString, matchStatus) { var date = new Date(isoDateString); if (matchStatus == 'post' || matchStatus == 'live') { return ""; } else { return this.formatAMPM(isoDateString); } } CricketWidget.prototype.trackFooterClickEvents = function (labelName) { if (!gtag || !labelName) return; gtag('event', 'click', { 'event_category': "Matchcard", 'event_label': labelName, }); } CricketWidget.prototype.setTimeTicker = function () { var self = this; var matchList = this.matchListing.querySelectorAll(".keeda_cricket_match_list"); matchList.forEach(function (match) { var matchId = match.getAttribute("data-match-id"); var matchStatus = match.getAttribute("data-match-status"); var matchTime = match.getAttribute("data-match-time"); var targetDOM = match.closest(".keeda_cricket_single_match"); if (!targetDOM) return; self.timeTickerFunctions[matchId] = setInterval(function() { var matchCardEle = targetDOM; var startsIn = (new Date(matchTime).getTime() - new Date()) / 1000; startsIn = startsIn - 1; if (startsIn <= 0 && self.timeTickerFunctions[matchId]) { clearInterval(self.timeTickerFunctions[matchId]); } if (startsIn > 0) { // match center template has a countdown timer which gets updated here. var countdownTimerTitleEle = matchCardEle.querySelector(".countdown-timer-title"); var countdownTimerDOM = matchCardEle.querySelector(".countdown-timer-section"); var countdownDOM = matchCardEle.querySelectorAll(".scorecard-timer-content"); var countDownTime = CricketWidgetUtils.getCountdown(startsIn, false); for (var c = 0; c < countdownDOM.length; c++) { if (countdownDOM[c].nodeName === "DIV") { var timeDigit = countDownTime.pop(); var displayText = (timeDigit != "-" ? timeDigit : "00"); countdownDOM[c].innerText = displayText; } } removeClass(countdownTimerTitleEle, "hidden"); removeClass(countdownTimerDOM, "hidden"); } }, 1000); var matchResultEle = targetDOM.querySelector(".keeda_widget_result_info"); if (matchResultEle) { if (matchResultEle.offsetWidth < matchResultEle.scrollWidth) { addClass(matchResultEle, "marquee-container"); } } var widgetInfoEle = targetDOM.querySelector(".keeda_widget_info.cricket"); if (widgetInfoEle && matchStatus == "post") { if (widgetInfoEle.offsetWidth < widgetInfoEle.scrollWidth) { addClass(widgetInfoEle, "marquee-container"); } } }); }

ncG1vNJzZmivp6x7tLzOq6uso5WasaJ6wqikaJ%2BfZMGztc2im5qcXal%2FcXnBpZisrA%3D%3D