$( document ).ready(function() {
var grid = $('.news-list.isotope');
var excerpts = $('.card .content p');
excerpts.each(function( index ) {
if($( this ).text() == '' ) {
$( this ).parent().remove();
}
});
grid.imagesLoaded( function() {
setTimeout(function(){
grid.isotope({
// options
itemSelector: '.list-item',
layoutMode: 'masonry',
});
}, 100);
});
var facebookUrl = $('.hfacebook').attr('href');
$('.hfacebook').remove();
// $("#header-facebook").attr('href', facebookUrl);
if(facebookUrl) {
$('.socials .list-group').append('');
}
var twitterUrl = $('.htwitter').attr('href');
$('.htwitter').remove();
// $("#header-twitter").attr('href', twitterUrl);
if(twitterUrl) {
$('.socials .list-group').append('');
}
$('.footer.footer').hide();
var footerMenuLinks = $('footer.footer a');
footerMenuLinks.each(function(i, obj) {
var menuLink = $(this).attr('href');
var menuText= $(this).text();
var output = '
' + menuText + '';
$('footer ul.nav.navbar-nav').append(output);
});
var copyright = $('footer.footer .sitecopy').html();
$('footer .copyright').html(copyright);
// Category
var grid2 = $('.news-list.isotope-type-2');
grid2.imagesLoaded( function() {
setTimeout(function(){
grid2.isotope({
itemSelector: '.list-item',
layoutMode: 'masonry',
}); }, 100);
});
/* imagesLoaded(grid2, function(){
console.log(".news-list.isotope-type-2");
grid2.isotope({
itemSelector: '.list-item-type-2',
layoutMode: 'masonry',
});
}); */
// Category Links
//$('.category').html($('.category').html().replace(/,/g,""));
$(".category a[href^='/c/auto-created']").remove();
$(".category a[href^='/c/home/']").remove();
var catlinkswrapper = $(".card-top-meta .category, .card-body .category");
catlinkswrapper.each(function(i, obj) {
$(this).html($(this).html().replace(/,/g,""));
});
var catlinks = $(".card-top-meta .category a:not(:last-child), .card-body .category a:not(:last-child)");
catlinks.each(function(i, obj) {
$(this).html($(this).html() + ', ');
});
});
function formatDate(item) {
var date = item.text();
dateNew = Date.parse(date);
var date = new Date(dateNew);
var year = date.getFullYear();
var month = date.getMonth();
var day = date.getDay();
if(day<10) {
day = '0' + day;
}
if(month<10) {
month = '0' + month;
}
return month + '/' + day + '/' + year;
}