var listUrl = "/bbs/board.do";
var viewUrl = "/bbs/boardView.do";
$(function() {
try {
$(window).hashchange(function() {
try {
var hash = location.hash;
var page_num = hash.replace( /^#/, '' );
if(isNaN(parseInt(page_num))==false)
{
goPage(page_num);
}
else if(page_num=='null')
{
// do nothing
}
else
{
document.location.hash = "#1";
}
} catch(e) {}
});
$(window).hashchange();
} catch(e) {}
});
function showPagingBasic(page, pageInfo)
{
var paging = [];
var pageSize = parseInt(pageInfo.pageSize);
var listSize = parseInt(pageInfo.recordCountPerPage);
var totalCnt = parseInt(pageInfo.totalRecordCount);
var firstPage = 1, prevPage;
var lastPage, nextPage;
if (page == "")
page = 1;
else
page = parseInt(page);
var tmpPage = Math.floor((page-1) / pageSize) * pageSize + 1;
var totalPage = Math.floor((totalCnt-1) / listSize) + 1;
if (tmpPage < 0) return;
if (page > 1) {
prevPage = page - 1;
//paging.push('맨처음');
//paging.push('맨처음');
//paging.push('이전페이지');
//paging.push('이전페이지');
paging.push('
'
+ '<<'
+ '');
paging.push(''
+ '<'
+ '');
}
//paging.push('');
for(var idx=1; idx <= pageSize; idx++) {
if (tmpPage > totalPage) break;
if (page === tmpPage) {
paging.push('
' + tmpPage + '');
} else {
paging.push('
' + tmpPage + '');
}
tmpPage++;
}
//paging.push('
');
if (page < totalPage) {
nextPage = page + 1;
lastPage = totalPage;
//paging.push('다음페이지');
//paging.push('다음페이지');
//paging.push('마지막');
//paging.push('마지막');
paging.push(''
+ '>'
+ '');
paging.push(''
+ '>>'
+ '');
}
$("#total_cnt").html(totalCnt);
$("#total_page").html(totalPage);
//$(".paging").html(paging.join(''));
$('.pagination').html(paging.join('\n'));
}
function showPaging(page, pageInfo)
{
var paging = [];
var pageSize = parseInt(pageInfo.pageSize);
var listSize = parseInt(pageInfo.recordCountPerPage);
var totalCnt = parseInt(pageInfo.totalRecordCount);
var firstPage = 1, prevPage;
var lastPage, nextPage;
if (page == "")
page = 1;
else
page = parseInt(page);
var tmpPage = Math.floor((page-1) / pageSize) * pageSize + 1;
var totalPage = Math.floor((totalCnt-1) / listSize) + 1;
if (tmpPage < 0) return;
if (page > 1) {
prevPage = page - 1;
//paging.push('맨처음');
//paging.push('맨처음');
//paging.push('이전페이지');
//paging.push('이전페이지');
paging.push(''
+ '<<'
+ '');
paging.push(''
+ '<'
+ '');
}
//paging.push('');
for(var idx=1; idx <= pageSize; idx++) {
if (tmpPage > totalPage) break;
if (page === tmpPage) {
//paging.push('
' + tmpPage + '');
paging.push('
' + tmpPage + '');
} else {
//paging.push('
' + tmpPage + '');
paging.push('
' + tmpPage + '');
}
tmpPage++;
}
//paging.push('
');
if (page < totalPage) {
nextPage = page + 1;
lastPage = totalPage;
//paging.push('다음페이지');
//paging.push('다음페이지');
//paging.push('마지막');
//paging.push('마지막');
paging.push(''
+ '>'
+ '');
paging.push(''
+ '>>'
+ '');
}
$("#total_cnt").html(totalCnt);
$("#total_page").html(totalPage);
//$(".paging").html(paging.join(''));
$('.pagination').html(paging.join('\n'));
}
function showPaging_eng(page, pageInfo)
{
var paging = [];
var pageSize = parseInt(pageInfo.pageSize);
var listSize = parseInt(pageInfo.recordCountPerPage);
var totalCnt = parseInt(pageInfo.totalRecordCount);
var firstPage = 1, prevPage;
var lastPage, nextPage;
if (page == "")
page = 1;
else
page = parseInt(page);
var tmpPage = Math.floor((page-1) / pageSize) * pageSize + 1;
var totalPage = Math.floor((totalCnt-1) / listSize) + 1;
if (tmpPage < 0) return;
if (page > 1) {
prevPage = page - 1;
//paging.push('First');
paging.push('First');
//paging.push('Prev');
paging.push('Prev');
}
paging.push('');
for(var idx=1; idx <= pageSize; idx++) {
if (tmpPage > totalPage) break;
if (page === tmpPage) {
paging.push('
' + tmpPage + '');
} else {
//paging.push('
' + tmpPage + '');
paging.push('
' + tmpPage + '');
}
tmpPage++;
}
paging.push('
');
if (page < totalPage) {
nextPage = page + 1;
lastPage = totalPage;
//paging.push('Next');
paging.push('Next');
//paging.push('Last');
paging.push('Last');
}
$("#total_cnt").html(totalCnt + " (" + page + "/" + totalPage + "page)");
$(".paging").html(paging.join(''));
}
function showPagingKolop(page, pageInfo)
{
var paging = [];
var pageSize = parseInt(pageInfo.pageSize);
var listSize = parseInt(pageInfo.recordCountPerPage);
var totalCnt = parseInt(pageInfo.totalRecordCount);
var firstPage = 1, prevPage;
var lastPage, nextPage;
if (page == "")
page = 1;
else
page = parseInt(page);
var tmpPage = Math.floor((page-1) / pageSize) * pageSize + 1;
var totalPage = Math.floor((totalCnt-1) / listSize) + 1;
if (tmpPage < 0) return;
if (page > 1) {
prevPage = page - 1;
paging.push('
');
paging.push('
');
}
for(var idx=1; idx <= pageSize; idx++) {
if (tmpPage > totalPage) break;
if (page === tmpPage) {
paging.push('' + tmpPage + '');
} else {
paging.push('' + tmpPage + '');
}
tmpPage++;
}
//paging.push('');
if (page < totalPage) {
nextPage = page + 1;
lastPage = totalPage;
paging.push('
');
paging.push('
');
}
$("#total_cnt").html(totalCnt);
$("#total_page").html(totalPage);
$('#page_div').html(paging.join('\n'));
}
function showMorePaging(page, pageInfo)
{
var paging = [];
var pageSize = parseInt(pageInfo.pageSize);
var listSize = parseInt(pageInfo.recordCountPerPage);
var totalCnt = parseInt(pageInfo.totalRecordCount);
var firstPage = 1, prevPage;
var lastPage, nextPage;
if (page == "")
page = 1;
else
page = parseInt(page);
var tmpPage = Math.floor((page-1) / pageSize) * pageSize + 1;
var totalPage = Math.floor((totalCnt-1) / listSize) + 1;
if (page < totalPage) {
nextPage = page + 1;
lastPage = totalPage;
paging.push('더보기 ');
}
$("#total_cnt").html(totalCnt);
$("#total_page").html(totalPage);
$('#pagination').html(paging.join('\n'));
}
function fnChoiceDel(){
var f = document.form;
var cnt = 0;
$('input:checkbox[name=check_yn]:checked').each(function() {
cnt++;
});
if (cnt == 0) {
alert("삭제할 데이터를 선택하세요!");
return;
}
var delYn = confirm("삭제하시겠습니까?");
if(delYn == false){
return;
}
f.action = "/bbs/choiceBoardDelProc.do?menuId=" + $('#menuId').val();
f.target = "_self";
f.submit();
}
function fnChoiceRestore(){
var f = document.form;
var cnt = 0;
$('input:checkbox[name=check_yn]:checked').each(function() {
cnt++;
});
if (cnt == 0) {
alert("복제할 데이터를 선택하세요!");
return;
}
var delYn = confirm("복원하시겠습니까?");
if(delYn == false){
return;
}
f.action = "/bbs/choiceBoardRestoreProc.do";
f.target = "_self";
f.submit();
}
function fnChoiceCopy(){
var f = document.form;
var cnt = 0;
$('input:checkbox[name=check_yn]:checked').each(function() {
cnt++;
});
if (cnt == 0) {
alert("복제할 데이터를 선택하세요!");
return;
}
f.action = "/bbs/moveContCopyForm.do";
f.target = "_self";
f.submit();
}
function fnChoiceMove(){
var f = document.form;
var cnt = 0;
$('input:checkbox[name=check_yn]:checked').each(function() {
cnt++;
});
if (cnt == 0) {
alert("복제할 데이터를 선택하세요!");
return;
}
f.action = "/bbs/moveContMoveForm.do";
f.target = "_self";
f.submit();
}
function changeCategory(bcIdx, pageNum, obj){
var page = 1;
$("#bc").val(bcIdx);
$(".category").removeClass("total");
$(".category").removeClass("on");
$(".category").removeClass("active");
if (bcIdx == 0) {
$("#cate_"+bcIdx).addClass("total");
} else {
$("#cate_"+bcIdx).addClass("on");
}
$("#cate_"+bcIdx).addClass("active");
if (pageNum !== undefined && pageNum != null)
page = pageNum;
if (obj !== undefined)
$("#categoryTitle").html( $(obj).html() );
goPage(page);
}