diff --git a/README.md b/README.md index bad1eb5..ec71345 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ js 주석을 구문 분석하고 문서화합니다. 현재는 기능만 구현 ## 버전 -v0.2.2 +v0.2.4 ## 사용법 diff --git a/UPDATE.md b/UPDATE.md index 3b935fb..c9468d3 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -3,15 +3,18 @@ ***TOC*** - [Update List](#update-list) + - [v0.2.4 업데이트](#v024-업데이트) + - [추가 사항](#추가-사항) + - [버그 수정](#버그-수정) - [v0.2.3 업데이트](#v023-업데이트) - [수정 사항](#수정-사항) - - [추가 사항](#추가-사항) + - [추가 사항](#추가-사항-1) - [v0.2.2 업데이트](#v022-업데이트) - - [버그 수정](#버그-수정) + - [버그 수정](#버그-수정-1) - [수정 사항](#수정-사항-1) - - [추가 사항](#추가-사항-1) + - [추가 사항](#추가-사항-2) - [v0.2.1 업데이트](#v021-업데이트) - - [버그 수정](#버그-수정-1) + - [버그 수정](#버그-수정-2) - [수정 사항](#수정-사항-2) - [v0.2.0 pre-release 수정 사항](#v020-pre-release-수정-사항) - [초기화 옵션 방식 수정](#초기화-옵션-방식-수정) @@ -35,6 +38,29 @@ # Update List +## v0.2.4 업데이트 + +### 추가 사항 + +1. 검색창 기능 (MDN 검색 기능 참조) +2. 채팅창 버튼별 기능 연결 + - 업데이트, 문의, 만든사람, 저장 기능 연결 + - 페이지 저장 시 page object 전달 + - 메세지 입력 하단 스크롤 방식 변경 + - `userData.json`에 아바타 추가 + - bot, user 명칭 디스플레이 추가 + - 채팅창 사이즈 증가 +3. 문서 전체 스크롤에서 메인 영역 스크롤 방식으로 변경 + +### 버그 수정 + +1. 채팅창 css + - ui 수정 + +***kimson, ohoraming | 2021-11-03 19:09:02*** + +----- + ## v0.2.3 업데이트 ### 수정 사항 diff --git a/dist/assets/css/chat.css b/dist/assets/css/chat.css index 5d6b203..1131f4e 100644 --- a/dist/assets/css/chat.css +++ b/dist/assets/css/chat.css @@ -1,34 +1,35 @@ /** - * mkDocumentifyJS v0.2.3 (https://github.com/kkn1125/mkDocumentifyJS) + * mkDocumentifyJS v0.2.4 (https://github.com/kkn1125/mkDocumentifyJS) * Copyright 2021 Authors (https://github.com/kkn1125/mkDocumentifyJS/graphs/contributors) kkn1125, ohoraming * Licensed under MIT (https://github.com/kkn1125/mkDocumentifyJS/blob/main/LICENSE) */ .chat-btn-wrap { - position: fixed; - right: 3rem; - bottom: 7rem; - color: var(--ks-brand); - width: auto; - height: auto; - z-index: 500; + position: fixed; + right: 3rem; + bottom: 8rem; + color: var(--ks-brand); + width: auto; + height: auto; + z-index: 500; } .chat-btn-wrap .chat-btn { - transform: rotateY(180deg); - -webkit-transform: rotateY(180deg); - -moz-transform: rotateY(180deg); - -ms-transform: rotateY(180deg); - -o-transform: rotateY(180deg); + transform: rotateY(180deg); + -webkit-transform: rotateY(180deg); + -moz-transform: rotateY(180deg); + -ms-transform: rotateY(180deg); + -o-transform: rotateY(180deg); } .chat-btn-wrap .chat-btn:hover { - cursor: pointer; + cursor: pointer; } .chat-modal { display: none; position: fixed; + user-select: none; width: 25rem; height: 35rem; background-color: var(--ks-bg); @@ -46,105 +47,103 @@ } @keyframes chatModalPop { - 0% { - opacity: 0; - transform: scale(0.0001); - -webkit-transform: scale(0.0001); - -moz-transform: scale(0.0001); - -ms-transform: scale(0.0001); - -o-transform: scale(0.0001); - } - - 100% { - opacity: 1; - transform: scale(1); - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - } + 0% { + opacity: 0; + transform: scale(0.0001); + -webkit-transform: scale(0.0001); + -moz-transform: scale(0.0001); + -ms-transform: scale(0.0001); + -o-transform: scale(0.0001); + } + + 100% { + opacity: 1; + transform: scale(1); + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + } } @keyframes chatModalShow { - 0% { - opacity: 0; - transform: scale(0.0001); - -webkit-transform: scale(0.0001); - -moz-transform: scale(0.0001); - -ms-transform: scale(0.0001); - -o-transform: scale(0.0001); - } - - 100% { - opacity: 1; - transform: scale(1); - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - } + 0% { + opacity: 0; + transform: scale(0.0001); + -webkit-transform: scale(0.0001); + -moz-transform: scale(0.0001); + -ms-transform: scale(0.0001); + -o-transform: scale(0.0001); + } + + 100% { + opacity: 1; + transform: scale(1); + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + } } @keyframes chatModalHide { - 0% { - opacity: 1; - transform: scale(1); - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - } - - 100% { - opacity: 0; - transform: scale(0.0001); - -webkit-transform: scale(0.0001); - -moz-transform: scale(0.0001); - -ms-transform: scale(0.0001); - -o-transform: scale(0.0001); - } + 0% { + opacity: 1; + transform: scale(1); + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + } + + 100% { + opacity: 0; + transform: scale(0.0001); + -webkit-transform: scale(0.0001); + -moz-transform: scale(0.0001); + -ms-transform: scale(0.0001); + -o-transform: scale(0.0001); + } } .chat-modal.show { - display: block; - animation: chatModalShow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; - -webkit-animation: chatModalShow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) - both; + display: block; + animation: chatModalShow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; + -webkit-animation: chatModalShow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; } .chat-modal.hide { - display: block; - animation: chatModalHide 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; - -webkit-animation: chatModalHide 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) - both; + display: block; + animation: chatModalHide 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; + -webkit-animation: chatModalHide 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; } .chat-modal .chat-title { - background-color: var(--ks-brand); - line-height: 2.5rem; - padding-left: 1rem; - padding-right: 1rem; - font-weight: 700; - color: var(--ks-bg); - display: flex; - justify-content: space-between; + background-color: var(--ks-brand); + line-height: 2.5rem; + padding-left: 1rem; + padding-right: 1rem; + font-weight: 700; + color: var(--ks-bg); + display: flex; + justify-content: space-between; } .chat-modal .chat-title .modal-del-btn { - user-select: none; - cursor: pointer; + user-select: none; + cursor: pointer; } -.chat-modal .chat-content +.chat-modal .chat-content { color: rgba(80, 80, 80); height: 520px; } .chat-modal .chat-content .chat-body { - height: 100%; - display: flex; - flex-flow: column wrap; - justify-content: space-between; + height: 100%; + display: flex; + flex-flow: column wrap; + justify-content: space-between; } .chat-modal .chat-content .chat-body .chat-message { @@ -156,224 +155,237 @@ } .chat-modal .chat-content .chat-body .chat-message::-webkit-scrollbar { - width: 0.3rem; - height: 0.3rem; - background-color: rgba(94, 194, 113, 0.2); + width: 0.3rem; + height: 0.3rem; + background-color: rgba(94, 194, 113, 0.2); } .chat-modal .chat-content .chat-body .chat-message::-webkit-scrollbar-thumb { - width: 0.3rem; - height: 0.3rem; - background-color: rgba(94, 194, 113, 0.7); + width: 0.3rem; + height: 0.3rem; + background-color: rgba(94, 194, 113, 0.7); } .chat-modal .chat-content .chat-body .chat-bar { - padding: 0.5rem 1rem 0.5rem; - position: relative; + padding: 0.5rem 1rem 0.5rem; + position: relative; } .chat-modal .chat-content .chat-body .chat-bar input { - font-size: 0.8rem; - padding: 0.5rem; + font-size: 0.8rem; + padding: 0.5rem; } .chat-modal .chat-content .chat-body .chat-message .msg-wrap { - margin-top: 1rem; - margin-bottom: 1rem; - line-height: 2rem; - padding-left: 0.5rem; - padding-right: 0.5rem; -} - -.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box { - display: inline-block; - max-width: 80%; - word-break: break-word; - border-radius: 0.5rem; - -webkit-border-radius: 0.5rem; - -moz-border-radius: 0.5rem; - -ms-border-radius: 0.5rem; - -o-border-radius: 0.5rem; - position: relative; - line-height: 1.2rem; - text-indent: 0; - white-space: pre-line; - padding: 0.5rem 0.5rem; - box-shadow: 5px 2px 0.2rem 0rem rgba(0, 0, 0, 0.2); -} - -.chat-modal - .chat-content - .chat-body - .chat-message - .msg-wrap - .msg-box.msg-box-info::before { - background-color: white; -} - -.chat-modal - .chat-content - .chat-body - .chat-message - .msg-wrap - .msg-box.msg-box-info, -.chat-modal - .chat-content - .chat-body - .chat-message - .msg-wrap - .msg-box.msg-box-info::before { - border: 2px solid var(--ks-brand); - /* background-color: var(--ks-brand); */ - /* color: white; */ + margin-top: 1rem; + margin-bottom: 1rem; + line-height: 2rem; + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box-wrap .msg-box { + display: inline-block; + max-width: 80%; + +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box-wrap .msg-box { + display: inline-block; + word-break: break-word; + border-radius: 0.5rem; + -webkit-border-radius: 0.5rem; + -moz-border-radius: 0.5rem; + -ms-border-radius: 0.5rem; + -o-border-radius: 0.5rem; + position: relative; + line-height: 1.2rem; + text-indent: 0; + white-space: pre-line; + padding: 0.5rem 0.5rem; + box-shadow: 5px 2px 0.2rem 0rem rgba(0, 0, 0, 0.2); +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box-wrap [class*="msg-title-"] { + font-weight: 700; +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box-wrap .msg-title-info { + color: var(--ks-brand); +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box-wrap .msg-title-info::before{ + content: '🤖'; + margin-right: .2em; + font-size: 1.5em; +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box-wrap .msg-title-user::after { + content: '😃'; + margin-left: .2em; + font-size: 1.5em; +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box-wrap .msg-title-user { + text-align: right; + color: var(--ks-primary) +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box.msg-box-info::before { + background-color: white; +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box.msg-box-info, +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box.msg-box-info::before { + border: 2px solid var(--ks-brand); + /* background-color: var(--ks-brand); */ + /* color: white; */ } .msg-box-info::before { - content: ""; - z-index: 5; - display: inline-block; - width: 0.7rem; - height: 0.7rem; - border-top: none !important; - border-right: none !important; - position: absolute; - transform: translate(-135%, 10%) rotate(45deg); - -webkit-transform: translate(-135%, 10%) rotate(45deg); - -moz-transform: translate(-135%, 10%) rotate(45deg); - -ms-transform: translate(-135%, 10%) rotate(45deg); - -o-transform: translate(-135%, 10%) rotate(45deg); -} - -.chat-modal - .chat-content - .chat-body - .chat-message - .msg-wrap - .msg-box.msg-box-user::before { - background-color: white; -} - -.chat-modal - .chat-content - .chat-body - .chat-message - .msg-wrap - .msg-box.msg-box-user, -.chat-modal - .chat-content - .chat-body - .chat-message - .msg-wrap - .msg-box.msg-box-user::before { - border: 2px solid var(--ks-secondary); - /* background-color: var(--ks-secondary); + content: ""; + z-index: 5; + display: inline-block; + width: 0.7rem; + height: 0.7rem; + border-top: none !important; + border-right: none !important; + position: absolute; + transform: translate(-135%, 10%) rotate(45deg); + -webkit-transform: translate(-135%, 10%) rotate(45deg); + -moz-transform: translate(-135%, 10%) rotate(45deg); + -ms-transform: translate(-135%, 10%) rotate(45deg); + -o-transform: translate(-135%, 10%) rotate(45deg); +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box.msg-box-user::before { + background-color: white; +} + +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box.msg-box-user, +.chat-modal .chat-content .chat-body .chat-message .msg-wrap .msg-box.msg-box-user::before { + border: 2px solid var(--ks-secondary); + /* background-color: var(--ks-secondary); color: white; */ } .msg-box-user::before { - content: ""; - z-index: 5; - display: inline-block; - width: 0.7rem; - height: 0.7rem; - border-bottom: none !important; - border-left: none !important; - position: absolute; - right: 0%; - transform: translateX(60%) rotate(45deg); - -webkit-transform: translateX(60%) rotate(45deg); - -moz-transform: translateX(60%) rotate(45deg); - -ms-transform: translateX(60%) rotate(45deg); - -o-transform: translateX(60%) rotate(45deg); + content: ""; + z-index: 5; + display: inline-block; + width: 0.7rem; + height: 0.7rem; + border-bottom: none !important; + border-left: none !important; + position: absolute; + right: 0%; + transform: translateX(60%) rotate(45deg); + -webkit-transform: translateX(60%) rotate(45deg); + -moz-transform: translateX(60%) rotate(45deg); + -ms-transform: translateX(60%) rotate(45deg); + -o-transform: translateX(60%) rotate(45deg); +} + +.msg-box-user[class*="needs-"]:not(.needs-info):hover { + background-color: #5ec271; + color: white; +} + +.chat-modal .chat-body .chat-message .msg-wrap .msg-box[class*="needs-"]:not(.needs-info) { + cursor: pointer !important; } -.msg-box-user:hover { - background-color: #5ec271; - color: white; +.chat-modal .chat-body .chat-message .msg-wrap .msg-box div{ + pointer-events: none; } -.msg-box-user:hover::before { - background-color: #5ec271 !important; +.chat-modal .chat-body .chat-message .msg-wrap .msg-box.mail { + max-width: 100% !important; + width: 100%; +} + +.msg-box-user[class*="needs-"]:not(.needs-info):hover::before { + background-color: #5ec271 !important; } .msg-box-info { - transform-origin: left top; - animation: popInfo 500ms cubic-bezier(0.215, 0.61, 0.355, 1) both; - -webkit-animation: popInfo 500ms cubic-bezier(0.215, 0.61, 0.355, 1); + transform-origin: left top; + animation: popInfo 500ms cubic-bezier(0.215, 0.61, 0.355, 1) both; + -webkit-animation: popInfo 500ms cubic-bezier(0.215, 0.61, 0.355, 1); } @keyframes popInfo { - 0% { - transform: scale(0.0001); - -webkit-transform: scale(0.0001); - -moz-transform: scale(0.0001); - -ms-transform: scale(0.0001); - -o-transform: scale(0.0001); - } - - 100% { - transform: scale(1); - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - } + 0% { + transform: scale(0.0001); + -webkit-transform: scale(0.0001); + -moz-transform: scale(0.0001); + -ms-transform: scale(0.0001); + -o-transform: scale(0.0001); + } + + 100% { + transform: scale(1); + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + } } .msg-box-user { - transform-origin: left top; - right: 0%; - left: 100%; - animation: popUser 500ms cubic-bezier(0.215, 0.61, 0.355, 1) both; - -webkit-animation: popUser 500ms cubic-bezier(0.215, 0.61, 0.355, 1) both; - transform: scale(0.0001) translateX(-100%); - -webkit-transform: scale(0.0001) translateX(-100%); - -moz-transform: scale(0.0001) translateX(-100%); - -ms-transform: scale(0.0001) translateX(-100%); - -o-transform: scale(0.0001) translateX(-100%); -} - -@keyframes popUser { - 0% { + transform-origin: left top; + right: 0%; + left: 100%; + animation: popUser 500ms cubic-bezier(0.215, 0.61, 0.355, 1) both; + -webkit-animation: popUser 500ms cubic-bezier(0.215, 0.61, 0.355, 1) both; transform: scale(0.0001) translateX(-100%); -webkit-transform: scale(0.0001) translateX(-100%); -moz-transform: scale(0.0001) translateX(-100%); -ms-transform: scale(0.0001) translateX(-100%); -o-transform: scale(0.0001) translateX(-100%); - } +} - 100% { - transform: scale(1) translateX(-100%); - -webkit-transform: scale(1) translateX(-100%); - -moz-transform: scale(1) translateX(-100%); - -ms-transform: scale(1) translateX(-100%); - -o-transform: scale(1) translateX(-100%); - } +@keyframes popUser { + 0% { + transform: scale(0.0001) translateX(-100%); + -webkit-transform: scale(0.0001) translateX(-100%); + -moz-transform: scale(0.0001) translateX(-100%); + -ms-transform: scale(0.0001) translateX(-100%); + -o-transform: scale(0.0001) translateX(-100%); + } + + 100% { + transform: scale(1) translateX(-100%); + -webkit-transform: scale(1) translateX(-100%); + -moz-transform: scale(1) translateX(-100%); + -ms-transform: scale(1) translateX(-100%); + -o-transform: scale(1) translateX(-100%); + } } @keyframes motionAlert { - 0% { - filter: drop-shadow(0 0 0 var(--ks-primary)); - -webkit-filter: drop-shadow(0 0 0 var(--ks-primary)); - } - - 25% { - filter: drop-shadow(0 0 0.3rem var(--ks-primary)); - -webkit-filter: drop-shadow(0 0 0.3rem var(--ks-primary)); - } - - 50% { - filter: drop-shadow(0 0 0 var(--ks-brand)); - -webkit-filter: drop-shadow(0 0 0 var(--ks-brand)); - } - - 75% { - filter: drop-shadow(0 0 0.5rem var(--ks-brand)); - -webkit-filter: drop-shadow(0 0 0.5rem var(--ks-brand)); - } - - 100% { - filter: drop-shadow(0 0 0 var(--ks-brand)); - -webkit-filter: drop-shadow(0 0 0 var(--ks-brand)); - } -} + 0% { + filter: drop-shadow(0 0 0 var(--ks-primary)); + -webkit-filter: drop-shadow(0 0 0 var(--ks-primary)); + } + + 25% { + filter: drop-shadow(0 0 0.3rem var(--ks-primary)); + -webkit-filter: drop-shadow(0 0 0.3rem var(--ks-primary)); + } + + 50% { + filter: drop-shadow(0 0 0 var(--ks-brand)); + -webkit-filter: drop-shadow(0 0 0 var(--ks-brand)); + } + + 75% { + filter: drop-shadow(0 0 0.5rem var(--ks-brand)); + -webkit-filter: drop-shadow(0 0 0.5rem var(--ks-brand)); + } + + 100% { + filter: drop-shadow(0 0 0 var(--ks-brand)); + -webkit-filter: drop-shadow(0 0 0 var(--ks-brand)); + } +} \ No newline at end of file diff --git a/dist/assets/css/gnb.css b/dist/assets/css/gnb.css index 451ceca..0f95bb9 100644 --- a/dist/assets/css/gnb.css +++ b/dist/assets/css/gnb.css @@ -1,5 +1,5 @@ /** - * mkDocumentifyJS v0.2.3 (https://github.com/kkn1125/mkDocumentifyJS) + * mkDocumentifyJS v0.2.4 (https://github.com/kkn1125/mkDocumentifyJS) * Copyright 2021 Authors (https://github.com/kkn1125/mkDocumentifyJS/graphs/contributors) kkn1125, ohoraming * Licensed under MIT (https://github.com/kkn1125/mkDocumentifyJS/blob/main/LICENSE) */ @@ -18,6 +18,7 @@ justify-content: space-between; padding: 10px; background-color: #5ec271; + max-height: 111px; } .gnb .file_name { diff --git a/dist/assets/css/main.css b/dist/assets/css/main.css index ca337df..9efed66 100644 --- a/dist/assets/css/main.css +++ b/dist/assets/css/main.css @@ -1,5 +1,5 @@ /** - * mkDocumentifyJS v0.2.3 (https://github.com/kkn1125/mkDocumentifyJS) + * mkDocumentifyJS v0.2.4 (https://github.com/kkn1125/mkDocumentifyJS) * Copyright 2021 Authors (https://github.com/kkn1125/mkDocumentifyJS/graphs/contributors) kkn1125, ohoraming * Licensed under MIT (https://github.com/kkn1125/mkDocumentifyJS/blob/main/LICENSE) */ @@ -254,4 +254,9 @@ button{ a[href]{ color: var(--ks-primary); +} + +.main{ + overflow-y: auto; + scroll-behavior: smooth; } \ No newline at end of file diff --git a/dist/assets/js/documentify.js b/dist/assets/js/documentify.js index 276cde6..0597726 100644 --- a/dist/assets/js/documentify.js +++ b/dist/assets/js/documentify.js @@ -1,5 +1,5 @@ /**! - * mkDocumentifyJS v0.2.3 (https://github.com/kkn1125/mkDocumentifyJS) + * mkDocumentifyJS v0.2.4 (https://github.com/kkn1125/mkDocumentifyJS) * Copyright 2021 Authors (https://github.com/kkn1125/mkDocumentifyJS/graphs/contributors) kkn1125, ohoraming * Licensed under MIT (https://github.com/kkn1125/mkDocumentifyJS/blob/main/LICENSE) */ @@ -525,6 +525,7 @@ const Documentify = (function () { if (xhr.status == 200 || xhr.status == 201) { if (xhr.readyState == 4) { page = JSON.parse(xhr.responseText).page; + window.page = page; } } }); @@ -624,15 +625,16 @@ const Documentify = (function () { /** * 파일을 단일 페이지 모드로 압축 저장시키는 메서드 - * @function fileSaveAsMutilplePage + * @function fileSaveAsSinglePage * @param {event} ev Controller에서 지정한 addEventListener의 click 타입의 이벤트 - * @see View.fileSaveHandler,Zip + * @see View.fileSaveHandler */ this.fileSaveAsSinglePage = function(ev){ let main = this.getFileContents('dist/assets/css/main.css'); let chat = this.getFileContents('dist/assets/css/chat.css'); let gnb = this.getFileContents('dist/assets/css/gnb.css'); let theme = this.getFileContents('dist/assets/js/theme.js'); + theme = theme.replace("'use strict';", `'use strict';\n// page\nconst page = ${JSON.stringify(page)}`); let saveAsName = 'index.html'; @@ -666,13 +668,14 @@ const Documentify = (function () { * 파일을 분할 페이지 모드로 압축 저장시키는 메서드 * @function fileSaveAsMutilplePage * @param {event} ev Controller에서 지정한 addEventListener의 click 타입의 이벤트 - * @see View.fileSaveHandler,Zip + * @see Model.fileSaveHandler */ this.fileSaveAsMutilplePage = function (ev) { let main = this.getFileContents('dist/assets/css/main.css'); let chat = this.getFileContents('dist/assets/css/chat.css'); let gnb = this.getFileContents('dist/assets/css/gnb.css'); let theme = this.getFileContents('dist/assets/js/theme.js'); + theme = theme.replace("'use strict';", `'use strict';\n// page\nconst page = ${JSON.stringify(page)}`); let saveAsName = 'index.html'; let saveAsNameFunc = 'functions.html'; diff --git a/dist/assets/js/example.js b/dist/assets/js/example.js index fa29168..553f078 100644 --- a/dist/assets/js/example.js +++ b/dist/assets/js/example.js @@ -1,5 +1,5 @@ /**! - * mkDocumentifyJS v0.2.3 (https://github.com/kkn1125/mkDocumentifyJS) + * mkDocumentifyJS v0.2.4 (https://github.com/kkn1125/mkDocumentifyJS) * Copyright 2021 Authors (https://github.com/kkn1125/mkDocumentifyJS/graphs/contributors) kkn1125, ohoraming * Licensed under MIT (https://github.com/kkn1125/mkDocumentifyJS/blob/main/LICENSE) */ diff --git a/dist/assets/js/theme.js b/dist/assets/js/theme.js index 4e5a3f8..3c2341f 100644 --- a/dist/assets/js/theme.js +++ b/dist/assets/js/theme.js @@ -1,18 +1,11 @@ /**! - * mkDocumentifyJS v0.2.3 (https://github.com/kkn1125/mkDocumentifyJS) + * mkDocumentifyJS v0.2.4 (https://github.com/kkn1125/mkDocumentifyJS) * Copyright 2021 Authors (https://github.com/kkn1125/mkDocumentifyJS/graphs/contributors) kkn1125, ohoraming * Licensed under MIT (https://github.com/kkn1125/mkDocumentifyJS/blob/main/LICENSE) */ 'use strict'; -// delete 메뉴버튼 보류 -// window.addEventListener('click', function (ev) { -// if (ev.target.id == 'navbarSideCollapse' || ev.target.className == 'navbar-toggler-icon') { -// document.querySelector('.offcanvas-collapse').classList.toggle('open'); -// } -// }); - // recent popup delete | kimson 2021-10-22 16:25:02 window.addEventListener('click', (ev) => { let target = ev.target; @@ -45,14 +38,13 @@ setTimeout(() => { * 원문 코드 라인 이동 기능 */ document.addEventListener('click', lineMoveHandler); - function lineMoveHandler(ev) { let target = ev.target; let check = document.querySelector('.check'); if (check) check.classList.remove('check'); if (target.tagName !== 'A' || target.dataset.type !== 'lineNum') return; - + let lineNum = target.href.split('#')[1]; let line = document.querySelector('#line-' + lineNum); line.scrollIntoView({ @@ -60,6 +52,7 @@ function lineMoveHandler(ev) { block: "center", inline: "nearest" }); + line.classList.add('mark-line', 'check'); setTimeout(() => { line.classList.remove('mark-line') @@ -67,10 +60,19 @@ function lineMoveHandler(ev) { } document.addEventListener('click', anchorHandler); -function anchorHandler(ev){ + +function anchorHandler(ev) { let target = ev.target.closest('[data-anchor]'); - if(!target || target.tagName !== 'A' || target.dataset.anchor !== 'top')return; - window.scrollTo({behavior:'smooth',left:0,top:0}) + if (!target || target.tagName !== 'A') return; + ev.preventDefault(); + + let anchor = target.dataset.anchor; + let main = document.querySelector('main.main'); + main.scrollTo({ + behavior: 'smooth', + left: 0, + top: anchor=='start'?0:anchor=='end'?main.scrollHeight:target.scrollTop + }); } @@ -78,6 +80,7 @@ function anchorHandler(ev){ * modal 열고 닫기 */ let first = false; +let turn = ''; function motionAlertChatBtn() { setTimeout(() => { @@ -88,8 +91,47 @@ function motionAlertChatBtn() { motionAlertChatBtn(); -document.addEventListener('click', chatHandler); +const command = { + update: '업데이트 내역을 확인하고 싶어요', + // darkMode: '다크모드를 적용하고 싶어요', + mail: '메일로 문의하고 싶어요', + dev: '만든 사람이 궁금해요', + save: '페이지를 저장하고 싶어요', + // tutorial: '튜토리얼을 보고 싶어요' +}; + +const answerList = { + mail: `