[]
“),t.type){case”pdf”:if(a.default.isFirefox()||a.default.isEdge()||a.default.isIE())try{if(console.info(“PrintJS currently doesn’t support PDF printing in Firefox, Internet Explorer and Edge.”),!0===t.onBrowserIncompatible())window.open(t.fallbackPrintable,”_blank”).focus(),t.onPdfOpen&&t.onPdfOpen()}catch(e){t.onError(e)}finally{t.showModal&&l.default.close(),t.onLoadingEnd&&t.onLoadingEnd()}else d.default.print(t,o);break;case”image”:f.default.print(t,o);break;case”html”:u.default.print(t,o);break;case”raw-html”:c.default.print(t,o);break;case”json”:s.default.print(t,o)}}}},function(e,t,n){“use strict”;Object.defineProperty(t,”__esModule”,{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r},a=n(1);function l(e,t,n){var r=new window.Blob([n],{type:”application/pdf”});r=window.URL.createObjectURL(r),t.setAttribute(“src”,r),i.default.send(e,t)}t.default={print:function(e,t){if(e.base64){var n=Uint8Array.from(atob(e.printable),function(e){return e.charCodeAt(0)});l(e,t,n)}else{e.printable=/^(blob|http)/i.test(e.printable)?e.printable:window.location.origin+(“/”!==e.printable.charAt(0)?”/”+e.printable:e.printable);var r=new window.XMLHttpRequest;r.responseType=”arraybuffer”,r.addEventListener(“load”,function(){if(-1===[200,201].indexOf(r.status))return(0,a.cleanUp)(e),void e.onError(r.statusText);l(e,t,r.response)}),r.open(“GET”,e.printable,!0),r.send()}}}},function(e,t,n){“use strict”;Object.defineProperty(t,”__esModule”,{value:!0});var r,o=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(e,t){var n=document.getElementById(e.printable);n?(e.printableElement=function e(t,n){var r=t.cloneNode();var o=!0;var i=!1;var a=void 0;try{for(var l,d=t.childNodes[Symbol.iterator]();!(o=(l=d.next()).done);o=!0){var u=l.value;if(-1===n.ignoreElements.indexOf(u.id)){var c=e(u,n);r.appendChild(c)}}}catch(e){i=!0,a=e}finally{try{!o&&d.return&&d.return()}finally{if(i)throw a}}switch(t.tagName){case”SELECT”:r.value=t.value;break;case”CANVAS”:r.getContext(“2d”).drawImage(t,0,0)}return r}(n,e),e.header&&(0,o.addHeader)(e.printableElement,e),a.default.send(e,t)):window.console.error(“Invalid HTML element id: “+e.printable)}}},function(e,t,n){“use strict”;Object.defineProperty(t,”__esModule”,{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};t.default={print:function(e,t){e.printableElement=document.createElement(“div”),e.printableElement.setAttribute(“style”,”width:100%”),e.printableElement.innerHTML=e.printable,i.default.send(e,t)}}},function(e,t,n){“use strict”;Object.defineProperty(t,”__esModule”,{value:!0});var r,o=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(r,e){r.printable.constructor!==Array&&(r.printable=[r.printable]),r.printableElement=document.createElement(“div”),r.printable.forEach(function(e){var t=document.createElement(“img”);t.setAttribute(“style”,r.imageStyle),t.src=e;var n=document.createElement(“div”);n.appendChild(t),r.printableElement.appendChild(n)}),r.header&&(0,o.addHeader)(r.printableElement,r),a.default.send(r,e)}}},function(e,t,n){“use strict”;Object.defineProperty(t,”__esModule”,{value:!0});var r,o=”function”==typeof Symbol&&”symbol”==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&”function”==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?”symbol”:typeof e},c=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(t,e){if(“object”!==o(t.printable))throw new Error(“Invalid javascript data object (JSON).”);if(“boolean”!=typeof t.repeatTableHeader)throw new Error(“Invalid value for repeatTableHeader attribute (JSON).”);if(!t.properties||!Array.isArray(t.properties))throw new Error(“Invalid properties array for your JSON data.”);t.properties=t.properties.map(function(e){return{field:”object”===(void 0===e?”undefined”:o(e))?e.field:e,displayName:”object”===(void 0===e?”undefined”:o(e))?e.displayName:e,columnSize:”object”===(void 0===e?”undefined”:o(e))&&e.columnSize?e.columnSize+”;”:100/t.properties.length+”%;”}}),t.printableElement=document.createElement(“div”),t.header&&(0,c.addHeader)(t.printableElement,t),t.printableElement.innerHTML+=function(e){var t=e.printable,n=e.properties,r=’
“}(t),a.default.send(t,e)}}}]).default}); document.querySelector(‘.all-content-wrapper’).setAttribute(‘id’,’printable’); ChangeListener(‘.lead_post_body_main .share-pinterest, .mobile_social_links .share-pinterest’, function(el) { el.outerHTML=’‘; }); ChangeListener(‘.lead_post_body_main .share-print, .mobile_social_links .share-print’, function(el) { el.addEventListener(“click”, function(){ if (navigator.userAgent.indexOf(“Firefox”) > 0) {window.print();}else{ printJS({printable: ‘printable’,type: ‘html’,targetStyles: [‘*’],css: ‘https://partners.rebelmouse.com/commondreams/print.css?s=0′,style: “.custom-field-after-seconds,.custom-field-popup-bg-color,.custom-field-popup-text-color,.custom-field-location,.no-print { display: none !important; }”}); } }); }); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ if (getCookie(“popupShown”) || (getCookie(“hide_newsletter”) != null && getCookie(“hide_newsletter”))) { console.log(“nothing to do”); return; } if(document.querySelector(“.popup-modal .mb-2.popup–article #mc-embedded-subscribe”) != null) { const popupform = document.querySelector(“.popup-modal [name=’mc-embedded-subscribe-form’]”); popupform.addEventListener(“submit”, () => { setCookie(“hide_newsletter”, “true”, 365); }); popupform.addEventListener(“click”, () => { setCookie(“hide_newsletter”, “true”, 365); }); /*document.querySelector(“.popup-modal .mb-2.popup–article #mc-embedded-subscribe”).addEventListener(“click”, function(){ // Set the “hide_newsletter” cookie to “true” for 1 year (365 days) setCookie(“hide_newsletter”, “true”, 365); });*/ } const popupBackdrop = document.querySelector(“.popup–backdrop”); const closePopupButton = popupBackdrop.querySelector(“.close-button”); const afterSecondsField = popupBackdrop.querySelector( “.custom-field-after-seconds” )?.textContent; const scrollingBeginsField = popupBackdrop.querySelector( “.custom-field-scrolling-begins” )?.textContent; const customFieldObj = document.querySelector(“.popup–article .custom-field-visible-to-admin-only”); const customBGColor = popupBackdrop.querySelector(‘.custom-field-popup-bg-color’)?.textContent const customTextColor = popupBackdrop.querySelector(‘.custom-field-popup-text-color’)?.textContent popupBackdrop.style.setProperty(‘–background-color’, `${customBGColor}`) popupBackdrop.style.setProperty(‘–text-color’, `${customTextColor}`) const after_seconds = Number(afterSecondsField); const scrolling_begins = scrollingBeginsField === “True”; let lastScrollPosition = 0; let userHasInteracted = false; const scrollDeltaThreshold = 5; const showPopup = () => { console.log(“—- showPopup —-“) if (((customFieldObj != null && getCookie(“userIsAdmin”)) || customFieldObj == null) && !getCookie(“popupShown”) ){ popupBackdrop.classList.add(“open”); setCookie(“popupShown”, true, 30); } }; const hidePopup = () => popupBackdrop.classList.remove(“open”); if(closePopupButton != null) { closePopupButton.addEventListener(“click”, hidePopup); } const userEvents = [“mousemove”, “mousedown”, “keydown”, “touchstart”]; let userEventListenersRemoved = false; const userInteraction = () => { userHasInteracted = true; if (userEventListenersRemoved) return; userEvents.forEach((event) => { document.removeEventListener(event, userInteraction); userEventListenersRemoved = true; }); }; userEvents.forEach((event) => document.addEventListener(event, userInteraction) ); if (!scrolling_begins && !isNaN(after_seconds)) { setTimeout(showPopup, after_seconds * 1000); } else if (scrolling_begins) { document.addEventListener(“scroll”, debounce(handleScroll, 50)); } function handleScroll() { console.log(“—-handle Scroll—-“) if (scrolling_begins && !userHasInteracted) return; if (scrolling_begins) { const currentScrollPosition = window.scrollY || document.documentElement.scrollTop; const scrollDelta = Math.abs(currentScrollPosition – lastScrollPosition); if (scrollDelta > scrollDeltaThreshold) { setTimeout(showPopup, 0); document.removeEventListener(“scroll”, debounce(handleScroll, 50)); } lastScrollPosition = currentScrollPosition; } } function debounce(func, wait, immediate = false) { let timeout; return function (…args) { const context = this; const later = function () { timeout = null; if (!immediate) func.apply(context, args); }; const shouldCallNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (shouldCallNow) func.apply(context, args); }; } // to be implemented: cookies function setCookie(name, value, days) { let date = new Date(); date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); let expires = “expires=” + date.toUTCString(); document.cookie = name + “=” + value + “;” + expires + “;path=/”; } function getCookie(cname) { let name = cname + “=”; let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(“;”); for (let i = 0; i < ca.length; i++) { let c = ca[i]; while (c.charAt(0) == " ") { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ REBELMOUSE_STDLIB.createElementChangeListener('a[data-track-share="Twitter"]', function(twitterEle) { // Check if the element exists if (twitterEle) { // Extract the href attribute from the Twitter link const twitterHref = new URL(twitterEle.href); // Extract the `text` and `url` parameters from the Twitter link const text = twitterHref.searchParams.get("text") || ""; const url = twitterHref.searchParams.get("url") || ""; // Construct the Bluesky compose URL with text first, then the space-separated URL const blueskyHref = `https://bsky.app/intent/compose?text=${encodeURIComponent(text)} ${encodeURIComponent(url)}`; // Update the href attribute of the Twitter link to the Bluesky URL twitterEle.href = blueskyHref; } }); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ if(document.querySelector(".body .newsletter-aside") != null && document.querySelector(".body") != null) { var newsletterr_heght = document.querySelector( ".body .newsletter-aside" ).clientHeight; var newsletterr_width = document.querySelector(".body").clientWidth; document.querySelector(".body").style.maxWidth = newsletterr_width + "px"; window.REBELMOUSE_STDLIB.onElementInViewport({ selector: ".body .newsletter-aside", threshold: -newsletterr_heght, oneTime: false, onIntersect: (entry) => { var element = entry.target; document.querySelector(“.body .newsletter-aside”).classList.add(“higlight”); console.log(“Intersection******************”); setTimeout(function() { document.querySelector(“.body .newsletter-aside”).classList.remove(“higlight”); console.log(“SetTimeout******************”); }, 2000); }, onBelowViewport: (element) => { document.querySelector(“.body .newsletter-aside”).classList.remove(‘higlight’); }, onAboveViewport: (element) => { document.querySelector(“.body .newsletter-aside”).classList.remove(‘higlight’); } }); } }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ var test = ‘trumps-gop-megabill-slams-door-on-progress-of-the-20th-century’; if(test && test != ” && test != ‘null’ && test != null){ /* Creates comment icon */ const leftButtons = document.querySelector(‘.lead_post_share_social .posts-custom .widget__shares’); const facebookSpan = leftButtons.querySelector(‘.share-fb’).parentElement; facebookSpan.insertAdjacentHTML(‘beforeend’,”); /* Get Post data*/ fetch(‘https://commons.commondreams.org/t/trumps-gop-megabill-slams-door-on-progress-of-the-20th-century/229883.json’, { method: ‘GET’, headers: { ‘Accept’: ‘application/json’, }, }).then(response => response.json()) .then(response =>{ replyCount = response.posts_count – 1; document.querySelector(‘.comment_round_button .comment_count’).textContent = replyCount; /* This line shows reply counter in Big Discourse Button:: */ /* document.querySelector(‘.discourse-btn .btn’).textContent += ` (${replyCount})`; */ }); const commentsBtn = document.querySelector(‘.comment_round_button’); commentsBtn.addEventListener(‘click’, function(ev){ window.open(commentsBtn.dataset.link, ‘_blank’); }); } /*document.querySelector(“.share-plus.js-toggle”).addEventListener(“click”, function(ele){ document.querySelector(“.comment_round_button”).classList.toggle(“hide-button”); });*/ }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ REBELMOUSE_STDLIB.createElementChangeListener(‘.lead_post_tags_seo .social-author__name’, function(el) { if(el.nextElementSibling && el.nextElementSibling.classList.contains(‘social-author__bio’)) { el.nextElementSibling.insertAdjacentHTML(‘afterend’, ‘
‘); } else { el.insertAdjacentHTML(‘afterend’, ‘
‘); } }); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ REBELMOUSE_STDLIB.createElementChangeListener(“.newsletter-campaign .custom-field-source-text”, function(button){ button.setAttribute(‘data-before’, ”); button.innerHTML=’‘; }) }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ /* Checking the position set with a post custom field, if it is not a default one (above) – change the position to custom */ const blockPlacement = () => { const newsletterBlock = document.querySelector(‘.js-newsletter-wrapper’); const placementPosition = document.querySelector(‘.custom-field-newsletter-position’) ? document.querySelector(‘.custom-field-newsletter-position’).innerText : false; if (!placementPosition) { return newsletterBlock.classList.remove(‘visually-hidden’); } const targetBlock = document.querySelector(‘.tab_wrap’); placementPosition === ‘above’ || placementPosition === ” ? false : targetBlock.insertAdjacentElement(‘afterend’, newsletterBlock); return newsletterBlock.classList.remove(‘visually-hidden’); } blockPlacement(); });{ console.log(user.profileSite.permissions); //change_site_domain // if(user.profileSite.permissions.change_site_domain){ setCookie(‘userIsAdmin’, true); } }).catch(error => { // This will execute if the promise is rejected deleteCookie(‘userIsAdmin’); console.error(“Promise rejected:”, error); }); function setCookie(name, value) { document.cookie = name + “=” + value + “; path=/”; } }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ dataLayer.push({ ‘author’: ‘Amy Hanauer’, ‘section’: ‘Opinion’, ‘primary_tag’: ‘big ugly bill’, ‘publish_date’: ’07/13/2025′, }); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ REBELMOUSE_STDLIB.createElementChangeListener(“.breaking-news-top .widget”, function(post){ window.scrollBy(0, 1); }) }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ console.log(‘— Start tracking optimized —‘) REBELMOUSE_STDLIB.createElementChangeListener( “.boost-post-article .widget”, function (articleElement) { const boosted_page = articleElement.querySelector( “a.widget__headline-text” ).href; //boost_impression gtag(“event”, “boost_impression”, { boosted_page: boosted_page, }); } ); REBELMOUSE_STDLIB.createElementChangeListener( “.boost-post-article .rm-embed.embed-media p”, function (embedElement) { const boosted_page = embedElement.querySelector(“iframe”).id; //boost_click embedElement.addEventListener(“click”, handleGAClickEvent); function handleGAClickEvent(ev) { ev.preventDefault(); console.log(boosted_page); gtag(“event”, “boost_click”, { click_type: “embed_clicks”, link_url: boosted_page, boosted_page: boosted_page, }); return false; } } ); //boost_viewable REBELMOUSE_STDLIB.onElementInViewport({ oneTime: true, threshold: 10, selector: “.boost-post-article .widget”, onIntersect: (entry) => { const articleElement = entry.target; console.log(‘boost_viewable’, articleElement) const boosted_page = articleElement.querySelector( “a.widget__headline-text” ).href; gtag(“event”, “boost_viewable”, { boosted_page: boosted_page, }); }, }); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ const breakingNewsTop = document.querySelector( “.breaking-news-top-wrapper .breaking-news-top” ); function checkCustomField() { if (breakingNewsTop.children.length > 0) { let customFieldObj = breakingNewsTop.querySelector( “.custom-field-visible-to-admin-only” ); if ( !getCookie(“userIsAdmin”) && customFieldObj && customFieldObj.innerHTML == “True” ) { document.querySelector(“.breaking-news-top-wrapper”).style.display = “none”; document.body.classList.remove(“expanded-header”); document.body.classList.remove(“collapsed-header”); } else { document .querySelector(“.breaking-news-top-wrapper.journey-unit”) .classList.remove(“hidden”); } } } checkCustomField(); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ console.log(“You are in the CWV BTEST”) let breakingNewsHeight = 0; function isMobile() { return /Mobi|Android|iPhone|iPod|BlackBerry|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent); } function isIpadByWidth() { const width = window.innerWidth; const height = window.innerHeight; // Common iPad viewport widths in portrait & landscape const ipadWidths = [810, 820, 834, 1024,1138, 1180, 1366]; return ipadWidths.includes(width) || ipadWidths.includes(height) || window.innerWidth > 767; } if (isIpadByWidth()) { console.log(“User is likely on an iPad”); } window.scroll_distance = 0; window.scroll_up = false; window.max_scroll = 0; const documentBody = document.body; const payWallWrapper = document.getElementsByClassName( “paywall-bar__wrapper” )[0]; const breakingNewsWrapper = document.querySelector( “.breaking-news-top-wrapper” ); const breakingNewsTop = document.querySelector( “.breaking-news-top-wrapper .breaking-news-top” ); const customFieldObj = breakingNewsTop.querySelector( “.custom-field-visible-to-admin-only” ); const customFieldMobileObj = breakingNewsTop.querySelector( “.custom-field-cta-visible-mobile” ); const payWallCaret = document.querySelector(“#paywall-bar__caret”); function setSessionCookie(name, value) { document.cookie = name + “=” + encodeURIComponent(value) + “; path=/”; } if (breakingNewsTop.children.length > 0) { payWallCaret.classList.remove(“hidden”); if ( !getCookie(“userIsAdmin”) && customFieldObj && customFieldObj.innerHTML == “True” ) { deleteCookie(“superHeader”); documentBody.classList.remove(“collapsed-header”); documentBody.classList.remove(“expanded-header”); } if (getCookieValue(“superHeader”) == “collapsed”) { payWallWrapper.classList.add(“paywall-bar__collapsed”); payWallWrapper.classList.remove(“paywall-bar__expanded”); documentBody.classList.add(“collapsed-header”); documentBody.classList.remove(“expanded-header”); } else { payWallWrapper.classList.add(“paywall-bar__expanded”); payWallWrapper.classList.remove(“paywall-bar__collapsed”); documentBody.classList.remove(“collapsed-header”); documentBody.classList.add(“expanded-header”); } setTimeout(function(){ window.scrollTo(0,0); },500); } function getCookieValue(name) { // Split the document.cookie string into individual cookies let cookies = document.cookie.split(“;”); // Loop through the cookies to find the one with the specified name for (let i = 0; i breakingNewsHeight + 150 && breakingNewsHeight >= 0) { documentBody.classList.add(“fixed-nav”); if (breakingNewsTop.children.length > 0) { if ( !getCookie(“userIsAdmin”) && customFieldObj && customFieldObj.innerHTML == “True” ) { deleteCookie(“superHeader”); documentBody.classList.remove(“collapsed-header”); documentBody.classList.remove(“expanded-header”); } else if(!isIpadByWidth() && isMobile() && customFieldMobileObj == null) { deleteCookie(“superHeader”); documentBody.classList.remove(“collapsed-header”); documentBody.classList.remove(“expanded-header”); }else { setSessionCookie(“superHeader”, “collapsed”); documentBody.classList.add(“collapsed-header”); documentBody.classList.remove(“expanded-header”); payWallWrapper.classList.add(“paywall-bar__collapsed”); payWallWrapper.classList.remove(“paywall-bar__expanded”); } } if (window.scrollY > scroll_distance) { window.scroll_up = false; } else { if (window.scrollY > scroll_distance – 20) { window.scroll_up = true; documentBody.classList.remove(“scroll-down”); documentBody.classList.add(“scroll-up”); // console.log( “scrolling up” ); } else { // console.log( “scrolling in the between” ); } } } else { documentBody.classList.remove(“fixed-nav”); documentBody.classList.remove(“scroll-down”); documentBody.classList.remove(“scroll-up”); } scroll_distance = window.scrollY; } function debounce(fun, time) { var timeout = null; function execute() { timeout = null; fun(); } return function debouncedFun() { if (timeout) { return; } timeout = setTimeout(execute, time); }; } let previousHeight = breakingNewsWrapper.offsetHeight; const resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) { if (entry.contentRect.height !== previousHeight) { //console.log(“The height of the element has changed.”); previousHeight = entry.contentRect.height; breakingNewsHeight = previousHeight; resizeObserver.disconnect(); } } }); resizeObserver.observe(breakingNewsWrapper); window.addEventListener(“scroll”, debounce(onScroll, 50), { passive: true, }); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ // (function(w,d,s,n,a){if(!w[n]){var l=’call,catch,on,once,set,then,track’ .split(‘,’),i,o=function(n){return’function’==typeof n?o.l.push([arguments])&&o :function(){return o.l.push([n,arguments])&&o}},t=d.getElementsByTagName(s)[0], j=d.createElement(s);j.async=!0;j.src=’https://cdn.fundraiseup.com/widget/’+a; t.parentNode.insertBefore(j,t);o.s=Date.now();o.v=4;o.h=w.location.href;o.l=[]; for(i=0;i<7;i++)o[l[i]]=o(l[i]);w[n]=o} })(window,document,'script','FundraiseUp','ANRLZVWL'); // }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ //ChangeListener(‘.custom-dbox-popupz, .donate_round_button’, function(el){el.addEventListener(“click”, function(){document.querySelector(‘.modal_donor’).style.display=’block’;})}); ChangeListener(‘.all-related-sections a’, function(el){ console.log(el.innerText); if(el.innerText == ‘Source’) { document.querySelector(‘.creative_common_work’).classList.add(‘actz’); } }); ChangeListener(‘.lead_post_share_social’, function (el) { let social_date = el.querySelector(‘.social-date’).outerHTML; el.querySelector(‘.social-date’).remove(); el.querySelector(‘.social-author’).insertAdjacentHTML(‘beforeend’,social_date); }); ChangeListener(‘.lead_post_body_main .share-pinterest, .mobile_social_links .share-pinterest’, function(el) { el.setAttribute(‘href’,’javascript:window.print();’); el.querySelector(‘i’).classList.remove(‘fa-pinterest’); el.querySelector(‘i’).classList.add(‘fa-print’); el.setAttribute(‘data-track-share’,’Print’); el.setAttribute(‘aria-label’,’Print Page’); el.insertAdjacentHTML(‘afterend’, ‘‘); }); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ window.postContentParent = document.querySelector(‘.lead_post_post_body .body-description’); window.postContentParent.querySelectorAll(“.pull-quote”).forEach(currentPl => { currentPl.classList.add(“trinity-skip-it”); }); var encodedURI = encodeURI(‘https://www.commondreams.org/opinion/trump-gop-spending-bill-20th-century’); var trinityNode = document.createElement(‘script’); trinityNode.src = ‘https://trinitymedia.ai/player/trinity/2900021701/?pageURL=’ + encodedURI; if (window.postContentParent) { window.postContentParent.prepend(trinityNode); } }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ if(document.querySelector(“.newsletter-and-social #mc-embedded-subscribe”) != null) { const stickyform = document.querySelector(“.newsletter-and-social [name=’mc-embedded-subscribe-form’]”); stickyform.addEventListener(“submit”, () => { setCookie(“hide_newsletter”, “true”, 365); }); stickyform.addEventListener(“click”, () => { setCookie(“hide_newsletter”, “true”, 365); }); } const stringPortion = “Thank you for subscribing”; const userMessage = “You’re already subscribed, your profile has been updated. Thank you!”; const expectedMessage = “You’re already subscribed. Thank you!”; let target = document.querySelector(“.newsletter-and-social #mce-success-response”); let observer = new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { console.log(“CurrentText”,target.innerHTML); if ( target.innerHTML === userMessage ) { console.log(“text changed!!!”) target.innerHTML = expectedMessage; } }); }); const config = { attributes: true, childList: true, characterData: true }; observer.observe(target, config); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ /* Checking the custom field for the form submit button text, if it is set – change the default one to custom */ const setCustomText = () => { const customButtonText = document.querySelector(‘.custom-field-newsletter-button-text’) ? document.querySelector(‘.custom-field-newsletter-button-text’).innerText : false; if (!customButtonText) { return false; } const formButton = document.querySelector(‘.newsletter-wrapper .widget ._submit’); let result; if (formButton) {result = formButton.innerText = `${customButtonText}`;} return result } setCustomText(); }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ const controlElement = document.querySelector(‘.popup-control-wrapper .widget__subheadline-text p’); let popupDelay; if (controlElement) { popupDelay = Number(controlElement.innerText) * 1e3; } if (popupDelay) { const showDonateModal = () => { const donateButton = document.querySelector(‘.custom-dbox-popupz’); if (donateButton) { donateButton.click(); return true } return false; } const startTimer = () => setTimeout(showDonateModal, popupDelay); const checkCookie = () => { const isDonateWindowClosed = localStorage.getItem(‘donateClosed’); if (!isDonateWindowClosed) { return startTimer(); } const item = JSON.parse(isDonateWindowClosed); const now = new Date(); if (now.getTime() > item.expiry) { localStorage.removeItem(‘donateClosed’); return startTimer(); } } checkCookie(); const setCookie = (key, ttl) => { const now = new Date(); const item = { value: true, expiry: now.getTime() + 6000000, }; return localStorage.setItem(‘donateClosed’, JSON.stringify(item)); } const donateClose = document.querySelector(‘.modal_close’); donateClose.addEventListener(‘click’, setCookie, false); } }); window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){ const addDonateButton = () => { const campaignArticles = Array.from(document.querySelectorAll(‘.campaign-article’)); if (campaignArticles.length { const widgetBody = article.querySelector(‘.widget__body’); if (!widgetBody) { return false; } const button = `