“);
// Style the search bars (standard and mobile)
var searchBarStyled = $(‘#cb-logo-box’).append(“”);
var mobSearchBarStyled = $(‘ul.cb-mobile-nav’).prepend(“
var mobSearchBarStyled = $(‘#cb-nav-bar>div>ul>li.menu-item-has-children>a’).append(” “);
// Mobile menu buttons
var mobdropdownbuttons = $(‘span.cb-icon-plus’).each(function() {
$(this).addClass(‘fa’);
});
// Add buttons to the footer
var subscriptionButton = $(‘#subscribe-submit>input:last’).addClass(“base-btn button-primary”);
var exitMobileMenuButton = $(‘#cb-mob-close>i’).removeClass(‘cb-times’).addClass(‘fa-times’);
// Ensure that each page has proper top spacing
var topSpacer = $(‘#cb-section-a’).addClass(“cb-fis-pad”);
// Hold onto the details of the social feed
var socialHolder = $(‘#cb-footer div.cb-under-footer’);
// Flip the footer and instagram feed
var socialFlipper = $(‘#cb-footer’).prepend(socialHolder);
// // Remove all placeholder images
var placeholderRemover = $(“div.cb-mask:has(img[alt*=’placeholder’])”).each(function() {
$(this).css(“display”, “none”);
$(this).next().css({“width”: “100%”, “padding-left”: “0px”});
});
// Adjust page title dynamically
var pagetitle = $(‘title’);
if (pagetitle[0].innerHTML != ‘The Daily | Case Western Reserve University’) {
//adjust the title
var pagetitleholder = pagetitle[0].innerHTML;
if (pagetitle[0].innerHTML.search(” Archives”) == -1) {
pagetitleholder += ” The Daily”;
}
pagetitleholder = pagetitleholder.replace(” Archives”, “”);
if (pagetitleholder.length < 22) {
pagetitleholder += ” | Case Western Reserve University”;
}
pagetitle[0].innerHTML = pagetitleholder;
}
// If the page is a Community Posting – add the disclaimer to the page
var checkTheCategory = $(‘.cb-category’).each(function() {
if ($(location).attr(‘href’) != ‘https://thedaily.case.edu/category/community-postings/’) {
if ($(this).find(‘a’).attr(‘href’) == ‘https://thedaily.case.edu/category/community-postings/’) {
// append the disclaimer
$(this).parent().before(”);
}
}
if ($(location).attr(‘href’) != ‘https://thedaily.case.edu/category/events/’) {
if ($(this).find(‘a’).attr(‘href’) == ‘https://thedaily.case.edu/category/events/’) {
// append the disclaimer
$(this).parent().parent().next().after(‘
Case Western Reserve University is committed to academic freedom and promoting diversity of thought. The views of those who speak on our campus do not necessarily reflect the views of the university administration or any other segment of the university community.
‘);
}
}
});
if ($(“.category-20”)[0]) {
// append the disclaimer
$(‘.cb-pagination’).after(‘
Case Western Reserve University is committed to academic freedom and promoting diversity of thought. The views of those who speak on our campus do not necessarily reflect the views of the university administration or any other segment of the university community.
‘);
}
// Search for areas to drop buttons in the main content
var hreftest = $(location).attr(‘href’).split(‘/’);
if (hreftest[3] != ”) {
var logoAdjuster = $(‘#logo>a’).wrap(”);
};
if ((hreftest[3] != ”) && (hreftest[4] == ”) && ((hreftest[3] != ‘events’) && (hreftest[3] != ‘about’) && (hreftest[3] != ‘community-postings’) && (hreftest[3] != ‘community-postings-form’) && (hreftest[3] != ‘connect’))) {
var mainContentButtons = $(‘div.cb-main>div’).each(function() {
var hrefholder = $(this).find(‘div.cb-module-header>h2’).text();
var cleanlink = ((((hrefholder.replace(“, “,”-“)).replace(” & “,”-“)).replace(” “,”-“)).toLowerCase());
switch (cleanlink) {
case ‘athletics’:
$(this).append(‘‘);
break;
case ‘featured’:
$(this).append(‘‘);
break;
case ‘media-mentions’:
$(this).append(‘‘);
break;
case ‘people’:
$(this).append(”);
break;
case ‘in-memory’:
$(this).append(‘‘);
break;
case ‘campus-updates’:
$(this).append(‘‘);
break;
case ‘awards’:
$(this).append(‘‘);
break;
case ‘publications-presentations’:
$(this).append(‘‘);
break;
case ‘appointments’:
$(this).append(‘‘);
break;
default:
$(this).append(‘‘);
break;
};
});
};
if ((hreftest[3] == ‘category’) && (hreftest[4] == ‘community-postings’)) {
var fixTheSidebar = $(‘aside.cb-sidebar’).empty();
fixTheSidebar.append(”);
};
if ($(‘#cb-featured-image.cb-gallery-post-wrap’).length > 0) {
var fixTheTitle = $(‘#cb-featured-image>div.cb-entry-header.cb-meta’);
var placeTheTitle = $(‘div.cb-post-wrap div.cb-main’).prepend(fixTheTitle);
var fixTheCaption = $(‘span.cb-caption’).css({“width”: “100%”, “max-width”: “100%”, “text-align”: “center”});
};
if (hreftest[3] == ‘events’) {
// Hold onto the details of the calendar
var calendarHolder = $(‘.stec’).parent();
// Change places for the calendar on the Calendar Page
var calendarFlipper = $(‘.cb-main div.cb-contents’).prepend(calendarHolder);
// Change places for the calendar on the Events Page
var calendarFlipper = $(‘#cb-section-a div.cb-contents’).prepend(calendarHolder);
// Choose not to display day and week views
var calendarViewFlipper = $(“li[data-view=’day’], li[data-view=’week’]”).each(function() {
$(this).css(“display”, “none”);
});
// Change the filter icon to text
var calendarFilterIconChanger = $(‘i.fa-calendar’).replaceWith(“
Filter by Subject
“);
// Final Removals
var calendarMonthOrderChanger = $(‘.stec-top-menu-layouts li:first-child’).insertAfter(‘.stec-top-menu-layouts li:nth-child(2)’);
$(window).on(“load, resize”, function() {
var viewportWidth = $(window).width();
if (viewportWidth < 768) {
$(“li[data-view=’month’]”).removeClass(“active”);
$(“li[data-view=’agenda’]”).addClass(“active”);
} else {
$(“li[data-view=’month’]”).addClass(“active”);
$(“li[data-view=’agenda’]”).removeClass(“active”);
}
});
};
// window.setTimeout(hider, 5000);
// function hider() {
// $(‘iframe’).each(function() {
// if (this.src.split(‘/’)[2] == ‘disqusads.com’) {
// $(this).hide();
// }
// });
// }
});
// Watch all of the clicks that happen in the document
$(document).on(‘click’, function(event) {
// If the menu is open and you click away from it
if (!$(event.target).closest(‘#cb-mob-menu, #cb-top-menu’).length) {
// Hide the menus.
$(‘body’).removeClass(‘cb-mob-op’);
}
});
var urlHolder = window.location.href;
$(“li a[href=”” + urlHolder + “”]”).addClass(‘current’).parentsUntil(‘ul.cb-main-nav’).slice(3).find(“>a”).addClass(‘current’);
if($(‘.featured-image-caption’).length > 0) {
($(‘.featured-image-caption’)[0].innerText == “”) ? $(‘.featured-image-caption’).css(“display”,”none”) : “”;
console.log($(‘.featured-image-caption’));
}
})(jQuery);