From 8d6ae54a9bb3cb9c0aa262cb82b9e5dc2929da3c Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Fri, 21 Feb 2025 14:18:08 +0900 Subject: [PATCH 01/15] =?UTF-8?q?=EC=9D=B5=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardProfile.vue | 2 +- src/views/board/BoardView.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/board/BoardProfile.vue b/src/components/board/BoardProfile.vue index 796ab40..766bc31 100644 --- a/src/components/board/BoardProfile.vue +++ b/src/components/board/BoardProfile.vue @@ -61,7 +61,7 @@ const props = defineProps({ }, profileName: { type: String, - default: null, + default: '익명', }, unknown: { type: Boolean, diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index e52e404..a0e0824 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -149,7 +149,7 @@ const comments = ref([]); const route = useRoute(); const router = useRouter(); const currentBoardId = ref(Number(route.params.id)); -const unknown = computed(() => profileName.value === null); +const unknown = computed(() => profileName.value === '익명'); const currentUserId = ref('김자바'); // 현재 로그인한 사용자 id const authorId = ref(null); // 작성자 id @@ -190,7 +190,7 @@ const fetchBoardDetails = async () => { // API 응답 데이터 반영 // const boardDetail = data.boardDetail || {}; - profileName.value = data.author || null; + profileName.value = data.author || '익명'; // 익명확인하고 싶을때 // profileName.value = 'null; @@ -277,7 +277,7 @@ const fetchComments = async (page = 1) => { commentId: comment.LOCCMTSEQ, // 댓글 ID boardId: comment.LOCBRDSEQ, parentId: comment.LOCCMTPNT, // 부모 ID - author: comment.author || null, + author: comment.author || '익명', content: comment.LOCCMTRPY, likeCount: comment.likeCount || 0, dislikeCount: comment.dislikeCount || 0, From 2fb0ca06dccffc3b36fa5abc33af6bae7a82a1eb Mon Sep 17 00:00:00 2001 From: Dang Date: Fri, 21 Feb 2025 14:45:50 +0900 Subject: [PATCH 02/15] =?UTF-8?q?=EC=9A=A9=EC=96=B4=EC=A7=91=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=ED=94=84=EB=A1=9C=ED=95=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/wordDict/DictCard.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/wordDict/DictCard.vue b/src/components/wordDict/DictCard.vue index 3eae3d7..b4bf68f 100644 --- a/src/components/wordDict/DictCard.vue +++ b/src/components/wordDict/DictCard.vue @@ -194,8 +194,11 @@ const baseUrl = $api.defaults.baseURL.replace(/api\/$/, ''); const formatDate = (dateString) => new Date(dateString).toLocaleString(); // 프로필 이미지 -const getProfileImage = (imagePath) => - imagePath ? `${baseUrl}upload/img/profile/${imagePath}` : '/img/avatars/default-Profile.jpg'; +const defaultProfile = "/img/icons/icon.png"; + +const getProfileImage = (profilePath) => { + return profilePath && profilePath.trim() ? `${baseUrl}upload/img/profile/${profilePath}` : defaultProfile; +}; // 체크 상태 변경 시 부모로 전달 From 9bc34a02fced3dd2a66b5be64feb3a142118faed Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Fri, 21 Feb 2025 16:03:21 +0900 Subject: [PATCH 03/15] =?UTF-8?q?=EC=97=90=EB=9F=AC=EB=A9=94=EC=84=B8?= =?UTF-8?q?=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardView.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue index a0e0824..8c50fe6 100644 --- a/src/views/board/BoardView.vue +++ b/src/views/board/BoardView.vue @@ -531,7 +531,7 @@ const submitPassword = async () => { } lastClickedButton.value = null; } else { - passwordAlert.value = "비밀번호가 일치하지 않습니다.????"; + passwordAlert.value = "비밀번호가 일치하지 않습니다."; } } catch (error) { // console.log("📌 전체 오류:", error); @@ -552,6 +552,7 @@ const submitPassword = async () => { // 댓글 삭제 (비밀번호 확인 후) const submitCommentPassword = async (comment, password) => { + if (!password) { passwordCommentAlert.value = "비밀번호를 입력해주세요."; return; @@ -564,12 +565,16 @@ const submitCommentPassword = async (comment, password) => { }); if (response.data.code === 200 && response.data.data === true) { + passwordCommentAlert.value = ""; comment.isCommentPassword = false; if (lastCommentClickedButton.value === "edit") { comment.isEditTextarea = true; + passwordCommentAlert.value = ""; + // handleSubmitEdit(comment, comment.content); } else if (lastCommentClickedButton.value === "delete") { + passwordCommentAlert.value = ""; deleteReplyComment(comment) } From 334aa3e22ad1fd01ce1e26bc983ccf427cea03a8 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Mon, 24 Feb 2025 12:47:31 +0900 Subject: [PATCH 04/15] =?UTF-8?q?menu,=20main=20=EB=A1=9C=EB=94=A9=20?= =?UTF-8?q?=EC=BD=98=EC=86=94=20=EC=A3=BC=EC=84=9D=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/NormalLayout.vue | 49 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/layouts/NormalLayout.vue b/src/layouts/NormalLayout.vue index e6af2d8..4d4d0f1 100644 --- a/src/layouts/NormalLayout.vue +++ b/src/layouts/NormalLayout.vue @@ -24,32 +24,31 @@ - + From 0b0c948725b9287fc14370a99140d16507e2ea02 Mon Sep 17 00:00:00 2001 From: nevermoregb Date: Mon, 24 Feb 2025 13:33:54 +0900 Subject: [PATCH 05/15] =?UTF-8?q?main.js=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/main.js | 196 +++++++++++++++++++++++----------------------- 1 file changed, 97 insertions(+), 99 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 7937823..047566f 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -2,116 +2,114 @@ * Main */ -'use strict' +(function () { + // Initialize menu + //----------------- + let menu, animate; -let menu, animate -;(function () { - // Initialize menu - //----------------- + let layoutMenuEl = document.querySelectorAll('#layout-menu'); + layoutMenuEl.forEach(function (element) { + menu = new Menu(element, { + orientation: 'vertical', + closeChildren: false, + }); + // Change parameter to true if you want scroll animation + window.Helpers.scrollToActive((animate = false)); + window.Helpers.mainMenu = menu; + }); - let layoutMenuEl = document.querySelectorAll('#layout-menu') - layoutMenuEl.forEach(function (element) { - menu = new Menu(element, { - orientation: 'vertical', - closeChildren: false, - }) - // Change parameter to true if you want scroll animation - window.Helpers.scrollToActive((animate = false)) - window.Helpers.mainMenu = menu - }) + // Initialize menu togglers and bind click on each + let menuToggler = document.querySelectorAll('.layout-menu-toggle'); + menuToggler.forEach(item => { + item.addEventListener('click', event => { + event.preventDefault(); + window.Helpers.toggleCollapsed(); + }); + }); - // Initialize menu togglers and bind click on each - let menuToggler = document.querySelectorAll('.layout-menu-toggle') - menuToggler.forEach((item) => { - item.addEventListener('click', (event) => { - event.preventDefault() - window.Helpers.toggleCollapsed() - }) - }) + // Display menu toggle (layout-menu-toggle) on hover with delay + let delay = function (elem, callback) { + let timeout = null; + elem.onmouseenter = function () { + // Set timeout to be a timer which will invoke callback after 300ms (not for small screen) + if (!Helpers.isSmallScreen()) { + timeout = setTimeout(callback, 300); + } else { + timeout = setTimeout(callback, 0); + } + }; - // Display menu toggle (layout-menu-toggle) on hover with delay - let delay = function (elem, callback) { - let timeout = null - elem.onmouseenter = function () { - // Set timeout to be a timer which will invoke callback after 300ms (not for small screen) - if (!Helpers.isSmallScreen()) { - timeout = setTimeout(callback, 300) - } else { - timeout = setTimeout(callback, 0) - } + elem.onmouseleave = function () { + // Clear any timers set to timeout + document.querySelector('.layout-menu-toggle').classList.remove('d-block'); + clearTimeout(timeout); + }; + }; + if (document.getElementById('layout-menu')) { + delay(document.getElementById('layout-menu'), function () { + // not for small screen + if (!Helpers.isSmallScreen()) { + document.querySelector('.layout-menu-toggle').classList.add('d-block'); + } + }); } - elem.onmouseleave = function () { - // Clear any timers set to timeout - document.querySelector('.layout-menu-toggle').classList.remove('d-block') - clearTimeout(timeout) + // Display in main menu when menu scrolls + let menuInnerContainer = document.getElementsByClassName('menu-inner'), + menuInnerShadow = document.getElementsByClassName('menu-inner-shadow')[0]; + if (menuInnerContainer.length > 0 && menuInnerShadow) { + menuInnerContainer[0].addEventListener('ps-scroll-y', function () { + if (this.querySelector('.ps__thumb-y').offsetTop) { + menuInnerShadow.style.display = 'block'; + } else { + menuInnerShadow.style.display = 'none'; + } + }); } - } - if (document.getElementById('layout-menu')) { - delay(document.getElementById('layout-menu'), function () { - // not for small screen - if (!Helpers.isSmallScreen()) { - document.querySelector('.layout-menu-toggle').classList.add('d-block') - } - }) - } - // Display in main menu when menu scrolls - let menuInnerContainer = document.getElementsByClassName('menu-inner'), - menuInnerShadow = document.getElementsByClassName('menu-inner-shadow')[0] - if (menuInnerContainer.length > 0 && menuInnerShadow) { - menuInnerContainer[0].addEventListener('ps-scroll-y', function () { - if (this.querySelector('.ps__thumb-y').offsetTop) { - menuInnerShadow.style.display = 'block' - } else { - menuInnerShadow.style.display = 'none' - } - }) - } + // Init helpers & misc + // -------------------- - // Init helpers & misc - // -------------------- + // Init BS Tooltip + const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); + tooltipTriggerList.map(function (tooltipTriggerEl) { + return new bootstrap.Tooltip(tooltipTriggerEl); + }); - // Init BS Tooltip - const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) - tooltipTriggerList.map(function (tooltipTriggerEl) { - return new bootstrap.Tooltip(tooltipTriggerEl) - }) + // Accordion active class + const accordionActiveFunction = function (e) { + if (e.type == 'show.bs.collapse' || e.type == 'show.bs.collapse') { + e.target.closest('.accordion-item').classList.add('active'); + } else { + e.target.closest('.accordion-item').classList.remove('active'); + } + }; - // Accordion active class - const accordionActiveFunction = function (e) { - if (e.type == 'show.bs.collapse' || e.type == 'show.bs.collapse') { - e.target.closest('.accordion-item').classList.add('active') - } else { - e.target.closest('.accordion-item').classList.remove('active') + const accordionTriggerList = [].slice.call(document.querySelectorAll('.accordion')); + const accordionList = accordionTriggerList.map(function (accordionTriggerEl) { + accordionTriggerEl.addEventListener('show.bs.collapse', accordionActiveFunction); + accordionTriggerEl.addEventListener('hide.bs.collapse', accordionActiveFunction); + }); + + // Auto update layout based on screen size + window.Helpers.setAutoUpdate(true); + + // Toggle Password Visibility + window.Helpers.initPasswordToggle(); + + // Speech To Text + window.Helpers.initSpeechToText(); + + // Manage menu expanded/collapsed with templateCustomizer & local storage + //------------------------------------------------------------------ + + // If current layout is horizontal OR current window screen is small (overlay menu) than return from here + if (window.Helpers.isSmallScreen()) { + return; } - } - const accordionTriggerList = [].slice.call(document.querySelectorAll('.accordion')) - const accordionList = accordionTriggerList.map(function (accordionTriggerEl) { - accordionTriggerEl.addEventListener('show.bs.collapse', accordionActiveFunction) - accordionTriggerEl.addEventListener('hide.bs.collapse', accordionActiveFunction) - }) + // If current layout is vertical and current window screen is > small - // Auto update layout based on screen size - window.Helpers.setAutoUpdate(true) - - // Toggle Password Visibility - window.Helpers.initPasswordToggle() - - // Speech To Text - window.Helpers.initSpeechToText() - - // Manage menu expanded/collapsed with templateCustomizer & local storage - //------------------------------------------------------------------ - - // If current layout is horizontal OR current window screen is small (overlay menu) than return from here - if (window.Helpers.isSmallScreen()) { - return - } - - // If current layout is vertical and current window screen is > small - - // Auto update menu collapsed/expanded based on the themeConfig - window.Helpers.setCollapsed(true, false) -})() + // Auto update menu collapsed/expanded based on the themeConfig + window.Helpers.setCollapsed(true, false); +})(); From a935bcf4d5922283ad015c66de6241e776d43bd9 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Mon, 24 Feb 2025 14:04:17 +0900 Subject: [PATCH 06/15] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=9D=B5?= =?UTF-8?q?=EB=AA=85=20=EC=A7=84=ED=96=89=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardComment.vue | 16 ++++-- src/components/board/BoardCommentArea.vue | 6 +- src/components/board/BoardCommentList.vue | 7 ++- src/components/board/BoardProfile.vue | 9 ++- src/views/board/BoardView.vue | 68 +++++++++++++++-------- 5 files changed, 73 insertions(+), 33 deletions(-) diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 932c36f..2bcdc10 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -2,6 +2,7 @@
{{ passwordCommentAlert }}
- +

authorId:{{ comment.authorId }}

+

코멘트 비교: {{comment.isCommentAuthor}}

+