window.PARSELY = window.PARSELY || {}; function isPublished(post){ return [0,1,2] .includes(post.status) } window.PARSELY.autotrack = false; window.PARSELY.onload = function () { if(Object.keys(window.REBELMOUSE_BOOTSTRAP_DATA.post).length > 0 && !isPublished(window.REBELMOUSE_BOOTSTRAP_DATA.post)){ return; } var event = { url: location.href, urlref: document.referrer, js: 1 }; window.PARSELY.updateDefaults({ data: { level: localStorage.getItem(“userMembershipStatus”) || “anonymous” } }); window.PARSELY.beacon.trackPageView(event); };
console.warn(“Unexpected error: `TypeError(‘Object of type Undefined is not JSON serializable’)` while processing “)console.warn(“Use \”?__sentry_sample_rate__=1\” to analyze this error in Sentry”)var popupGatedElement=document.querySelector(‘.gated-popup’), closeGated, gatedCloseBtn = ‘.js–close-gated’, gatedShownClass = ‘gated-popup–shown’; closeGated = function () { popupGatedElement.classList.remove(gatedShownClass); popupGatedElement.classList.remove(‘for_save’); popupGatedElement.classList.remove(‘for_pdf’); popupGatedElement.classList.remove(‘for_ebooks’); popupGatedElement.classList.remove(‘for_pdf_issues’); popupGatedElement.classList.remove(‘for_nxtbook’); popupGatedElement.classList.remove(‘for_follow_topics’); popupGatedElement.classList.remove(‘for_comments’); popupGatedElement.classList.remove(‘for_member_content’); }; function openGatedPopup(type){ document.querySelectorAll(“.popup_links.create_account .list__item”)[0] .href = “https://www.ieee.org/profile/public/createwebaccount/showCreateAccount.html?ShowMGAMarkeatbilityOptIn=true&sourceCode=spectrum&signinurl=” + encodeURIComponent(window.location.origin + “/core/saml/main/login?next_url=” + window.location.origin + “/core/integrations/ieee/changes?redirect=” + window.location.href) + “&url=” + encodeURIComponent(window.location.origin + “/core/saml/main/login?next_url=” + window.location.origin + “/core/integrations/ieee/changes?redirect=” + window.location.href) + “&autoSignin=Y&car=IEEE-Spectrum”; // update popups for_member_content document.querySelectorAll(“.popup_links.for_member_content .list__item”)[1] .href = “https://spectrum.ieee.org/core/saml/main/login?next_url=” + encodeURIComponent(“https://spectrum.ieee.org/core/integrations/ieee/changes?redirect=” + window.location.href); // update popups for_pdf for_save for_comments document.querySelectorAll(“.popup_links.for_save .list__item”)[1] .href = “https://spectrum.ieee.org/core/saml/main/login?next_url=” + encodeURIComponent(“https://spectrum.ieee.org/core/integrations/ieee/changes?redirect=” + window.location.href); popupGatedElement.classList.add(type); popupGatedElement.classList.add(gatedShownClass); } document.querySelector(gatedCloseBtn).onclick= closeGated;
function addPopSave(){ var save_post_links = document.querySelectorAll(“.like-btn:not(.proc)”); for (i = 0; i < save_post_links.length; i++) { // save_post_links[i] .removeAttribute("href"); save_post_links[i] .addEventListener("click", function(event){ openGatedPopup('for_save'); }); save_post_links[i] .classList.add('proc'); } }
function feature_post_full_style(){ var feature_post_full = document.querySelectorAll(“.feature_post_full:not(.proc)”); for (i = 0; i < feature_post_full.length; i++) { var style_post_color = feature_post_full[i] .querySelector(".custom-field-FeaturePostColor"); var style_post_position = feature_post_full[i] .querySelector(".custom-field-FeaturePostImgPosition"); if(style_post_color){ feature_post_full[i] .classList.add(style_post_color.innerText.trim()); }else{ feature_post_full[i] .classList.add('DarkGray'); } if(style_post_position){ feature_post_full[i] .classList.add(style_post_position.innerText.trim()); } feature_post_full[i] .classList.add('proc'); } }




