fbpx
Connect with us

Trending News And Reviews

Mets outfielder Kevin Pillar suffers multiple nasal fractures after being hit by pitch – The Globe and Mail


deGrom

Mets outfielder Kevin Pillar suffers multiple nasal fractures after being hit by pitch – The Globe and Mail

https://www.theglobeandmail.com/sports/baseball/article-mets-outfielder-kevin-pillar-suffers-multiple-nasal-fractures-after/

“,

Save time by making it easy to scan all the latest stories on topics you follow in one place.

“,

“,


].join(“”);

var content2 = [
“,

“,

Adding topics. Click on the + symbol to save the topic to your Following page.

“,

“,

(Step 1 of 3)

“,

“,
“,
“,


].join(“”);

var content3 = [
“,

“,

Clicking on the topic’s name will bring you to a page where you can view all the articles that pertain to that topic.

“,

“,

(Step 2 of 3)

“,

“,
“,
“,


].join(“”);

var content4 = [
“,

“,
Access your following topics by clicking on your display name.“,

Access your following topics by clicking on your display name. The number in your display name indicates the number of new articles you haven’t read from your following topics.

“,

“,

(Step 3 of 3)

“,

“,
“,
“,


].join(“”);

var contentMarkup = [content1, content2, content3, content4];

function createTourtip() {
var relatedTopics = document.querySelector(“#main-content-area .pb-f-topics-article-related .c-topic-group__body ul”);
var topicPageTitle = document.querySelector(“.o-primary-header–section .c-topic”);

// If the following topics buttons are present on the page, set up the tourtips
if (relatedTopics || topicPageTitle) {
var modifier = relatedTopics ? ‘darwin-arc6134–article’ : ‘darwin-arc6134–topic-page’
var dataAnalyticsClick = JSON.stringify({
testId: “arc6134”,
type: “button”,
feature: “topic tour tip”,
label: “show tooltip”
});
var el = relatedTopics ? document.createElement(“li”) : document.createElement(“div”);
el.classList.add(“darwin-arc6134”);
el.classList.add(modifier);
el.innerHTML = “

“+contentMarkup[0] + “

“;
relatedTopics ? relatedTopics.appendChild(el) : topicPageTitle.appendChild(el);

// Remove follow topics onboarding messages and activation tooltips
setTimeout(function() {
var onboardingMessages = document.querySelectorAll(“.c-topic-group__body .c-onboarding-message”);
var tooltips = document.querySelectorAll(“.c-topic-group__body .c-tooltip”);
console.log(“[ARC-6134]: onboardingMessages: “, onboardingMessages);
Array.from(onboardingMessages).forEach(function(el) {
el.parentNode.removeChild(el);
});
Array.from(tooltips).forEach(function(el) {
el.parentNode.removeChild(el);
});
}, 3000);
}
}

function analyticsPush(type, panel, action) {
if (type === “simple”) {
analyticsLayer.push({
“event”: “simpleEvent”,
“simpleEvent”: {
“testId”: “arc6134”,
“action”: “view tour slide”,
“label”: “slide “+panel
}
});
}
if (type === “click”) {
analyticsLayer.push({
“event”:”clickEvent”,
“clickEvent”: {
“testId”: “arc6134”,
“feature”: “topic tour tip”,
“type”: “button”,
“label”: action,
}
});
}
}

function tourtipActions() {
// Open tourtips
var container = document.querySelector(“.darwin-arc6134”);
var activateIcon = document.querySelector(“.js-tourtip-activate”);
var tourtipContainer = document.querySelector(“.darwin-arc6134__tourtip”);
activateIcon.addEventListener(“click”, function() {
if (!container.classList.contains(“darwin-arc6134–open”)) {
container.classList.add(“darwin-arc6134–open”);
tourtipContainer.removeAttribute(“hidden”);
keepInViewport();
localStorage.setItem(“tgam.tourtip_icon_clicked”, true);
analyticsPush(“click”, 1, “show tooltip”);
analyticsPush(“simple”, 1, “”);
}
});

// Advance tourtip panels
tourtipContainer.addEventListener(‘click’, function(e) {
var tourtipPanel = tourtipContainer.getAttribute(“data-panel”);
var activateIcon = document.querySelector(“.js-tourtip-activate”);
var el = e.target || e.srcElement;
var action = el.getAttribute(“data-action”);
if (action === “next”) {
tourtipPanel++;
analyticsPush(“simple”, tourtipPanel, action);
} else if (action === “prev”) {
tourtipPanel–;
analyticsPush(“simple”, tourtipPanel, action);
} else {
tourtipPanel = 1;
tourtipContainer.setAttribute(“hidden”, true);
container.classList.remove(“darwin-arc6134–open”);
tourtipContainer.classList.remove(“darwin-arc6134__tourtip–leftOut”);
tourtipContainer.classList.remove(“darwin-arc6134__tourtip–rightOut”);
activateIcon.classList.remove(“darwin-arc6134__tourtip–leftOut”);
activateIcon.classList.remove(“darwin-arc6134__tourtip–rightOut”);
tourtipContainer.classList.remove(“js-tourtip–centred”);
tourtipContainer.style.removeProperty(“left”);
}
analyticsPush(“click”, tourtipPanel, action);
tourtipPanel === 4 ? tourtipContainer.classList.add(“darwin-arc6134__tourtip–last-panel”) : tourtipContainer.classList.remove(“darwin-arc6134__tourtip–last-panel”);
tourtipContainer.innerHTML = contentMarkup[tourtipPanel-1];
tourtipContainer.dataset.panel = tourtipPanel;
});
}

function init() {
console.log(“[ARC-6134] init”);
var testIsEnabled = /token=arc6134/.test(window.location.search);
console.log(“ARC-6134 testIsEnabled: “, testIsEnabled);
var testGroup = userTestGroup();

if (testGroup === “variant” || testIsEnabled) {
setUnitState(“arc6134”, “variant”);
console.log(“[ARC-6134] test group: variant”);
createTourtip();
tourtipActions();
intersectTourtip();
}
if (testGroup === “control”) {
console.log(“[ARC-6134] test group: control”);
setUnitState(“arc6134”, “control”);
}
}
init();
}]);
}

