'); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function printPage1() { // 1. 캡처 대상 유효성 검사 const targetElement = document.getElementById('ct1'); if (!targetElement) { console.error("오류: ID가 'ct'인 요소를 찾을 수 없습니다."); alert("인쇄할 영역(ID: ct)을 찾을 수 없습니다."); return; } // 2. 캡처 직전에 숨겨야 할 요소들을 선택하고 숨깁니다. const $elementsToHide = $('.lnb-wrap, .search-filter-box'); $elementsToHide.hide(); // 3. 캡처 시 짤림 방지를 위해 현재 스크롤 위치 저장 및 맨 위로 이동 const originalScroll = $(window).scrollTop(); $(window).scrollTop(0); // 4. html2canvas 함수 호출 html2canvas(targetElement, { scale: 2, // 해상도 2배 useCORS: true, // 외부 이미지 허용 allowTaint: true, scrollY: 0 // 스크롤 이슈 방지 }).then(function(canvas) { // 5. 캡처 완료 후 UI 복원 $elementsToHide.show(); $(window).scrollTop(originalScroll); const imgData = canvas.toDataURL('/kpaa/membevent/membeventNoticeList.do/image/png'); // 6. 인쇄 창 설정 const printWindow = window.open('', '_blank'); // [수정 1] 제목 변경: '인쇄 미리보기' -> '문서 출력' (원하는 텍스트로 수정 가능) // document.title을 넣으면 현재 웹페이지의 제목이 들어갑니다. printWindow.document.write('대한 변리사회'); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(' '); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function fn_toggleFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); // 클래스 토글 및 슬라이드 애니메이션 $header.toggleClass('active'); $body.stop().slideToggle(300); } function fn_openFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); if (!$header.hasClass('active')) { $header.addClass('active'); $body.stop().slideDown(300); } } function fn_adjustLayout() { // 1. 분류(체크박스)가 있는 항목에만 특별한 클래스(.item-auto) 부여 // -> CSS에서 이 클래스가 있으면 width를 고정하지 않고 내용물 크기만큼 잡음 $('.new-sf-check-group').each(function() { $(this).closest('.new-sf-item').addClass('item-auto'); }); // 2. 버튼 영역 초기화 (혹시 남아있을 스타일 제거) $('.new-sf-btn-area').css('grid-column', ''); } // 윈도우 리사이즈 시에도 그냥 호출만 하면 됨 (사실 CSS라 호출 안 해도 됨) function fn_initFilterLayout() { fn_adjustLayout(); // Flexbox는 반응형이 자동이라 리사이즈 이벤트 바인딩도 굳이 필요 없지만 유지. $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function fn_initFilterLayout() { fn_adjustLayout(); $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function checkMaxLength(obj, max) { if (obj.value.length > max) { // 사용자에게 알림 (선택 사항) // alert(max + "자까지만 입력 가능합니다."); // 최대 글자 수만큼만 남기고 자르기 obj.value = obj.value.substring(0, max); } }

프라그마틱 슬롯사이트

접근성

로그인

프라그마틱 슬롯사이트

알림마당

참여마당

정보마당

공익활동 · 감정

교육·연수

해외 슬롯사이트사 등록업무

회원 전용

icon전체메뉴

'); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function printPage1() { // 1. 캡처 대상 유효성 검사 const targetElement = document.getElementById('ct1'); if (!targetElement) { console.error("오류: ID가 'ct'인 요소를 찾을 수 없습니다."); alert("인쇄할 영역(ID: ct)을 찾을 수 없습니다."); return; } // 2. 캡처 직전에 숨겨야 할 요소들을 선택하고 숨깁니다. const $elementsToHide = $('.lnb-wrap, .search-filter-box'); $elementsToHide.hide(); // 3. 캡처 시 짤림 방지를 위해 현재 스크롤 위치 저장 및 맨 위로 이동 const originalScroll = $(window).scrollTop(); $(window).scrollTop(0); // 4. html2canvas 함수 호출 html2canvas(targetElement, { scale: 2, // 해상도 2배 useCORS: true, // 외부 이미지 허용 allowTaint: true, scrollY: 0 // 스크롤 이슈 방지 }).then(function(canvas) { // 5. 캡처 완료 후 UI 복원 $elementsToHide.show(); $(window).scrollTop(originalScroll); const imgData = canvas.toDataURL('/kpaa/membevent/membeventNoticeList.do/image/png'); // 6. 인쇄 창 설정 const printWindow = window.open('', '_blank'); // [수정 1] 제목 변경: '인쇄 미리보기' -> '문서 출력' (원하는 텍스트로 수정 가능) // document.title을 넣으면 현재 웹페이지의 제목이 들어갑니다. printWindow.document.write('대한 변리사회'); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(' '); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function fn_toggleFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); // 클래스 토글 및 슬라이드 애니메이션 $header.toggleClass('active'); $body.stop().slideToggle(300); } function fn_openFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); if (!$header.hasClass('active')) { $header.addClass('active'); $body.stop().slideDown(300); } } function fn_adjustLayout() { // 1. 분류(체크박스)가 있는 항목에만 특별한 클래스(.item-auto) 부여 // -> CSS에서 이 클래스가 있으면 width를 고정하지 않고 내용물 크기만큼 잡음 $('.new-sf-check-group').each(function() { $(this).closest('.new-sf-item').addClass('item-auto'); }); // 2. 버튼 영역 초기화 (혹시 남아있을 스타일 제거) $('.new-sf-btn-area').css('grid-column', ''); } // 윈도우 리사이즈 시에도 그냥 호출만 하면 됨 (사실 CSS라 호출 안 해도 됨) function fn_initFilterLayout() { fn_adjustLayout(); // Flexbox는 반응형이 자동이라 리사이즈 이벤트 바인딩도 굳이 필요 없지만 유지. $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function fn_initFilterLayout() { fn_adjustLayout(); $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function checkMaxLength(obj, max) { if (obj.value.length > max) { // 사용자에게 알림 (선택 사항) // alert(max + "자까지만 입력 가능합니다."); // 최대 글자 수만큼만 남기고 자르기 obj.value = obj.value.substring(0, max); } }
'); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function printPage1() { // 1. 캡처 대상 유효성 검사 const targetElement = document.getElementById('ct1'); if (!targetElement) { console.error("오류: ID가 'ct'인 요소를 찾을 수 없습니다."); alert("인쇄할 영역(ID: ct)을 찾을 수 없습니다."); return; } // 2. 캡처 직전에 숨겨야 할 요소들을 선택하고 숨깁니다. const $elementsToHide = $('.lnb-wrap, .search-filter-box'); $elementsToHide.hide(); // 3. 캡처 시 짤림 방지를 위해 현재 스크롤 위치 저장 및 맨 위로 이동 const originalScroll = $(window).scrollTop(); $(window).scrollTop(0); // 4. html2canvas 함수 호출 html2canvas(targetElement, { scale: 2, // 해상도 2배 useCORS: true, // 외부 이미지 허용 allowTaint: true, scrollY: 0 // 스크롤 이슈 방지 }).then(function(canvas) { // 5. 캡처 완료 후 UI 복원 $elementsToHide.show(); $(window).scrollTop(originalScroll); const imgData = canvas.toDataURL('/kpaa/membevent/membeventNoticeList.do/image/png'); // 6. 인쇄 창 설정 const printWindow = window.open('', '_blank'); // [수정 1] 제목 변경: '인쇄 미리보기' -> '문서 출력' (원하는 텍스트로 수정 가능) // document.title을 넣으면 현재 웹페이지의 제목이 들어갑니다. printWindow.document.write('대한 변리사회'); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(' '); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function fn_toggleFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); // 클래스 토글 및 슬라이드 애니메이션 $header.toggleClass('active'); $body.stop().slideToggle(300); } function fn_openFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); if (!$header.hasClass('active')) { $header.addClass('active'); $body.stop().slideDown(300); } } function fn_adjustLayout() { // 1. 분류(체크박스)가 있는 항목에만 특별한 클래스(.item-auto) 부여 // -> CSS에서 이 클래스가 있으면 width를 고정하지 않고 내용물 크기만큼 잡음 $('.new-sf-check-group').each(function() { $(this).closest('.new-sf-item').addClass('item-auto'); }); // 2. 버튼 영역 초기화 (혹시 남아있을 스타일 제거) $('.new-sf-btn-area').css('grid-column', ''); } // 윈도우 리사이즈 시에도 그냥 호출만 하면 됨 (사실 CSS라 호출 안 해도 됨) function fn_initFilterLayout() { fn_adjustLayout(); // Flexbox는 반응형이 자동이라 리사이즈 이벤트 바인딩도 굳이 필요 없지만 유지. $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function fn_initFilterLayout() { fn_adjustLayout(); $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function checkMaxLength(obj, max) { if (obj.value.length > max) { // 사용자에게 알림 (선택 사항) // alert(max + "자까지만 입력 가능합니다."); // 최대 글자 수만큼만 남기고 자르기 obj.value = obj.value.substring(0, max); } }

