`;
}
});
}
// Modify this to format and display your session details on the webpage
const cardElement = document.createElement('div');
cardElement.classList.add('ta-session-card');
cardElement.classList.add('collapsed');
cardElement.innerHTML = `
${mobileTagAttributeValues?.length > 0 ? `
${displaySessionTags(mobileTagAttributeValues)}
${displayproductionTags(productionTypeAttribute)}
` : ''}
${speakers ? `
${speakers}
` : ''}
${abstract}
Add to Schedule
${showRoomDetails && room ? `${room} | ` : ''}
${utcStartTime && utcEndTime ? `${displaySessionTimes(utcStartTime, utcEndTime)}` : ''}
`;
containerElement.appendChild(cardElement);
const sessionDescHeight = cardElement.querySelector('.ta-session-description').scrollHeight;
if (sessionDescHeight < 70) {
cardElement.querySelector('.ta-show-more').classList.add('hide');
}
cardElement.querySelector('.ta-session-description').style.maxHeight = `${sessionDescHeight}px`;
// Add event listener for "Show More" button
const showMoreBtn = cardElement.querySelector('.ta-show-more-btn');
showMoreBtn.addEventListener('click', () => toggleDescription(cardElement));
}
function toggleDescription(cardElement) {
const descriptionElement = cardElement.querySelector('.ta-session-description');
const showMoreBtn = cardElement.querySelector('.ta-show-more-btn');
const showMoreText = showMoreBtn.querySelector('span.ta-show-more-txt');
const showMoreChevron = showMoreBtn.querySelector('span.fa');
const isCollapsed = cardElement.classList.contains('collapsed');
if (isCollapsed) {
showMoreText.innerText = pageData['showLess'] || 'Show Less';
showMoreChevron.classList.remove('fa-chevron-down');
showMoreChevron.classList.add('fa-chevron-up');
} else {
showMoreText.innerText = pageData['showMore'] || 'Show More';
showMoreChevron.classList.remove('fa-chevron-up');
showMoreChevron.classList.add('fa-chevron-down');
}
cardElement.classList.toggle('collapsed');
}
function fetchSessionIds() {
const featuredSessions = [];
for (var i = 1; i <= 12; i++) {
var key = 'ta-featured-session-' + i;
if (pageData[key] !== null && pageData[key] !== undefined && pageData[key] !== '') {
featuredSessions.push(pageData[key]);
}
}
fetchAndDisplaySessions(featuredSessions);
}
function setHeroImageCredit() {
const creditText = pageData['ta-imgcredit'];
const imageCredit = document.querySelector('#image-credit .description span');
imageCredit.innerHTML = creditText;
const featuredSessionsText = pageData['featuredSessions'];
const featuredSessions = document.querySelector('#featured-sessions .title');
if (featuredSessionsText) featuredSessions.innerHTML = featuredSessionsText;
}
function init() {
const pageProps = document.querySelector('#ta-page-props').dataset.pageProps;
pageData = JSON.parse(pageProps);
setHeroImageCredit();
fetchSessionIds();
}
init();