window.tgam.darwin.tests.after.push(dwExecute_UXTestARC6134);

})();

Catch up on today’s news in one email

‘;
if (section !== ”) {
document.getElementsByClassName(‘c-article-body’)[0].className += ‘ newsletterpromo’;

var newNode = document.createElement(‘div’);
newNode.setAttribute(“id”, “newsletterpromo”);
var count = -1;
for (i = 0; i

‘ +
newsletterSection[section][i].name + ‘

‘ +
newsletterSection[section][i].duration + ‘

‘ +
newsletterSection[section][i].body +

Signed up

‘;
count++;
}
}

newsletterContainer +=

‘;
newsletterContainer = newsletterContainer.replace(/newslettercards/g, newsletterClass[count]);
newNode.innerHTML = newsletterContainer;
var relatedArticles = document.getElementsByClassName(“pb-f-related-articles”)[0];
relatedArticles.insertBefore(newNode, relatedArticles.childNodes[0]);

pushNewsletterPromoAnalytics(‘display’);
}
}

// Signup to newsletter
function newsletterSignup(newsletterKey, elementId) {
var darwinState = getDarwinState() || {};
var email = darwinState.cem1504.email || ”;
var endpoint = “https://gamservices” + (!window.tgam.env.isProd ? “.stg2” : “”) +
“.theglobeandmail.com/usermanagement/api/v3/user/newsletters/” + newsletterKey + “?email=” + encodeURIComponent(
email);
fetch(endpoint, {
method: “POST”,
credentials: “include”,
headers: {
“Content-Type”: “application/json;charset=UTF-8”,
Accept: “application/json”
}
})
.then(function (response) {
return response.json()
})
.then(function (responseData) {
//show signup success and hide signupbtn
document.getElementById(“newsletterpromo-success” + elementId).removeAttribute(“hidden”);
document.getElementById(“newsletterpromo-btn” + elementId).setAttribute(“hidden”, “hidden”);
pushNewsletterPromoAnalytics(‘signup’);
})
}

// get user’s email address
function getUserEmail() {
var endpoint = “https://gamservices” + (!window.tgam.env.isProd ? “.stg2” : “”) +
“.theglobeandmail.com/usermanagement/api/v3/user”;
fetch(endpoint, {
method: “GET”,
credentials: “include”,

})
.then(function (resp) {
return resp.json();
})
.then(function (data) {
setDarwinState(‘cem1504′, ’email’, data.user.email);
})
.catch(function (err) {
console.warn(“fetch error”);
})
}

// push analytics
function pushNewsletterPromoAnalytics(action) {
analyticsLayer.push({
“event”: “clickEvent”,
“clickEvent”: {
“testId”: “cem1504”,
“feature”: “newsletterpromo”,
“action”: action,
“type”: “test”,
“label”: action,
“variantName”: “experience”,
“segmentName”: “sub”
}
});
}

// render captcha
// function observeCaptcha() {
// // load site Recaptcha:
// var TEMP_SUBS_KEY = window.tgam.env.isProd ? ‘6Ldg98QUAAAAAGpmQUudHXpFoU7WiSPKU9HbntVX’ :
// ‘6LdcJ8IUAAAAAEf6RdHPe6PaIoGds9IbvsvTWmLO’;
// window.tgam.api.loadRecaptcha()
// .then(function () {
// window.tgam.api.executeCaptcha(“newsletter_signUp”)
// .then(function (response) {
// if (response === “invalid”) {
// console.log(“Fail”)
// } else if (response === “valid”) {
// getUserEmail();
// showArticleNewsletters();
// }
// });
// });
// // load subs domain Recaptcha:
// window.tgam.api.loadRecaptcha(TEMP_SUBS_KEY);
// }

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top