/*********************************************************************************************************
* date : 2024-08-30
* author : JooPilGue(joofeel00@naver.com)
*********************************************************************************************************/
// Æ÷Åä°¶·¯¸® ÃßÃâ Ä¿½ºÅ͸¶ÀÌ¡
$(function() {
var tmpno = $(location).attr('pathname').split('/')[1];
var dir = $(".section2 .listWrapper").data('dir');
var page = $(".section2 .listWrapper").data('page');
var elem;
var photoAll = $(".section2 .listWrapper .tableArea").html();
var subject = new Array(); // °¶·¯¸® ½æ³×ÀÏ Á¦¸ñ ¹è¿º¯¼ö ¼±¾ð
var content = new Array(); // °¶·¯¸® ½æ³×ÀÏ ³»¿ë ¹è¿º¯¼ö ¼±¾ð
var url = new Array(); // °¢ ½æ³×ÀϺ° ¸µÅ© ÀúÀå¿ë º¯¼ö
var thumbCount; // ½æ³×ÀÏ °³¼ö (ÃßÃâ°³¼ö)
var refHeight; // ³ôÀÌ µ¿±âȸ¦ À§ÇÑ º¯¼ö
// Æ÷Åä°¶·¯¸® Ä«Å×°í¸® °¡Á®¿À±â
function getCategory() {
if($(".section2 .tableArea li").length > 0) {
$("#cate-load").attr('src', tmpno + dir + page);
$("#cate-load").load(function() {
var title = [],
cate_no = [],
cateHTML;
$(".section2 .category").remove();
cateHTML = '
';
$("#cate-load").contents().find('.board_tab li').each(function(i) {
title[i] = $(this).text();
cate_no[i] = $(this).text();
/*cate_no[i] = $(this).val();*/
cateHTML += '- ' + title[i] + '
';
i++;
});
cateHTML += '
';
$(".section2 .dropdown").append(cateHTML);
$(".section2 .dropdown .category > li:first").addClass('on');
if($(".section2 .tableArea li").length > 0) {
/*$(".category > li:first > a").remove(cate_no[i]);*/
$(".category").find('li:first').html('Àüü');
};
$("#cate-load").remove();
});
/*$(function(){
$(".category > li:first > a").addClass("test");
});*/
/*
$("#cate-load").load('/' + tmpno + '/' + dir + '/' + page + '.php' + ' .cate_select select', function() {
var title = [],
cate_no = [],
cateHTML;
$(".section2 .category").remove();
cateHTML = '';
$("#cate-load").find('option').each(function(i) {
title[i] = $(this).text();
cate_no[i] = $(this).val();
cateHTML += '- ' + title[i] + '
';
i++;
});
cateHTML += '
';
$(".section2 .dropdown").append(cateHTML);
$(".section2 .dropdown .category > li:first").addClass('on');
});
*/
/*
$.ajax({
type: 'GET',
url: '/' + tmpno + '/' + dir + '/' + page + '.php',
contentType: 'application/x-www-form-urlencoded;charset=euc-kr',
beforeSend: function(x) {
x.overrideMimeType('application/x-www-form-urlencoded;charset=euc-kr');
},
success: function(data) {
var title = [],
cate_no = [],
cateHTML;
$(".section2 .category").remove();
cateHTML = '';
$(data).find('.cate_select option').each(function(i) {
title[i] = $(this).text();
cate_no[i] = $(this).val();
cateHTML += '- ' + title[i] + '
';
i++;
});
cateHTML += '
';
$(".section2 .dropdown").append(cateHTML);
$(".section2 .dropdown .category > li:first").addClass('on');
},
error:function(xhr,status,error) {
console.log(error);
}
});
*/
}
}
getCategory();
// Ä«Å×°í¸®º° Æ÷½ºÆÃ ÃßÃâ ÇÔ¼ö
function getPhotoPost(cate) {
var loadURL;
// var maxCount = 4; // Ä«Å×°í¸®º°·Î °¡Á®¿Ã ÃÖ´ë Æ÷½ºÆÃ °³¼ö
if(cate === null) {
loadURL = tmpno + dir + page;
} else {
loadURL = tmpno + dir + page + '?&sca=' + cate;
}
$.ajax({
type: 'GET',
url: loadURL,
contentType: '',
beforeSend: function(x) {
x.overrideMimeType('');
},
success: function(data) {
var temp = $(data).find('.portfolio-list').html();
$(".section2 .listWrapper .tableArea").html(temp);
// $(".section2 .listWrapper .tableArea > table").each(function() {
// if($(this).index() > maxCount -1) $(this).remove();
// });
galleryAlign();
elem = $(".section2 .listWrapper .tableArea li");
elem.css('opacity','0');
elem.animate({'opacity':'1'}, 400, function() {
elem.css({'opacity':''});
});
},
error:function(xhr,status,error) {
console.log(error);
}
})
}
// Ä«Å×°í¸®º° Æ÷½ºÆÃ ÃßÃâ
$(document).on('click', '.section2 .category > li' ,function() {
var $cate = $(this).find('a').data('cate');
var $activeText = $(this).find('a').text();
// var maxCount = 4; // Ä«Å×°í¸®º°·Î °¡Á®¿Ã ÃÖ´ë Æ÷½ºÆÃ °³¼ö
$(".section2 .category > li").removeClass('on');
$(this).addClass('on');
if(!$cate) {
$(".section2 .listWrapper .tableArea").css('opacity','0');
$(".section2 .listWrapper .tableArea").html(photoAll);
// $(".section2 .listWrapper .tableArea > table").each(function() {
// if($(this).index() > maxCount) $(this).remove();
// });
$(".section2 .listWrapper .tableArea").animate({'opacity':'1'}, 400, function() {
$(".section2 .listWrapper .tableArea").css({'opacity':''});
});
galleryInit();
} else {
getPhotoPost($cate);
}
$(".section2 .dropdown > a").text($activeText);
});
// ÃÖ±Ù °¶·¯¸® µå·Ó´Ù¿î À̺¥Æ®
$(".section2 .dropdown").click(function() {
if(!$(this).hasClass('open')) {
$(this).addClass('open');
$(this).find('.category').css('display','block');
} else {
$(this).removeClass('open');
$(this).find('.category').css('display','none');
}
});
// °¶·¯¸® Ãʱ⼼ÆÃ
function galleryInit() {
elem = $(".section2 .listWrapper .tableArea li");
if(elem.length > 0) {
thumbCount = elem.length;
if($(".hoverBox").length > 0) {
$(".hoverBox").parent('a').remove();
}
for(i=0; i' + subject[i] + '
' + $.trim(content[i]) + '
');
//$(".section2 .listWrapper .tableArea li").eq(i).find('tr').eq(1).css('display','none');
}
}
}
// Ä«Å×°í¸® Ŭ¸¯ ÈÄ ±¸Á¶ ÀçÁ¤·Ä
function galleryAlign() {
if($(".bbsnewf5").length > 0) {
thumbCount = $(".section2 .listWrapper .tableArea .bbsnewf5").length;
if($(".hoverBox").length > 0) {
$(".hoverBox").parent('a').remove();
}
for(i=0; i' + subject[i] + '
' + $.trim(content[i]) + '
');
}
// ±âÁ¸¿¡ º¸¿©Áö´Â º°µµ td ÀÇ Á¦¸ñ, ³»¿ëÀº ¼û±è
$(".infoArea").css('display','none');
}
}
// Å×ÀÌºí ¾Ö´Ï¸ÞÀ̼Ç
function tableShow() {
if($(".section2 .listWrapper").length > 0) {
$(".section2 .listWrapper .tableArea li").each(function() {
$(this).addClass('scrollreveal');
});
}
}
galleryInit();
$(".section2 .listWrapper .tableArea li").addClass('scrollreveal');
});
// °øÁö»çÇ× ÃßÃâ ±¸Á¶ º¯°æ
$(function() {
var tmpno = $(location).attr('pathname').split('/')[1];
var $subject = [],
$link = [],
$date = [],
$img = [],
$content = [];
var $innerHTML = "";
var $wrapper = $(".section4 .postWrapper");
var dir = $(".section4 .postWrapper").data('dir');
var page = $(".section4 .postWrapper").data('page');
var cnt = 0;
//$(".section4 tr[class^=board_output_]").each(function() {
$(".section4 li").each(function() {
$subject[cnt] = $(this).find('a:first').text();
$link[cnt] = $(this).find('a').attr('href');
$date[cnt] = $(this).find('span').text();
//$content[cnt] = $(this).children().eq(-2).find('a').text();
$content[cnt] = $(this).find('div.list_content').text();
$img[cnt] = $(this).find('.board_output_imgs').attr('src');
cnt++;
});
$wrapper.html('');
$innerHTML = '';
$wrapper.append($innerHTML);
});