[]
Quick Links:
More from Sportskeeda
0) { var pnProductNav = $(“#pnProductNav”); var pnProductNavContents = $(“#pnProductNavContents”); // Out advancer buttons var pnAdvancerLeft = $(“#pnAdvancerLeft”); var pnAdvancerRight = $(“#pnAdvancerRight”); var scrollAmount = 0; var scrollMin = 0 var scrollMax = pnProductNavContents.clientWidth; pnAdvancerRight.onclick = function() { pnProductNav.scrollTo({ top: 0, left: Math.max(scrollAmount += 240, scrollMax), behavior: ‘smooth’ }); }; pnAdvancerLeft.onclick = function() { pnProductNav.scrollTo({ top: 0, left: Math.max(scrollAmount -= 240, scrollMin), behavior: ‘smooth’ }); }; new KeedaCarousalControlsHelper({ target: pnProductNavContents, whenFistItemInViewport: function(entry) { pnAdvancerLeft.style.display = “none”; }, whenFistItemNotInViewport: function(entry) { pnAdvancerLeft.style.display = “inline-block”; }, whenLastItemInViewport: function(entry) { pnAdvancerRight.style.display = “none”; }, whenLastItemNotInViewport: function(entry) { pnAdvancerRight.style.display = “inline-block”; } }).observeTarget(); } } var topOfDropDown = ”; function toggleWikiDropDown(slug, level, tag, flag, fromExplore) { var node = $(“#” + slug); if (!node) { return; } if (hasClass(node, “hidden”)) { showDropDown(slug, level, tag, flag, fromExplore); } else { closeAllDropDown(); } } function setDropDownPosition(element) { var WIKI_HEADER_HEIGHT = 150; if (window.scrollY > WIKI_HEADER_HEIGHT) { element.style.position = “fixed”; element.style.top = “50px”; } else if (window.scrollY < WIKI_HEADER_HEIGHT) { element.style.position = "absolute"; element.style.top = "202px"; } } function showDropDown(slug, level, tag, flag, fromExplore) { var nodeId = "#" + slug; var dropDownNode = $(nodeId); if (!dropDownNode) { return; } var rec = tag.parentNode.getBoundingClientRect(); isMenuFromExplore = fromExplore == null ? isMenuFromExplore : fromExplore; closeAllDropDown(); updateMenu(nodeId); if (flag && (level == 0 || level == -1)){ level == 0 ? tag.lastChild.style.transform = "rotate(180deg) scale(1.5)" : true; topOfDropDown = rec.top + window.scrollY + 35 + "px"; } setDropDownPosition(dropDownNode); $('body').appendChild(dropDownNode); dropDownNode.classList.remove("hidden"); } function updateMenu(nodeId) { node = $(nodeId).querySelector('#back-block-0'); if (isMenuFromExplore && $(nodeId).getAttribute('data-level') == '0') { node.classList.remove('hidden'); } else if (!isMenuFromExplore && $(nodeId).getAttribute('data-level') == '0') { node.classList.add('hidden'); } } window.addEventListener("DOMContentLoaded", function() { document.addEventListener('click', function(e) { if (e.target.className != 'drop-down-icon' && e.target.className != 'explore-icon' && e.target.className != 'back-block' && e.target.className != 'wiki-submenu-item' && e.target.className != 'wiki-menu-toggle' ) { closeAllDropDown(); } }) }); function closeAllDropDown() { var nodes = $all(".drop-down-menu"); var menu = $all(".wiki-menu-item .drop-down-icon"); if (menu && menu.length) { for(var i = 0; i < menu.length; i++) { menu[i].style.transform = "scale(1.5)"; } } if (nodes && nodes.length) { for(var i = 0; i
Fetching more content…
1 ? ” Reactions” : ” Reaction”); } else if (iconImgs.length > 1) { iconImgs[1].remove(); countEle.innerText = getNumFormat(count) + (count > 1 ? ” Reactions” : ” Reaction”); } } else { // reaction counts greater than 1 if (iconImgs.length == 1) { if (iconImgs[0].dataset.reaction == reactionType) { // no reaction icon change } else { var imgIcon = document.createElement(‘img’); imgIcon.src = “//staticg.sportskeeda.com/post-reactions/reaction-” + reactionType + “.svg”; imgIcon.className = “second-reaction”; imgIcon.setAttribute(‘data-reaction’, reactionType); imgIcon.height = “12”; imgIcon.width = “12”; countEle.parentElement.insertBefore(imgIcon, countEle); } countEle.innerText = getNumFormat(count) + (count > 1 ? ” Reactions” : ” Reaction”); } else if (iconImgs.length > 1) { if (!added && iconImgs[1].dataset.reaction == reactionType) { // remove the 2nd reaction if it is same as you unreacted iconImgs[1].remove(); } countEle.innerText = getNumFormat(count) + (count > 1 ? ” Reactions” : ” Reaction”); } } } function fetchAndUpdateUserLikesForPosts(postIdsArray) { if (postIdsArray.length < 1) return; if (!userId) return; var postIdsParam = postIdsArray.join(","); pureJSAjaxGet("https://gotham.sportskeeda.com/posts/reactedBy?post_ids="+postIdsParam, syncPostLikesInFeed, {}, function(err) {}, true); } function syncPostLikesInFeed(response) { if (!userId) return; try { response = JSON.parse(response); } catch (e) { return; } for(var i = 0; i < response.length; i++) { var data = response[i]; if (!data.id) continue; var buttonEleParent = $("#story-link-div-" + data.id + " .like-action"); if (!buttonEleParent) continue; var buttonEle = buttonEleParent.querySelector('button'); if (!buttonEle) continue; var imgEle = buttonEle.querySelector("img"); var textEle = buttonEle.querySelector('span'); if (!imgEle) continue; if (data.liked_by && data.liked_by.split(",").includes(userId)) { imgEle.src = REACTION_IMAGES.like; textEle.innerText = REACTION_TEXT['like']; textEle.style.color = "#D32F2F"; buttonEle.setAttribute("data-liked", "true"); buttonEle.setAttribute("data-reaction-type", "like"); } else if (data.excited_reaction_by && data.excited_reaction_by.split(",").includes(userId)) { imgEle.src = REACTION_IMAGES.excited; textEle.innerText = REACTION_TEXT['excited']; textEle.style.color = "#D32F2F"; buttonEle.setAttribute("data-liked", "true"); buttonEle.setAttribute("data-reaction-type", "excited"); } else if (data.anxious_reaction_by && data.anxious_reaction_by.split(",").includes(userId)) { imgEle.src = REACTION_IMAGES.anxious; textEle.style.color = "#D32F2F"; textEle.innerText = REACTION_TEXT['anxious']; buttonEle.setAttribute("data-liked", "true"); buttonEle.setAttribute("data-reaction-type", "anxious"); } else if (data.happy_reaction_by && data.happy_reaction_by.split(",").includes(userId)) { imgEle.src = REACTION_IMAGES.happy; textEle.style.color = "#D32F2F"; textEle.innerText = REACTION_TEXT['happy']; buttonEle.setAttribute("data-liked", "true"); buttonEle.setAttribute("data-reaction-type", "happy"); } else if (data.sad_reaction_by && data.sad_reaction_by.split(",").includes(userId)) { imgEle.src = REACTION_IMAGES.sad; textEle.style.color = "#D32F2F"; textEle.innerText = REACTION_TEXT['sad']; buttonEle.setAttribute("data-liked", "true"); buttonEle.setAttribute("data-reaction-type", "sad"); } else if (data.angry_reaction_by && data.angry_reaction_by.split(",").includes(userId)) { imgEle.src = REACTION_IMAGES.angry; textEle.style.color = "#D32F2F"; textEle.innerText = REACTION_TEXT['angry']; buttonEle.setAttribute("data-liked", "true"); buttonEle.setAttribute("data-reaction-type", "angry"); } else { imgEle.src = REACTION_IMAGES.default; buttonEle.setAttribute("data-liked", "false"); } } } function trackSocialPostLike(id, action) { if (!gtag) return gtag('event', action, { 'event_category': "Social_post", 'event_label': id }); } function trackPostLike(id, action) { if (!gtag) return gtag('event', action, { 'event_category': "post", 'event_label': id }); } window.addEventListener("mouseup", function() { var reactionContainers = $all(".reaction-icons-container"); if (reactionContainers && reactionContainers.length) { for(var i = 0; i
End Page ‘ + pageNumber + ‘
‘); window.addEventListener(“scroll”, onWindowScroll); function onWindowScroll(e) { var st = window.pageYOffset || document.documentElement.scrollTop; if (!infiniteScrollRequestInProgress) { if (st > lastScrollTop) { direction = ‘down’; } else if (st < lastScrollTop) { direction = 'up'; } else { direction = 'none'; } } lastScrollTop = st; var page_divs = document.getElementsByClassName('pageno'); //update url, links and meta only for some pages var topOffset = (0.2 * sk_timeline.offsetTop); // 20% of content offset top if (!isScrolledIntoView(sk_timeline, topOffset)) { return; } var contentHeight = sk_timeline.offsetHeight + sk_timeline.offsetTop; var yOffset = window.pageYOffset; var y = yOffset + window.innerHeight + topOffset; if (y >= contentHeight || yOffset <= 0) { timelineInViewFirstTime = true; //load new content if (!infiniteScrollRequestInProgress) { infiniteScrollRequestInProgress = true; if(direction == 'down') { page_to_be_fetched = max_page + 1; timelineLoadingDivBottom.style.display = 'block'; } else if(direction == 'up') { page_to_be_fetched = (min_page > 1 ? min_page -1 : min_page); if(page_to_be_fetched > 1) { timelineLoadingDivTop.style.display = ‘block’; } } if(page_to_be_fetched > max_page || page_to_be_fetched < min_page) { var feedUrl = '/pop-culture/ajax/archive?src=article-trending&sport_name=SK+POP&page='; feedUrl += page_to_be_fetched + '&pagetype=Articlepage' + ''; feedUrl += ''; //this is required to support 3 tab layout in sport pages pureJSAjaxGet(feedUrl, function (data) { var url = '/pop-culture/ajax/archive?src=article-trending&sport_name=SK+POP&page=' + page_to_be_fetched; url = url.split("ajax/archive?page="); var action = url[0]; var label = url[1]; var type = ["video", "article", "slideshow"].indexOf(postType) > -1 ? postType : “News”; var category = “Scroll: ” + type; if (typeof ga_event == ‘function’ && data.trim() != ”) { ga_event(category, action, label); } if (data.trim() != ”) { pageNumber = page_to_be_fetched; if(direction == ‘down’) { max_page += 1; storiesList.insertAdjacentHTML(‘beforeend’, ‘
Start Page ‘+ pageNumber +’
‘); storiesList.insertAdjacentHTML(‘beforeend’, data); storiesList.insertAdjacentHTML(‘beforeend’, ‘
End Page ‘+ pageNumber +’
‘); timelineLoadingDivBottom.style.display = ‘none’; } else if(direction == ‘up’) { if(min_page > 1) min_page -= 1; storiesList.insertAdjacentHTML(‘afterbegin’, ‘
End Page ‘+ pageNumber +’
‘); storiesList.insertAdjacentHTML(‘afterbegin’, data); storiesList.insertAdjacentHTML(‘afterbegin’, ‘
Start Page ‘+ pageNumber +’
‘); timelineLoadingDivTop.style.display = ‘none’; } infiniteScrollRequestInProgress = false; if (pageNumber == 1 && (pageType == “Articlepage” || pageType == “slideshow”)) { //timeless posts when first article page render using ajax request var timelessPostSection = $(“.timless-posts-layout”); var storiesTimelessContainer = $(“#timeless-posts-list”); var rightTimelessScroller = $(“.timeless-posts-anchors #right”); var leftTimelessScroller = $(“.timeless-posts-anchors #left”); adjustTimelessPostContainerWidth([], storiesTimelessContainer, rightTimelessScroller); addTimelessPostScrollListener(storiesTimelessContainer, rightTimelessScroller, leftTimelessScroller); trackTimelessPostImpressions(‘Story_Page_Tab’); } if (pageNumber == 1) { } } else { timelineLoadingDivTop.style.display = ‘none’; timelineLoadingDivBottom.style.display = ‘none’; } removeDuplicateStories(); refreshScores(); setIntersectionObserverSocialPosts(); updateLikesForSSR(pageNumber); // This is done so that the argument value gets corrected in case the user loads the feed by giving page as param and then switches the feed. window.scrollTo(window.scrollX, window.scrollY + 1); }, function (error) { console.log(error); infiniteScrollRequestInProgress = false; timelineLoadingDivTop.style.display = ‘none’; timelineLoadingDivBottom.style.display = ‘none’; }); } else { infiniteScrollRequestInProgress = false; } } } } function checkVisible(elm) { var rect = elm.getBoundingClientRect(); var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight); return !(rect.bottom < 0 || rect.top - viewHeight >= 0); } function updateQueryStringParameter(uri, key, value) { var re = new RegExp(“([?&])” + key + “=.*?(&|#|$)”, “i”); if( value === undefined ) { if (uri.match(re)) { return uri.replace(re, ‘$1$2’).replace(/[?&]$/, ”).replaceAll(/([?&])&+/g, ‘$1’).replace(/[?&]#/, ‘#’); } else { return uri; } } else { if (uri.match(re)) { return uri.replace(re, ‘$1’ + key + “=” + value + ‘$2’); } else { var hash = ”; if( uri.indexOf(‘#’) !== -1 ){ hash = uri.replace(/.*#/, ‘#’); uri = uri.replace(/#.*/, ”); } var separator = uri.indexOf(‘?’) !== -1 ? “&” : “?”; return uri + separator + key + “=” + value + hash; } } } function updateURL(page_no) { var querystring = window.location.search; var hash = window.location.hash; //remove hash (and any trailing #) from url var url = window.location.href.replace(hash, ”).replace(/#+$/,”); if(querystring != ”) { if(querystring.includes(“page=”)) { url = updateQueryStringParameter(url, “page”, page_no) } else { url += ‘&page=’+page_no; } } else { url += ‘?page=’+page_no; } url += hash; if(window.location.href != url) { window.history.replaceState(“visible_page”, “Page ” + page_no, url); } return url; } function updateLinksAndMeta(page_no) { //update title and meta description if(page_no == 1) { //remove page no document.title = (document.title).replace(/Page [0-9]+ – /g, “”); if(meta_description) { meta_description.content = (meta_description.content).replace(/Page [0-9]+ – /g, “”); } } else if(page_no > 1) { if((document.title).match(/Page [0-9]+/g) != null) { document.title = (document.title).replace(/Page [0-9]+/g, “Page ” + page_no); } else { document.title = ‘Page ‘ + page_no + ‘ – ‘ + document.title; } if(meta_description) { if((meta_description.content).match(/Page [0-9]+/g) != null) { meta_description.content = (meta_description.content).replace(/Page [0-9]+/g, “Page ” + page_no); } else { meta_description.content = ‘Page ‘ + page_no + ‘ – ‘ + meta_description.content; } } } if(canonical) { //update rel next if(next_link) { next_link.href = (canonical.href).split(‘?’)[0] + ‘?page=’ + (page_no + 1); } //update rel prev if(prev_link == null) { prev_link = document.createElement(‘link’); prev_link.rel = ‘prev’; prev_link.id = ‘prev-link’; head.appendChild(prev_link); } if(page_no == 2) { prev_link.href = (canonical.href).split(‘?’)[0]; } else if(page_no < 2) { prev_link.parentNode.removeChild(prev_link); prev_link = null; } else { prev_link.href = (canonical.href).split('?')[0] + '?page=' + (page_no - 1); } } } function updateFootballScore(story, data) { data = JSON.parse(data); if(data) { var apostrophe = "' "; if(data.match_status.indexOf("T") >= 0 || data.match_status.indexOf(“PEN”) >= 0) { apostrophe = ” “; } story.innerHTML = data.match_status + apostrophe + data.match_localteam_name_short + ‘ ‘ + data.match_localteam_score + ‘-‘ + data.match_visitorteam_score + ‘ ‘ + data.match_visitorteam_name_short; } } function updateCricketScore(story, data) { data = JSON.parse(data); var match = data[‘score_strip’][0][‘currently_batting’] ? data[‘score_strip’][0] : null; if (match == null) { match = data[‘score_strip’][1][‘currently_batting’] ? data[‘score_strip’][1] : null; } if (match != null) { story.innerHTML = match[‘short_name’] + ‘ ‘ + match[‘score’]; } else { story.innerHTML = data[‘score_strip’][0][‘short_name’] + ‘ vs ‘ + data[‘score_strip’][1][‘short_name’] + ‘ | YET TO START’; } } function refreshScores() { var stories = $all(‘[data-scoreid]’); for (var i = 0; i < stories.length; i++) { var story = stories[i]; var scoreId = story.getAttribute('data-scoreid'); var sport = story.getAttribute('data-sport'); if (sport === 'football' && scoreId != null) { pureJSAjaxGetWithCredentialsFlag('https://push.sportskeeda.com/live-football-score/ajax/' + scoreId, updateFootballScore.bind(this, story), function (error) { if(typeof updateFootballScore.bind !== 'function'){ console.log(typeof updateFootballScore.bind); //logging for https://sentry.io/sportskeeda-a5/skm/issues/171421598/ } console.log(error); }, false); } if (sport === 'cricket' && scoreId != null) { pureJSAjaxGetWithCredentialsFlag('https://cmc.sportskeeda.com/live-cricket-score/cricket-score/ajax/' + scoreId, updateCricketScore.bind(this, story), function (error) { console.log(error); }, false); } } } // Updating likes info for SSR feed for logged-in users function updateLikesForSSR(pageNumber) { if (parseInt(getCookie("fw_ID")) < 1) return; if(!pageNumber) return; var feedIdsContainer = document.getElementById("feed-" + pageNumber + "-ids"); if (!feedIdsContainer) return; var postIds = []; for (var i = 0; i < feedIdsContainer.children.length; i++) { postIds.push(feedIdsContainer.children[i].innerText); } fetchAndUpdateUserLikesForPosts(postIds); } updateLikesForSSR(pageNumber); refreshScores(); setIntersectionObserverSocialPosts(); setInterval(refreshScores, 20000); })(); function switchTab(stat, button) { removeClass($(".recommended-switch.active"), "active"); addClass(button, "active"); var hidestories = document.getElementsByClassName("stories_hide"); for (var i = 0; i < hidestories.length; i++) { hidestories[i].style.display = "none"; } document.getElementById(stat).style.display = "block"; window.scrollTo(window.scrollX,window.scrollX+1); } Source
GIPHY App Key not set. Please check settings