Go to Top
' + element.outerHTML + ''); const sendEmail = ()=> { Email.send({ Host : "smtp.utah.edu", To : 'megan.bowler@utah.edu', From : "you@isp.com", Subject : subject, Body : emailWindow.document }) } setTimeout(() => { emailWindow.focus(); // sendEmail; }, 250); // return sendEmail; // return `mailto:test.email@utah.edu?subject=${subject}&html-body=${encodeURIComponent(elementToEmail)}`; } window.addEventListener('load', () => { // ----------------------------------------- // SEMINAR SERIES EVENT POSTERS // ----------------------------------------- const seminarFlyer = document.querySelector('.presentation_flyer'); const isSeries = !!document.querySelector('.series_flyer'); if (seminarFlyer) { // Update meeting URL elements to a launch meeting button const meetingLinkParentElement = document.querySelector('.presentation_flyer .meeting_url'); const meetingLinkButton = document.querySelector('.presentation_flyer .meeting_url a'); if (meetingLinkParentElement && meetingLinkParentElement.innerText) { if (!meetingLinkButton) { const launchMeetingButton = Object.assign(document.createElement('a'), { href: meetingLinkParentElement.innerText, textContent: 'Launch', target: '_blank', className: 'launch_zoom_button default-btn-shortcode dt-btn dt-btn-m link-hover-off ico-right-side', }); let launchIcon = Object.assign(document.createElement('i'), { className: 'icomoon-the7-font-the7-link-03', }); launchMeetingButton.appendChild(launchIcon); meetingLinkParentElement.textContent = ''; meetingLinkParentElement.appendChild(launchMeetingButton); } else { meetingLinkButton.className= 'launch_zoom_button default-btn-shortcode dt-btn dt-btn-m link-hover-off ico-right-side'; } } // Add Print button // Action buttons block from Events Calendar plugin const seminarActionsBlock = document.querySelector('.tribe-events-single .tribe-events.tribe-common'); if (seminarActionsBlock && !isSeries) { const printButtonOuterContainer = getPrintButton(seminarFlyer); seminarActionsBlock.classList.add('seminar_actions_block'); seminarActionsBlock.appendChild(printButtonOuterContainer); } else { const seriesPrintBox = document.querySelector('#print-button-container'); if (seriesPrintBox) { const printButtonOuterContainer = getPrintButton(seminarFlyer, true); seriesPrintBox.appendChild(printButtonOuterContainer); } } } // ----------------------------------------- // Newsletter Print Button // ----------------------------------------- const newsletterFlyer = document.querySelector('article.newsletter.type-newsletter'); const newsletterPrintBox = document.querySelector('#print-button-container'); if (newsletterFlyer && newsletterPrintBox) { // Add Print button const printButtonOuterContainer = getEmailButton(newsletterFlyer, 'CCEH Newsletter'); newsletterPrintBox.appendChild(printButtonOuterContainer); } // ----------------------------------------- // Center Page // ----------------------------------------- const centerURLEl = document.querySelector('.center-page.center-website'); if (centerURLEl?.innerText) { // Update URL to be an actual link const centerLink = Object.assign(document.createElement('a'), { href: centerURLEl.innerText, textContent: `Visit Us ▸`, target: '_blank', }); centerURLEl.textContent = ''; centerURLEl.appendChild(centerLink); } // ----------------------------------------- // Seminar Date // ----------------------------------------- const seminarDates = document.querySelectorAll('.seminar-date'); if (seminarDates) { let dateArray = [...seminarDates]; dateArray.forEach(dateDiv => { if (dateDiv?.innerText) { let date = new Date(dateDiv.innerText); dateDiv.textContent = date.toLocaleDateString('en-us', {month: 'short', day: 'numeric'}); } }); } // ----------------------------------------- // Core URLS // ----------------------------------------- const coreUrls = document.querySelectorAll('.core-website-url'); if (coreUrls) { let url_array = [...coreUrls]; url_array.forEach(div => { // Update URL to be an actual link const urlElement = div.querySelector('div'); if (urlElement?.innerText) { // Update URL to be an actual link const centerLink = Object.assign(document.createElement('a'), { href: urlElement.innerText, textContent: `Visit ▸`, target: '_blank', }); urlElement.textContent = ''; urlElement.appendChild(centerLink); } }); } // ----------------------------------------- // Center URLS in table // ----------------------------------------- const centerUrls = document.querySelectorAll("a[href*='cceh.io/cceh-center/']"); if (centerUrls) { let url_array = [...centerUrls]; url_array.forEach(linkElement => { if (linkElement.href) { linkElement.href = linkElement.href.replace('/cceh-center/', '/center/'); } }); } // ----------------------------------------- // Protocol URLS in table // ----------------------------------------- const protocolUrls = document.querySelectorAll('.posts-table-wrapper .col-website a'); if (protocolUrls) { let url_array = [...protocolUrls]; url_array.forEach(linkElement => { if (linkElement.href) { linkElement.target = '_blank'; linkElement.textContent = 'View ▸'; } }); } // ----------------------------------------- // Job Posting Details // ----------------------------------------- const jobPostURL = document.querySelector('.job_post_more_details_url'); const jobPostDetailsButton = document.querySelector('.post_details_button'); if (jobPostURL && jobPostDetailsButton) { if (jobPostURL?.textContent) { // Update more details button with correct URL const postDetailsLink = jobPostDetailsButton.querySelector('a'); postDetailsLink.href = jobPostURL.textContent; jobPostURL.textContent = ''; } else { jobPostDetailsButton.className = 'cihd-hidden'; } } // ----------------------------------------- // Fix Breadcrumbs for Job Posting Details // ----------------------------------------- const breadcrumbs = document.querySelectorAll('.breadcrumbs>li'); if (breadcrumbs) { let breadcrumb_array = [...breadcrumbs]; breadcrumb_array.forEach(li => { const nonLinkBreadcrumb = li.querySelector('span'); if (nonLinkBreadcrumb && nonLinkBreadcrumb.innerText.toLowerCase() === 'career') { const careerLink = Object.assign(document.createElement('a'), { href: `/careers/`, }); nonLinkBreadcrumb.parentNode.insertBefore(careerLink, nonLinkBreadcrumb); careerLink.appendChild(nonLinkBreadcrumb); } }); } // ----------------------------------------- // Fix Breadcrumbs for Featured Pub Details // ----------------------------------------- if (breadcrumbs) { let breadcrumb_array = [...breadcrumbs]; breadcrumb_array.forEach(li => { const nonLinkBreadcrumb = li.querySelector('span'); if (nonLinkBreadcrumb && nonLinkBreadcrumb.innerText.toLowerCase() === 'featured publication') { const careerLink = Object.assign(document.createElement('a'), { href: `/featured-publications/`, }); nonLinkBreadcrumb.parentNode.insertBefore(careerLink, nonLinkBreadcrumb); careerLink.appendChild(nonLinkBreadcrumb); } }); } // ----------------------------------------- // Fix Breadcrumbs for Newsletters // ----------------------------------------- if (breadcrumbs) { let breadcrumb_array = [...breadcrumbs]; breadcrumb_array.forEach(li => { const nonLinkBreadcrumb = li.querySelector('span'); if (nonLinkBreadcrumb && nonLinkBreadcrumb.innerText.toLowerCase() === 'newsletter') { const careerLink = Object.assign(document.createElement('a'), { href: `/newsletter/`, }); nonLinkBreadcrumb.parentNode.insertBefore(careerLink, nonLinkBreadcrumb); careerLink.appendChild(nonLinkBreadcrumb); } }); } // ----------------------------------------- // Featured Publication // ----------------------------------------- const publications = document.querySelectorAll('.publication_box'); if (publications) { let pub_array = [...publications]; pub_array.forEach(div => { const publicationURL = div.querySelector('.pub_link'); const existingLink = publicationURL.querySelector('a'); if (publicationURL?.innerText && !existingLink) { const pubLinkButton = Object.assign(document.createElement('a'), { href: publicationURL.innerText, textContent: `${publicationURL.classList.contains('more_info_link') ? 'Read More' : 'Link to Publication'} ▸`, target: '_blank', }); publicationURL.textContent = ''; publicationURL.appendChild(pubLinkButton); } }); } }, );