프라그마틱 슬롯사이트

알림마당

참여마당

정보마당

공익활동 · 감정

교육·연수

해외 슬롯사이트사 등록업무

회원 전용

경조사 공지.

검색 필터

구분
제목
신청자
사무소명
번호 제목 신청 대상
회원명
사무소 신청일시 조회수
경조사 공지는 회원 로그인 후 확인 가능합니다.
'); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function printPage1() { // 1. 캡처 대상 유효성 검사 const targetElement = document.getElementById('ct1'); if (!targetElement) { console.error("오류: ID가 'ct'인 요소를 찾을 수 없습니다."); alert("인쇄할 영역(ID: ct)을 찾을 수 없습니다."); return; } // 2. 캡처 직전에 숨겨야 할 요소들을 선택하고 숨깁니다. const $elementsToHide = $('.lnb-wrap, .search-filter-box'); $elementsToHide.hide(); // 3. 캡처 시 짤림 방지를 위해 현재 스크롤 위치 저장 및 맨 위로 이동 const originalScroll = $(window).scrollTop(); $(window).scrollTop(0); // 4. html2canvas 함수 호출 html2canvas(targetElement, { scale: 2, // 해상도 2배 useCORS: true, // 외부 이미지 허용 allowTaint: true, scrollY: 0 // 스크롤 이슈 방지 }).then(function(canvas) { // 5. 캡처 완료 후 UI 복원 $elementsToHide.show(); $(window).scrollTop(originalScroll); const imgData = canvas.toDataURL('/kpaa/membevent/membeventNoticeList.do/image/png'); // 6. 인쇄 창 설정 const printWindow = window.open('', '_blank'); // [수정 1] 제목 변경: '인쇄 미리보기' -> '문서 출력' (원하는 텍스트로 수정 가능) // document.title을 넣으면 현재 웹페이지의 제목이 들어갑니다. printWindow.document.write('대한 변리사회'); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(' '); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function fn_toggleFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); // 클래스 토글 및 슬라이드 애니메이션 $header.toggleClass('active'); $body.stop().slideToggle(300); } function fn_openFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); if (!$header.hasClass('active')) { $header.addClass('active'); $body.stop().slideDown(300); } } function fn_adjustLayout() { // 1. 분류(체크박스)가 있는 항목에만 특별한 클래스(.item-auto) 부여 // -> CSS에서 이 클래스가 있으면 width를 고정하지 않고 내용물 크기만큼 잡음 $('.new-sf-check-group').each(function() { $(this).closest('.new-sf-item').addClass('item-auto'); }); // 2. 버튼 영역 초기화 (혹시 남아있을 스타일 제거) $('.new-sf-btn-area').css('grid-column', ''); } // 윈도우 리사이즈 시에도 그냥 호출만 하면 됨 (사실 CSS라 호출 안 해도 됨) function fn_initFilterLayout() { fn_adjustLayout(); // Flexbox는 반응형이 자동이라 리사이즈 이벤트 바인딩도 굳이 필요 없지만 유지. $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function fn_initFilterLayout() { fn_adjustLayout(); $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function checkMaxLength(obj, max) { if (obj.value.length > max) { // 사용자에게 알림 (선택 사항) // alert(max + "자까지만 입력 가능합니다."); // 최대 글자 수만큼만 남기고 자르기 obj.value = obj.value.substring(0, max); } } '); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function printPage1() { // 1. 캡처 대상 유효성 검사 const targetElement = document.getElementById('ct1'); if (!targetElement) { console.error("오류: ID가 'ct'인 요소를 찾을 수 없습니다."); alert("인쇄할 영역(ID: ct)을 찾을 수 없습니다."); return; } // 2. 캡처 직전에 숨겨야 할 요소들을 선택하고 숨깁니다. const $elementsToHide = $('.lnb-wrap, .search-filter-box'); $elementsToHide.hide(); // 3. 캡처 시 짤림 방지를 위해 현재 스크롤 위치 저장 및 맨 위로 이동 const originalScroll = $(window).scrollTop(); $(window).scrollTop(0); // 4. html2canvas 함수 호출 html2canvas(targetElement, { scale: 2, // 해상도 2배 useCORS: true, // 외부 이미지 허용 allowTaint: true, scrollY: 0 // 스크롤 이슈 방지 }).then(function(canvas) { // 5. 캡처 완료 후 UI 복원 $elementsToHide.show(); $(window).scrollTop(originalScroll); const imgData = canvas.toDataURL('/kpaa/membevent/membeventNoticeList.do/image/png'); // 6. 인쇄 창 설정 const printWindow = window.open('', '_blank'); // [수정 1] 제목 변경: '인쇄 미리보기' -> '문서 출력' (원하는 텍스트로 수정 가능) // document.title을 넣으면 현재 웹페이지의 제목이 들어갑니다. printWindow.document.write('대한 변리사회'); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(' '); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function fn_toggleFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); // 클래스 토글 및 슬라이드 애니메이션 $header.toggleClass('active'); $body.stop().slideToggle(300); } function fn_openFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); if (!$header.hasClass('active')) { $header.addClass('active'); $body.stop().slideDown(300); } } function fn_adjustLayout() { // 1. 분류(체크박스)가 있는 항목에만 특별한 클래스(.item-auto) 부여 // -> CSS에서 이 클래스가 있으면 width를 고정하지 않고 내용물 크기만큼 잡음 $('.new-sf-check-group').each(function() { $(this).closest('.new-sf-item').addClass('item-auto'); }); // 2. 버튼 영역 초기화 (혹시 남아있을 스타일 제거) $('.new-sf-btn-area').css('grid-column', ''); } // 윈도우 리사이즈 시에도 그냥 호출만 하면 됨 (사실 CSS라 호출 안 해도 됨) function fn_initFilterLayout() { fn_adjustLayout(); // Flexbox는 반응형이 자동이라 리사이즈 이벤트 바인딩도 굳이 필요 없지만 유지. $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function fn_initFilterLayout() { fn_adjustLayout(); $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function checkMaxLength(obj, max) { if (obj.value.length > max) { // 사용자에게 알림 (선택 사항) // alert(max + "자까지만 입력 가능합니다."); // 최대 글자 수만큼만 남기고 자르기 obj.value = obj.value.substring(0, max); } }
'); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function printPage1() { // 1. 캡처 대상 유효성 검사 const targetElement = document.getElementById('ct1'); if (!targetElement) { console.error("오류: ID가 'ct'인 요소를 찾을 수 없습니다."); alert("인쇄할 영역(ID: ct)을 찾을 수 없습니다."); return; } // 2. 캡처 직전에 숨겨야 할 요소들을 선택하고 숨깁니다. const $elementsToHide = $('.lnb-wrap, .search-filter-box'); $elementsToHide.hide(); // 3. 캡처 시 짤림 방지를 위해 현재 스크롤 위치 저장 및 맨 위로 이동 const originalScroll = $(window).scrollTop(); $(window).scrollTop(0); // 4. html2canvas 함수 호출 html2canvas(targetElement, { scale: 2, // 해상도 2배 useCORS: true, // 외부 이미지 허용 allowTaint: true, scrollY: 0 // 스크롤 이슈 방지 }).then(function(canvas) { // 5. 캡처 완료 후 UI 복원 $elementsToHide.show(); $(window).scrollTop(originalScroll); const imgData = canvas.toDataURL('/kpaa/membevent/membeventNoticeList.do/image/png'); // 6. 인쇄 창 설정 const printWindow = window.open('', '_blank'); // [수정 1] 제목 변경: '인쇄 미리보기' -> '문서 출력' (원하는 텍스트로 수정 가능) // document.title을 넣으면 현재 웹페이지의 제목이 들어갑니다. printWindow.document.write('대한 변리사회'); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(' '); printWindow.document.close(); // 7. 인쇄 실행 및 자동 닫기 처리 printWindow.onload = function() { setTimeout(function() { printWindow.focus(); // onafterprint 이벤트 핸들러 설정 printWindow.onafterprint = function() { // [핵심 수정 부분] // 인쇄 작업 완료(프린트 또는 취소) 후 부모 창 새로고침 window.location.reload(); // 인쇄 창 닫기 (새로고침 전에 닫는 것이 사용자 경험에 더 좋을 수 있지만, // reload()는 비동기 작업이 아니므로 순서에 따라 조정) printWindow.close(); }; // 인쇄 다이얼로그 띄우기 printWindow.print(); }, 300); // [추가 수정] 인쇄 창이 닫힐 때(취소 또는 X 버튼) 부모 창 새로고침 처리 // printWindow.onafterprint가 작동하지 않는 일부 브라우저를 위한 보완책 const printCheck = setInterval(function() { if (printWindow.closed) { clearInterval(printCheck); window.location.reload(); } }, 500); }; }); } function fn_toggleFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); // 클래스 토글 및 슬라이드 애니메이션 $header.toggleClass('active'); $body.stop().slideToggle(300); } function fn_openFilter() { var $header = $('#newFilterHeader'); var $body = $('#newFilterBody'); if (!$header.hasClass('active')) { $header.addClass('active'); $body.stop().slideDown(300); } } function fn_adjustLayout() { // 1. 분류(체크박스)가 있는 항목에만 특별한 클래스(.item-auto) 부여 // -> CSS에서 이 클래스가 있으면 width를 고정하지 않고 내용물 크기만큼 잡음 $('.new-sf-check-group').each(function() { $(this).closest('.new-sf-item').addClass('item-auto'); }); // 2. 버튼 영역 초기화 (혹시 남아있을 스타일 제거) $('.new-sf-btn-area').css('grid-column', ''); } // 윈도우 리사이즈 시에도 그냥 호출만 하면 됨 (사실 CSS라 호출 안 해도 됨) function fn_initFilterLayout() { fn_adjustLayout(); // Flexbox는 반응형이 자동이라 리사이즈 이벤트 바인딩도 굳이 필요 없지만 유지. $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function fn_initFilterLayout() { fn_adjustLayout(); $(window).off('resize.newSfFilter').on('resize.newSfFilter', fn_adjustLayout); } function checkMaxLength(obj, max) { if (obj.value.length > max) { // 사용자에게 알림 (선택 사항) // alert(max + "자까지만 입력 가능합니다."); // 최대 글자 수만큼만 남기고 자르기 obj.value = obj.value.substring(0, max); } }