feat(project): 설명 체크박스를 글머리 목록처럼(체크리스트) + 작업 창 스크롤바 정리

- ☑ = 체크리스트 켜기/끄기: 지금 줄(고른 줄들)을 <ul class="pj-checklist"> 로,
  줄마다 체크박스. Enter 로 새 줄에도 체크박스, 빈 줄 Enter 는 목록 끝.
  체크리스트 안에서 글머리·번호 버튼은 체크박스를 빼고 그 목록으로.
  체크한 줄은 흐리게 + 취소선
- 서버 정리기: ul 의 class 는 pj-checklist 하나만 허용(태그별 허용 class 표)
- 작업 창 스크롤 영역: 가로 스크롤 제거(설명란 음수 여백 때문에 생기던 것),
  오른쪽 여백까지 넓혀 세로 스크롤바를 창 오른쪽 끝으로
- 도움말 8장 체크리스트 설명 갱신, 정적 파일 버전 20260926q

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 14:32:58 +09:00
parent f8ff75127b
commit 5b0c5905b2
8 changed files with 144 additions and 19 deletions
+11 -1
View File
@@ -501,7 +501,14 @@
.pj-task-panel-resizer:hover, .pj-task-panel-resizer.is-dragging { background: var(--pj-accent-tint); }
.pj-task-modal-card > .pj-t-title-input { flex: none; }
.pj-task-modal-card .pj-modal-body { flex: 1 1 auto; min-height: 0; }
/* 작업 창 스크롤 영역 — 오른쪽 여백(카드 padding 22px)까지 넓혀 세로 스크롤바를 창 오른쪽 끝에
붙이고, 가로 스크롤은 막는다. 왼쪽도 8px 넓혀 두어 설명란(좌우 음수 여백 8px)의 옅은 바탕이
잘리지 않는다. 안쪽 padding 으로 되돌려 내용 위치는 그대로다. */
.pj-task-modal-card .pj-modal-body {
flex: 1 1 auto; min-height: 0;
overflow-x: hidden; overflow-y: auto;
margin: 0 -22px 0 -8px; padding: 0 22px 0 8px;
}
.pj-task-modal-card .pj-modal-actions { flex: none; }
/* 위에서 아래로 쭉 쌓는 단일 칼럼 — 메타 → 설명 → 하위업무 →
(첨부파일|연결된 프로젝트 2열) → 댓글(팝업 너비 전체) 순서. 각 구간은
@@ -999,6 +1006,9 @@ label.pj-desc-fmtbtn {
display: inline-flex; align-items: center; justify-content: center; margin: 0;
line-height: normal; font-size: 13px; font-weight: 400; color: #444;
}
/* 체크리스트(서식 도구 ☑) — 글머리 기호 대신 줄마다 체크박스. 체크한 줄은 흐리게 + 취소선 */
.pj-desc-editor ul.pj-checklist { list-style: none; padding-left: 2px; }
.pj-desc-editor ul.pj-checklist > li:has(> input[type="checkbox"]:checked) { color: #9aa1a9; text-decoration: line-through; }
/* 설명란 체크박스(서식 도구 ☑) — 누르면 체크/해제, 체크 여부는 저장된다 */
.pj-desc-editor input[type="checkbox"] {
width: 15px; height: 15px; margin: 0 4px 0 1px; vertical-align: -2px; cursor: pointer;
+115 -4
View File
@@ -4977,6 +4977,101 @@
// 크롬/엣지는 여전히 지원하고, 이미 같은 파일의 이미지 삽입에서도 쓰고
// 있어(insertHTML) 일관된 패턴이다. 버튼 mousedown 에서 preventDefault
// 안 하면 클릭 순간 에디터가 포커스를 잃어 선택 범위가 풀린다.
// ── 체크리스트(서식 도구 ☑) — 글머리 목록처럼 줄마다 체크박스.
// <ul class="pj-checklist"><li><input type="checkbox">할 일</li>…</ul>
// (서버 정리기는 ul 의 class 로 pj-checklist 하나만, input 은 체크박스·checked 만 남긴다)
function selNode() {
const sel = window.getSelection();
if (!sel || !sel.rangeCount) return null;
const n = sel.getRangeAt(0).startContainer;
return n.nodeType === 1 ? n : n.parentElement;
}
function closestIn(n, selector) {
const x = n && n.closest ? n.closest(selector) : null;
return x && box.contains(x) ? x : null;
}
// 줄(li) 맨 앞의 체크박스(앞의 빈 글자는 건너뜀)
function leadingBox(li) {
for (let c = li.firstChild; c; c = c.nextSibling) {
if (c.nodeType === 3 && !c.nodeValue.replace(/[\s\u00a0\u200b]/g, "")) continue;
return (c.nodeType === 1 && c.tagName === "INPUT" && c.type === "checkbox") ? c : null;
}
return null;
}
function caretAfter(node) {
const r = document.createRange();
r.setStartAfter(node); r.collapse(true);
const sel = window.getSelection();
sel.removeAllRanges(); sel.addRange(r);
}
function ensureBox(li) {
let cb = leadingBox(li);
if (!cb) { cb = document.createElement("input"); cb.type = "checkbox"; li.insertBefore(cb, li.firstChild); }
return cb;
}
function selectedItems(listEl) {
const sel = window.getSelection();
const r = sel && sel.rangeCount ? sel.getRangeAt(0) : null;
const items = Array.prototype.filter.call(listEl.children, function (li) {
return li.tagName === "LI" && r && r.intersectsNode(li);
});
if (!items.length) { const li = closestIn(selNode(), "li"); if (li) items.push(li); }
return items;
}
// 체크박스가 하나도 없는 체크리스트는 평범한 목록으로, 줄마다 체크박스가 있는 ul 은 체크리스트로
function normalizeChecklists() {
box.querySelectorAll("ul").forEach(function (ul) {
const lis = Array.prototype.filter.call(ul.children, function (x) { return x.tagName === "LI"; });
const withBox = lis.filter(function (li) { return leadingBox(li); }).length;
if (ul.classList.contains("pj-checklist") && !withBox) ul.classList.remove("pj-checklist");
else if (lis.length && withBox === lis.length) ul.classList.add("pj-checklist");
if (!ul.className) ul.removeAttribute("class");
});
}
function toggleChecklist() {
const cur = closestIn(selNode(), "ul.pj-checklist");
if (cur) {
// 끄기 — 고른 줄의 체크박스를 빼고 목록에서 뺀다(글머리 버튼을 다시 누른 것과 같음)
selectedItems(cur).forEach(function (li) { const cb = leadingBox(li); if (cb) cb.remove(); });
try { document.execCommand("insertUnorderedList"); } catch (_) {}
} else {
// 켜기 — 목록이 아니면 먼저 글머리 목록으로 만든 뒤(번호 목록이면 글머리로 바뀜),
// 그 목록의 줄마다 체크박스
if (!closestIn(selNode(), "ul")) { try { document.execCommand("insertUnorderedList"); } catch (_) {} }
const ul = closestIn(selNode(), "ul");
if (ul) {
ul.classList.add("pj-checklist");
Array.prototype.forEach.call(ul.children, function (li) { if (li.tagName === "LI") ensureBox(li); });
const li = closestIn(selNode(), "li");
if (li && !li.textContent.replace(/[\s\u00a0\u200b]/g, "")) caretAfter(leadingBox(li));
}
}
normalizeChecklists();
}
// 체크리스트 줄에서 Enter — 새 줄에도 체크박스(체크 안 된 채). 빈 줄에서 Enter 는 목록 끝.
box.addEventListener("keydown", function (e) {
if (e.key !== "Enter" || e.shiftKey || e.isComposing) return;
const li = closestIn(selNode(), "ul.pj-checklist > li");
if (!li) return;
if (!li.textContent.replace(/[\s\u00a0\u200b]/g, "")) {
e.preventDefault();
const cb = leadingBox(li);
if (cb) cb.remove();
try { document.execCommand("insertUnorderedList"); } catch (_) {}
normalizeChecklists();
box.dispatchEvent(new Event("input", { bubbles: true }));
return;
}
setTimeout(function () {
const nli = closestIn(selNode(), "ul.pj-checklist > li");
if (!nli || nli === li) return;
let cb = leadingBox(nli);
if (!cb) { cb = ensureBox(nli); caretAfter(cb); }
else if (cb.hasAttribute("checked")) { cb.removeAttribute("checked"); cb.checked = false; }
box.dispatchEvent(new Event("input", { bubbles: true }));
}, 0);
});
const fmtbar = el("pj-desc-fmtbar");
if (fmtbar) {
fmtbar.addEventListener("mousedown", function (e) { e.preventDefault(); });
@@ -4990,12 +5085,23 @@
arg = prompt("연결할 주소(URL)를 입력하세요", "https://");
if (!arg) return;
}
// 체크박스 — 커서 자리에 체크박스 하나 + 공백. 누르면 체크/해제(아래 클릭 처리).
// 체크리스트 — 글머리 목록처럼 켜고 끈다(줄마다 체크박스).
if (cmd === "insertCheckbox") {
try { document.execCommand("insertHTML", false, '<input type="checkbox">&nbsp;'); } catch (_) {}
toggleChecklist();
box.dispatchEvent(new Event("input", { bubbles: true }));
updateFmtState();
return;
}
// 체크리스트 안에서 글머리/번호 버튼 — 체크박스를 빼고 그 목록으로 바꾼다.
if (cmd === "insertUnorderedList" || cmd === "insertOrderedList") {
const cl = closestIn(selNode(), "ul.pj-checklist");
if (cl) {
Array.prototype.forEach.call(cl.children, function (li) { const cb = li.tagName === "LI" && leadingBox(li); if (cb) cb.remove(); });
cl.classList.remove("pj-checklist");
if (!cl.className) cl.removeAttribute("class");
if (cmd === "insertUnorderedList") { box.dispatchEvent(new Event("input", { bubbles: true })); updateFmtState(); return; }
}
}
try { document.execCommand(cmd, false, arg); } catch (_) {}
if (cmd === "createLink") normalizeEditorLinks(box);
updateFmtState();
@@ -5003,9 +5109,14 @@
function updateFmtState() {
fmtbar.querySelectorAll(".pj-desc-fmtbtn[data-cmd]").forEach(function (btn) {
const cmd = btn.dataset.cmd;
if (cmd === "createLink" || cmd === "removeFormat" || cmd === "insertCheckbox") return;
if (cmd === "createLink" || cmd === "removeFormat") return;
const inChecklist = !!closestIn(selNode(), "ul.pj-checklist");
let active = false;
try { active = document.queryCommandState(cmd); } catch (_) { active = false; }
if (cmd === "insertCheckbox") active = inChecklist;
else {
try { active = document.queryCommandState(cmd); } catch (_) { active = false; }
if (cmd === "insertUnorderedList" && inChecklist) active = false;
}
btn.classList.toggle("is-active", active);
});
}