feat(project): asana icons, 12-col colors, bold sections, all-view menu, desc text color/size
- Project edit modal: color palette 12 columns; icon tabs [기본 아이콘] / [아사나 아이콘] (33 filled icons, value "asana:<name>", 6KB subset font material-symbols-asana.woff2) - Section names bold (board column, list group, rename input) - Inbox: clicking the left inbox area closes the task side panel - Replace top-right scope toggle with admin-only sidebar "전체 보기" (?scope=all, switches in place on project pages) - Description editor: text color and size; server keeps only validated color / font-size on plain spans (desc_inline_style) - Fix goals_meeting_ui [2e] for manual monthly target; bump asset versions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+166
-20
@@ -1202,29 +1202,57 @@
|
||||
return function () { return selected; };
|
||||
}
|
||||
|
||||
// ── 프로젝트 아이콘(아사나식) — window.PJ_ICONS(Material Symbols 이름) 격자.
|
||||
// 첫 칸 "Aa" = 아이콘 없음(프로젝트 색 + 이름 첫 글자). 반환 = 지금 고른 이름("" = 없음).
|
||||
// ── 프로젝트 아이콘(아사나식) — [기본 아이콘] window.PJ_ICONS(Material Symbols 외곽선) /
|
||||
// [아사나 아이콘] window.PJ_ASANA_ICONS(채워진 모양, 값은 "asana:" + 이름) 두 탭. 탭은 "아이콘" 글자 오른쪽(.pj-icon-tabs).
|
||||
// 첫 칸 "Aa" = 아이콘 없음(프로젝트 색 + 이름 첫 글자). 반환 = 지금 고른 값("" = 없음).
|
||||
const ASANA_IC = "asana:";
|
||||
function projIconSpan(icon, cls) {
|
||||
const v = String(icon || ""), a = v.indexOf(ASANA_IC) === 0;
|
||||
return '<span class="material-symbols-outlined' + (cls ? " " + cls : "") + (a ? " pj-ic-asana" : "") + '">' +
|
||||
escapeHtml(a ? v.slice(ASANA_IC.length) : v) + "</span>";
|
||||
}
|
||||
function renderIconPalette(container, initial) {
|
||||
if (!container) return function () { return ""; };
|
||||
const icons = window.PJ_ICONS || [];
|
||||
let selected = initial && icons.indexOf(initial) >= 0 ? initial : "";
|
||||
container.innerHTML = [""].concat(icons).map(function (ic) {
|
||||
return '<button type="button" class="pj-icon-pick' + (ic === selected ? " is-active" : "") +
|
||||
'" data-icon="' + ic + '" title="' + (ic ? "아이콘" : "아이콘 없음(첫 글자)") + '">' +
|
||||
(ic ? '<span class="material-symbols-outlined">' + ic + "</span>" : '<span class="pj-icon-pick-aa">Aa</span>') +
|
||||
"</button>";
|
||||
}).join("");
|
||||
container.querySelectorAll(".pj-icon-pick").forEach(function (b) {
|
||||
b.addEventListener("click", function () {
|
||||
selected = b.dataset.icon;
|
||||
container.querySelectorAll(".pj-icon-pick").forEach(function (x) { x.classList.toggle("is-active", x === b); });
|
||||
});
|
||||
});
|
||||
const basic = window.PJ_ICONS || [];
|
||||
const asana = (window.PJ_ASANA_ICONS || []).map(function (n) { return ASANA_IC + n; });
|
||||
const known = basic.concat(asana);
|
||||
let selected = initial && known.indexOf(initial) >= 0 ? initial : "";
|
||||
let tab = selected.indexOf(ASANA_IC) === 0 ? "asana" : "basic";
|
||||
const tabsHost = container.parentElement && container.parentElement.querySelector(".pj-icon-tabs");
|
||||
function paint() {
|
||||
if (tabsHost) {
|
||||
tabsHost.innerHTML = asana.length
|
||||
? '<button type="button" class="pj-icon-tab' + (tab === "basic" ? " is-active" : "") + '" data-tab="basic">기본 아이콘</button>' +
|
||||
'<button type="button" class="pj-icon-tab' + (tab === "asana" ? " is-active" : "") + '" data-tab="asana">아사나 아이콘</button>'
|
||||
: "";
|
||||
}
|
||||
const list = tab === "asana" ? asana : basic;
|
||||
container.innerHTML = '<div class="pj-icon-grid">' + [""].concat(list).map(function (ic) {
|
||||
return '<button type="button" class="pj-icon-pick' + (ic === selected ? " is-active" : "") +
|
||||
'" data-icon="' + escapeHtml(ic) + '" title="' + (ic ? "아이콘" : "아이콘 없음(첫 글자)") + '">' +
|
||||
(ic ? projIconSpan(ic) : '<span class="pj-icon-pick-aa">Aa</span>') + "</button>";
|
||||
}).join("") + "</div>";
|
||||
}
|
||||
container.onclick = function (e) {
|
||||
const b = e.target.closest(".pj-icon-pick");
|
||||
if (!b) return;
|
||||
selected = b.dataset.icon;
|
||||
container.querySelectorAll(".pj-icon-pick").forEach(function (x) { x.classList.toggle("is-active", x === b); });
|
||||
};
|
||||
if (tabsHost) {
|
||||
tabsHost.onclick = function (e) {
|
||||
const t = e.target.closest(".pj-icon-tab");
|
||||
if (!t || t.dataset.tab === tab) return;
|
||||
tab = t.dataset.tab;
|
||||
paint();
|
||||
};
|
||||
}
|
||||
paint();
|
||||
return function () { return selected; };
|
||||
}
|
||||
// 프로젝트 배지 안쪽 — 아이콘이 있으면 흰 아이콘, 없으면 이름 첫 글자(사이드바 목록·제목 공용).
|
||||
function projBadgeInner(p) {
|
||||
if (p && p.icon) return '<span class="material-symbols-outlined pj-proj-ic">' + escapeHtml(p.icon) + "</span>";
|
||||
if (p && p.icon) return projIconSpan(p.icon, "pj-proj-ic");
|
||||
return escapeHtml(((p && p.name) || "?").trim().charAt(0).toUpperCase() || "?");
|
||||
}
|
||||
|
||||
@@ -3112,7 +3140,7 @@
|
||||
const pillEl = document.querySelector(".pj-project-title-pill");
|
||||
if (pillEl) {
|
||||
pillEl.innerHTML =
|
||||
'<span class="material-symbols-outlined pj-pill-ic">' + escapeHtml(currentProject.icon || "folder") + "</span>" +
|
||||
projIconSpan(currentProject.icon || "folder", "pj-pill-ic") +
|
||||
'<span class="pj-pill-name">' + escapeHtml(currentProject.name || "") + "</span>";
|
||||
pillEl.style.setProperty("--pj-color", currentProject.color || "#4573d2");
|
||||
pillEl.classList.toggle("is-light", isLightColor(currentProject.color || "#4573d2"));
|
||||
@@ -3365,6 +3393,32 @@
|
||||
});
|
||||
}
|
||||
if (moveScopeHighlight) moveScopeHighlight(false);
|
||||
// 전체 보기(2026-10-08) — 오른쪽 위 토글 대신 왼쪽 메뉴 "전체 보기"(관리자만, ?scope=all). 토글은 숨겨 두고 상태만 쓴다.
|
||||
const allViewLink = el("pj-side-allview");
|
||||
function applyAllScope(on) {
|
||||
viewScope = on ? "all" : "project";
|
||||
if (scopeToggle) scopeToggle.querySelectorAll("[data-scope]").forEach(function (b) {
|
||||
b.classList.toggle("is-active", b.dataset.scope === viewScope);
|
||||
});
|
||||
const titleWrap = el("pj-title-wrap");
|
||||
if (titleWrap) titleWrap.classList.toggle("is-all-scope", on);
|
||||
if (allViewLink) allViewLink.classList.toggle("is-active", on);
|
||||
document.querySelectorAll(".pj-tree-li[data-id='" + projectId + "'] > .pj-tree-row").forEach(function (r) {
|
||||
r.classList.toggle("is-active", !on);
|
||||
});
|
||||
}
|
||||
if (isAdmin && new URLSearchParams(location.search).get("scope") === "all") applyAllScope(true); // 첫 그리기 전에
|
||||
if (allViewLink && isAdmin) {
|
||||
allViewLink.addEventListener("click", function (e) {
|
||||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.button === 1) return;
|
||||
e.preventDefault(); // 같은 화면 안에서 바로 전환
|
||||
applyAllScope(true);
|
||||
try { const u = new URL(location.href); u.searchParams.set("scope", "all"); history.replaceState(null, "", u); } catch (_) {}
|
||||
fillAssigneeFilter();
|
||||
renderView(currentView);
|
||||
updateFilterSummary();
|
||||
});
|
||||
}
|
||||
|
||||
let calResizeTimer = null;
|
||||
window.addEventListener("resize", function () {
|
||||
@@ -7479,6 +7533,11 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 글자 색·크기 — 고르는 창을 띄우고, 고르면 선택한 글자에 적용
|
||||
if (cmd === "textColor" || cmd === "textSize") {
|
||||
openStylePop(btn, cmd);
|
||||
return;
|
||||
}
|
||||
// 체크리스트 — 글머리 목록처럼 켜고 끈다(줄마다 체크박스).
|
||||
if (cmd === "insertCheckbox") {
|
||||
toggleChecklist();
|
||||
@@ -7500,10 +7559,92 @@
|
||||
if (cmd === "createLink") normalizeEditorLinks(box);
|
||||
updateFmtState();
|
||||
});
|
||||
// ── 글자 색·크기(2026-10-08) — execCommand 가 만든 <font> 를 곧바로 <span style> 로 바꾼다
|
||||
// (서버 sanitize 는 span 의 color·font-size 만 받는다, store.desc_inline_style). "기본"은 표시용 색(#010203)·
|
||||
// 크기 7 로 한 번 감싼 뒤 그 범위 안의 색/크기를 모두 지운다.
|
||||
const TEXT_COLORS = [
|
||||
["", "기본"], ["#e03e3e", "빨강"], ["#d9730d", "주황"], ["#dfab01", "노랑"], ["#0f7b6c", "초록"],
|
||||
["#0b6e99", "파랑"], ["#4573d2", "하늘"], ["#6940a5", "보라"], ["#ad1a72", "분홍"], ["#787774", "회색"],
|
||||
];
|
||||
const TEXT_SIZES = [["12px", "작게"], ["", "보통"], ["18px", "크게"], ["22px", "더 크게"], ["28px", "제목"]];
|
||||
const RESET_COLOR = "#010203";
|
||||
let stylePop = null;
|
||||
function closeStylePop() {
|
||||
if (!stylePop) return;
|
||||
stylePop.remove();
|
||||
stylePop = null;
|
||||
document.removeEventListener("mousedown", onStyleDoc, true);
|
||||
}
|
||||
function onStyleDoc(e) { if (stylePop && !stylePop.contains(e.target) && !e.target.closest(".pj-desc-fmtbtn")) closeStylePop(); }
|
||||
function stripInside(node, prop) {
|
||||
node.querySelectorAll("span[style]").forEach(function (sp) {
|
||||
sp.style.removeProperty(prop);
|
||||
if (!sp.getAttribute("style")) sp.removeAttribute("style");
|
||||
});
|
||||
}
|
||||
function fontsToSpans(kind, value) {
|
||||
box.querySelectorAll("font").forEach(function (f) {
|
||||
const span = document.createElement("span");
|
||||
const c = (f.getAttribute("color") || "").toLowerCase(), sz = f.getAttribute("size");
|
||||
while (f.firstChild) span.appendChild(f.firstChild);
|
||||
if (c) {
|
||||
if (kind === "color") stripInside(span, "color");
|
||||
if (c !== RESET_COLOR) span.style.color = c;
|
||||
}
|
||||
if (sz === "7" && kind === "size") {
|
||||
stripInside(span, "font-size");
|
||||
if (value) span.style.fontSize = value;
|
||||
}
|
||||
if (span.getAttribute("style")) f.replaceWith(span);
|
||||
else f.replaceWith.apply(f, Array.prototype.slice.call(span.childNodes));
|
||||
});
|
||||
}
|
||||
function applyTextStyle(kind, value, range) {
|
||||
box.focus();
|
||||
const sel = window.getSelection();
|
||||
if (range) { sel.removeAllRanges(); sel.addRange(range); }
|
||||
if (!sel.rangeCount || sel.isCollapsed) { showToast("바꿀 글자를 먼저 선택하세요.", "info"); return; }
|
||||
try { document.execCommand("styleWithCSS", false, false); } catch (_) {}
|
||||
try {
|
||||
if (kind === "color") document.execCommand("foreColor", false, value || RESET_COLOR);
|
||||
else document.execCommand("fontSize", false, "7");
|
||||
} catch (_) {}
|
||||
fontsToSpans(kind, value);
|
||||
box.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
}
|
||||
function openStylePop(btn, cmd) {
|
||||
if (stylePop) { const same = stylePop.dataset.cmd === cmd; closeStylePop(); if (same) return; }
|
||||
const sel = window.getSelection();
|
||||
const range = sel && sel.rangeCount && box.contains(sel.anchorNode) ? sel.getRangeAt(0).cloneRange() : null;
|
||||
stylePop = document.createElement("div");
|
||||
stylePop.className = "pj-desc-stylepop" + (cmd === "textColor" ? " is-color" : " is-size");
|
||||
stylePop.dataset.cmd = cmd;
|
||||
stylePop.innerHTML = cmd === "textColor"
|
||||
? TEXT_COLORS.map(function (c) {
|
||||
return '<button type="button" data-v="' + c[0] + '" title="' + c[1] + '">' +
|
||||
'<span class="pj-desc-colorchip" style="color:' + (c[0] || "var(--pj-ink)") + '">가</span></button>';
|
||||
}).join("")
|
||||
: TEXT_SIZES.map(function (z) {
|
||||
return '<button type="button" data-v="' + z[0] + '"><span style="font-size:' + (z[0] || "var(--pj-text-size)") + '">' + z[1] + "</span></button>";
|
||||
}).join("");
|
||||
document.body.appendChild(stylePop); // 화면 배율(.pj-ui-scale) 밖 — body 에
|
||||
const r = btn.getBoundingClientRect();
|
||||
stylePop.style.left = Math.max(8, Math.min(r.left, document.documentElement.clientWidth - stylePop.offsetWidth - 8)) + "px";
|
||||
stylePop.style.top = (r.bottom + 4) + "px";
|
||||
stylePop.addEventListener("mousedown", function (e) { e.preventDefault(); }); // 편집칸 선택 유지
|
||||
stylePop.addEventListener("click", function (e) {
|
||||
const b = e.target.closest("button[data-v]");
|
||||
if (!b) return;
|
||||
applyTextStyle(cmd === "textColor" ? "color" : "size", b.dataset.v, range);
|
||||
closeStylePop();
|
||||
updateFmtState();
|
||||
});
|
||||
setTimeout(function () { document.addEventListener("mousedown", onStyleDoc, true); }, 0);
|
||||
}
|
||||
function updateFmtState() {
|
||||
fmtbar.querySelectorAll(".pj-desc-fmtbtn[data-cmd]").forEach(function (btn) {
|
||||
const cmd = btn.dataset.cmd;
|
||||
if (cmd === "createLink" || cmd === "removeFormat") return;
|
||||
if (cmd === "createLink" || cmd === "removeFormat" || cmd === "textColor" || cmd === "textSize") return;
|
||||
const inChecklist = !!closestIn(selNode(), "ul.pj-checklist");
|
||||
let active = false;
|
||||
if (cmd === "insertCheckbox") active = inChecklist;
|
||||
@@ -8490,7 +8631,12 @@
|
||||
// 캡처 단계 — 각 목록의 읽음 처리(버블 단계)는 그대로 돈다.
|
||||
document.addEventListener("click", function (e) {
|
||||
const a = e.target.closest && e.target.closest(".pj-inbox-go[data-task-id]");
|
||||
if (!a) return;
|
||||
if (!a) {
|
||||
// 작업 창이 열린 채 왼쪽 수신함 영역을 누르면 작업 창을 닫는다(2026-10-08). 메뉴·모달·알림 팝업 안은 제외.
|
||||
if (panel && panel.classList.contains("is-open") && e.target.closest &&
|
||||
e.target.closest(".pj-inbox-view") && !e.target.closest(".pj-inbox-panel, .pj-modal, .pj-ctxmenu, .pj-alert-pop")) close();
|
||||
return;
|
||||
}
|
||||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.button === 1) return; // 새 탭 열기는 그대로
|
||||
e.preventDefault();
|
||||
open(a.getAttribute("href"), a.closest(".pj-inbox-item"));
|
||||
|
||||
Reference in New Issue
Block a user