$(document).ready(function() {
$("body").fadeIn(2000);
$("a.transition").click(function(event){
event.preventDefault();
linkLocation = this.href;
$("body").fadeOut(1000, redirectPage);
});
function redirectPage() {
window.location = linkLocation;
}});
$(document).ready(function() {
var key = new Array();
key['a'] = "/manage";
function getKey(keyStroke) {
if ((event.srcElement.tagName != 'INPUT') && (event.srcElement.tagName != 'TEXTAREA')){
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
for (var i in key)
if (which == i) window.location = key[i];
}}
document.onkeypress = getKey;
$('.thumb:not(:has(img))').append(noimg);
$('.fileblock').attr('class','file_d');
$( '.imageblock:has(a)').contents().unwrap().wrap( '
');
$('.category img[alt="N"]').replaceWith('');
$('.sub_category_list').prev().addClass('subb');
$('.link_item.subb').each(function(){
var link_i = $(this).text().trim();
$(this).wrap('').after('
');
});
setInterval(function () {
$('.commentList .rp .name, .guestList .rp .name').each(function(){
var name = $(this).parents('.rep').find('.name').html();
if(name == $(this).html()) {
$(this).remove();
}else{
$(this).nextAll('.ny, .datee').css({'padding-left':'3px'});
}
});
$('.date a').html('');
$('.date a').each(function(){
$(this).parent().next('.control').prepend($(this));
});
$('.guestList .date, .commentList .date').each(function() {
var date = $(this).text();
var d = date.split(/[.| |:]/);
var m = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var year = Number(d[0]);
var month = Number(d[1]-1);
var day = Number(d[2]);
$(this).html(m[month]+" "+day+", "+year);
$(this).attr('class','datee');
});
$('.guest_admin .name:not(:has(a)), .rp_admin .name:not(:has(a))').append(a_name);
$('.hiddenComment .name:empty').html(g_name);
$('.ny:contains("비밀댓글입니다")').html(g_ny);
$('.ny:contains("[비밀댓글]")').each(function() {
var ny_t = $(this).html();
$(this).html(ny_t.replace('[비밀댓글]', ''));
});
}, 300);
$('.list_sum').each(function(){
var sum = $(this).text().trim();
var pl = /(?:https\:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v\=)?(?:[a-zA-Z0-9_-]+\&)?/gi;
var y_url = sum.replace(pl, "");
if(sum.indexOf('youtu') >= 0) {
$(this).html('');
}
if(sum.indexOf('list') >= 0) {
$(this).html('');
}
if(sum.indexOf('soundcloud') >= 0) {
$(this).html('');
}
});
$('.admin_b').click(function(){
$('.admin_bb').toggle();
});
$('.sub_b').click(function(){
$(this).parent().next('.sub_category_list').slideToggle();
if($(this).children().hasClass("xi-plus-min")){
$(this).children().attr("class", "xi-minus-min");
$(this).prev().css({'border-left':'3px solid'+cate_border});
}else{
$(this).children().attr("class", "xi-plus-min xi-flip-vertical");
$(this).prev().css({'border-left':'0px solid'});
}
});
if ($('.admin').length <= 0) {
$('.titleWrap .action-t .actionTrail').css({'width':'100%'});
}
if ($('.guestWrite').length <= 0) {
$('.guestList').css({'border-top':'none'});
}
if ($('#s_cover').length > 0) {
$('.top').css({'display':'none'});
}
$('.category a, .cate-w .menu a').filter(function(){
return window.location.pathname.includes($(this).attr('href'));
}).addClass('sl-cate');
$('.category a').filter(function(){
return $('#tt-body-page .entry .cate').text().trim().includes($(this).attr('href'));
}).addClass('sl-cate');
if(document.body.id == 'tt-body-page' || document.body.id == 'tt-body-guestbook' || document.body.id == 'tt-body-category' || document.body.id == 'tt-body-page' || document.body.id == 'tt-body-tag' || document.body.id == 'tt-body-location' || document.body.id == 'tt-body-archive') {
$('.h-icon').removeClass('sl-cate');
}
var mq = window.matchMedia("(max-width: 600px)");
if(mq.matches){
$('#sidebar .cate-menu').after($('.search'));
$('.blog-t').click(function(){
$('.cate-w').slideToggle();
});
$('.search button').remove();
$('#sidebar .profile .p-img img').wrap('');
}
});