';
postli += '
';
postli += '
';
postli += '
'+item.post_date+'
';
postli += '
';
postli += '
'+item.title+'
'+item.tagline+'
';
postli += '
'+item.author_position+'ã'+item.author_name+'
';
postli += ' ';
postli += '';
listul.append($(postli));
}
}
} else {
totalpage = 1;
}
if (current < totalpage) {
$('#morebtn').show();
}
})
.fail(function(XMLHttpRequest, textStatus, errorThrown){
console.log(textStatus);
});
};
get_article_list();
$('a.media-article-tab-item_link').click(function(e){
e.preventDefault();
var _this = $(this);
$("input[name='mediacategory']").removeAttr('checked').prop("checked", false).change();
$("input[name='college']").removeAttr('checked').prop("checked", false).change();
$("input[name='institution']").removeAttr('checked').prop("checked", false).change();
$("input[value='"+_this.data('slug')+"']").attr('checked', true).prop('checked', true).change();
$('a.media-article-tab-item_link').removeClass('media-article-tab-item_link--active');
$('h3.media-article-heading_label').html(_this.data('name'));
_this.addClass('media-article-tab-item_link--active');
selectslug = [];
if (_this.data('slug') != '') {
selectslug = [_this.data('slug')];
}
selectcollege = [];
selectinstitution = [];
current = 1;
get_article_list();
});
$('#morebtn').click(function(){
if (current < totalpage) {
current++;
get_article_list();
}
})
$('form#mediasearch').submit(function() {
$('a.media-article-tab-item_link').removeClass('media-article-tab-item_link--active');
selectslug = [];
$("input[name='mediacategory']:checked").each(function(){
selectslug.push($(this).val());
});
selectcollege = [];
$("input[name='college']:checked").each(function(){
selectcollege.push($(this).val());
});
selectinstitution = [];
$("input[name='institution']:checked").each(function(){
selectinstitution.push($(this).val());
});
if (selectslug.length == 1 && selectcollege.length == 0 && selectinstitution.length == 0) {
$("a.media-article-tab-item_link[data-slug='"+selectslug[0]+"']").addClass('media-article-tab-item_link--active');
$('h3.media-article-heading_label').html($("input[name='mediacategory']:checked").eq(0).parent().find('span').text());
} else if (selectslug.length == 0 && selectcollege.length == 0 && selectinstitution.length == 0) {
$("a.media-article-tab-item_link[data-slug='']").addClass('media-article-tab-item_link--active');
$('h3.media-article-heading_label').html('å
¨ã¦');
} else {
$('h3.media-article-heading_label').html('');
}
current = 1;
get_article_list();
$('.modal-close').click();
return false;
});