feat(project): 댓글 속 웹페이지 주소를 새 탭 링크로 + 주소 붙여넣기 보장

- 작업 팝업 댓글 목록·댓글 대화창 본문을 linkifyToHtml 로 그린다
  (https://… / www.… → target=_blank rel=noopener 링크, 나머지는 이스케이프)
- 대화창 입력칸 붙여넣기: 클립보드에 글자가 있으면 글자 우선(글자+그림을
  함께 복사하는 프로그램에서 주소가 그림으로 가로채이던 문제), 그림만 있을 때 첨부
- 정적 파일 버전 20260925j

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 20:06:49 +09:00
parent b324a9c413
commit 87c73c65af
7 changed files with 22 additions and 12 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<link rel="stylesheet" href="/static/project.css?v=20260925j" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -99,5 +99,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925i" defer></script>
<script src="/static/project.js?v=20260925j" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<link rel="stylesheet" href="/static/project.css?v=20260925j" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -98,5 +98,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20260925i" defer></script>
<script src="/static/project.js?v=20260925j" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<link rel="stylesheet" href="/static/project.css?v=20260925j" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -465,5 +465,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260925i" defer></script>
<script src="/static/project.js?v=20260925j" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<link rel="stylesheet" href="/static/project.css?v=20260925j" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -68,5 +68,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925i" defer></script>
<script src="/static/project.js?v=20260925j" defer></script>
{% endblock %}
+3
View File
@@ -638,6 +638,9 @@
.pj-comment-head { font-size: 12.5px; font-weight: 700; color: #1e1f21; }
.pj-comment-time { font-weight: 400; color: #9aa1a9; font-size: 11px; margin-left: 6px; }
.pj-comment-body { font-size: 13px; color: #333; margin-top: 1px; white-space: pre-wrap; }
/* 댓글 속 웹페이지 주소 — 누르면 새 탭(linkifyToHtml). 긴 주소는 줄바꿈 */
.pj-comment-body a, .pj-chat-bubble a { color: #1a5fd0; text-decoration: underline; word-break: break-all; }
.pj-comment-body a:hover, .pj-chat-bubble a:hover { color: #0b3f99; }
.pj-comment-form { display: flex; align-items: center; gap: 6px; }
.pj-comment-form input { flex: 1; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.pj-comment-acts { display: inline-flex; gap: 1px; flex: 0 0 auto; }
+8 -3
View File
@@ -1214,7 +1214,11 @@
const cmInput = el("pj-cm-input");
attachMentionInput(cmInput);
if (cmInput) cmInput.addEventListener("paste", function (e) {
const items = (e.clipboardData || window.clipboardData || {}).items || [];
const cd = e.clipboardData || window.clipboardData || {};
// 글자(웹페이지 주소 등)가 있으면 글자 붙여넣기가 먼저 — 일부 프로그램은 복사할 때
// 글자와 함께 그림도 넣어서, 예전엔 그림으로 가로채 주소가 안 붙었다.
if (cd.getData && cd.getData("text/plain")) return;
const items = cd.items || [];
let handled = false;
for (let i = 0; i < items.length; i++) {
if (items[i].type && items[i].type.indexOf("image/") === 0) {
@@ -1291,7 +1295,7 @@
inner +
"</div>";
const bubble = li.querySelector(".pj-chat-bubble");
if (bubble) bubble.textContent = c.body;
if (bubble) bubble.innerHTML = linkifyToHtml(c.body); // 주소 → 새 탭 링크(나머지는 이스케이프)
if (mine) {
li.querySelector(".pj-chat-del").addEventListener("click", async function () {
if (!confirm("이 댓글을 삭제할까요? 첨부된 파일도 함께 삭제됩니다.")) return;
@@ -4465,7 +4469,8 @@
'<button type="button" class="pj-icon-btn pj-comment-edit" title="수정">✎</button>' +
'<button type="button" class="pj-icon-btn pj-comment-del" title="삭제">×</button>' +
"</span>";
li.querySelector(".pj-comment-body").textContent = c.body; // XSS 안전(textContent)
// 주소 → 새 탭 링크. linkifyToHtml 이 나머지 글자를 전부 이스케이프하므로 XSS 안전.
li.querySelector(".pj-comment-body").innerHTML = linkifyToHtml(c.body);
li.querySelector(".pj-comment-del").addEventListener("click", async function () {
try { await api("DELETE", "/project/api/comments/" + c.id); loadComments(taskId); }
catch (e) { alert("삭제 실패: " + e.message); }
+3 -1
View File
@@ -117,7 +117,9 @@
> **댓글 말풍선(💬 N) 규칙** — 보드 카드·목록 행·캘린더 막대·내 작업 어디서든 **한 번 클릭**으로 댓글
> 대화창(`#pj-modal-comments`, `initCommentsChat`)이 열린다. `.pj-cmt-badge[data-task-id]` 만 달면
> 문서 캡처 단계 클릭 처리가 카드/행 클릭(작업 열기)보다 먼저 받아 막으므로 따로 연결할 필요 없다
> (`wireBadge` 는 안 읽음 표시만).
> (`wireBadge` 는 안 읽음 표시만). 댓글 본문의 웹페이지 주소(`https://…`, `www.…`)는 작업 팝업 댓글·
> 대화창 모두 `linkifyToHtml` 로 새 탭 링크가 된다(나머지 글자는 이스케이프). 대화창 입력칸 붙여넣기는
> 글자가 있으면 글자 우선, 그림만 있을 때 첨부.
>
> **담당자 고르기 규칙 — 모든 화면·앞으로 추가하는 기능 공통.** 담당자를 고르는 곳은 항상 "아이콘 + 이름".
> 팝업 메뉴는 `assigneeMenuItems(emails, cur, onPick)` + `showContextMenu`(항목 `icon`/`checked` 지원), 폼의