feat(project): 댓글 사진을 누르면 이미지 창(100%·끌어 이동·휠 확대·다운로드·원본 보기)
- 댓글 목록·댓글 대화창의 사진 클릭 = 내려받기 대신 이미지 창(처음 원본 100%) - 이미지 창에 [다운로드] 단추, "1:1" 단추 이름을 [원본 보기]로 - Ctrl·Shift·가운데 클릭은 예전처럼 링크, 도움말·브라우저 테스트 추가 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3374,3 +3374,6 @@ button.pj-meet-quick-open:hover { background: #f1f3f5; color: var(--pj-accent-da
|
||||
.pj-meet-quick-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
|
||||
.pj-meet-quick-modal .pj-meet-quick-table { font-size: 14px; }
|
||||
.pj-meet-quick-modal .pj-meet-quick-table th { font-size: 13px; padding: 6px 8px; }
|
||||
|
||||
/* 댓글 사진 — 누르면 이미지 창(100%·끌어 이동·휠 확대·다운로드·원본 보기, 2026-10-22) */
|
||||
.pj-comment-att-img img, .pj-chat-att-img img { cursor: zoom-in; }
|
||||
|
||||
+25
-5
@@ -2350,7 +2350,10 @@
|
||||
// 창 크기 = 이미지 원본 크기(+ 여백·도구 막대), 화면보다 크면 화면 95% 까지. 처음엔 원본(100%), 창보다 크면 창에 맞춤.
|
||||
// 창 안: 휠 = 마우스 위치 기준 확대·축소, 끌기 = 이동, 아래 막대 − / % / + · 1:1(원본) · 맞춤,
|
||||
// 더블클릭 = 원본 ↔ 맞춤, 키보드 + − 0(맞춤) 1(원본). 이미지는 같은 서버 첨부 주소라 로그인 쿠키로 그대로 열린다.
|
||||
function openImageWindow(img) {
|
||||
// opts(2026-10-22 댓글 사진) — actual: 창보다 커도 처음부터 100%(원본)로(끌어서 이동), download: 다운로드 주소(막대에 [다운로드]),
|
||||
// name: 창 제목·파일 이름. 막대의 [원본 보기] = 100% 로 되돌리기(예전 "1:1").
|
||||
function openImageWindow(img, opts) {
|
||||
opts = opts || {};
|
||||
const src = new URL(img.getAttribute("src") || img.src, location.href).href;
|
||||
const nw = img.naturalWidth || 1200, nh = img.naturalHeight || 800;
|
||||
const sw = (window.screen && screen.availWidth) || 1600, sh = (window.screen && screen.availHeight) || 900;
|
||||
@@ -2361,7 +2364,8 @@
|
||||
const win = window.open("", "pj-img-" + Date.now(),
|
||||
"popup=yes,width=" + w + ",height=" + h + ",left=" + left + ",top=" + top + ",resizable=yes,scrollbars=no");
|
||||
if (!win) { showToast("팝업이 막혀 있습니다. 브라우저 주소창 오른쪽에서 이 사이트의 팝업을 허용해 주세요.", "error"); return; }
|
||||
const title = (img.getAttribute("alt") || "").trim() || decodeURIComponent((src.split("?")[0].split("/").pop() || "이미지"));
|
||||
const title = (opts.name || img.getAttribute("alt") || "").trim() || decodeURIComponent((src.split("?")[0].split("/").pop() || "이미지"));
|
||||
const dl = opts.download ? new URL(opts.download, location.href).href : "";
|
||||
const ICON = function (d) {
|
||||
return '<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">' + d + "</svg>";
|
||||
};
|
||||
@@ -2374,6 +2378,8 @@
|
||||
'background:rgba(40,42,47,.92);border:1px solid rgba(255,255,255,.08);border-radius:10px;box-shadow:0 6px 18px rgba(0,0,0,.35);z-index:2}' +
|
||||
'#bar button{height:30px;min-width:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:#fff;cursor:pointer;' +
|
||||
'display:inline-flex;align-items:center;justify-content:center;font-family:inherit;font-weight:600;font-size:12.5px}' +
|
||||
'#bar a{height:30px;padding:0 10px;border-radius:7px;color:#fff;text-decoration:none;display:inline-flex;align-items:center;gap:4px;font-weight:600;font-size:12.5px}' +
|
||||
'#bar a:hover{background:rgba(255,255,255,.14)}#bar a:focus-visible{outline:2px solid #9d8cff;outline-offset:1px}' +
|
||||
'#bar button:hover{background:rgba(255,255,255,.14)}#bar button:focus-visible{outline:2px solid #9d8cff;outline-offset:1px}' +
|
||||
'#pct{min-width:56px;text-align:center;font-size:13px;font-variant-numeric:tabular-nums}' +
|
||||
'.sep{width:1px;height:18px;background:rgba(255,255,255,.18);margin:0 4px}' +
|
||||
@@ -2387,10 +2393,13 @@
|
||||
'<button id="out" title="축소 (−)" aria-label="축소">' + ICON('<path d="M5 10h10"/>') + "</button>" +
|
||||
'<span id="pct">100%</span>' +
|
||||
'<button id="in" title="확대 (+)" aria-label="확대">' + ICON('<path d="M5 10h10M10 5v10"/>') + "</button>" +
|
||||
'<span class="sep"></span><button id="one" title="원본 크기 (1)">1:1</button><button id="fit" title="창에 맞춤 (0)">맞춤</button>' +
|
||||
'<span class="sep"></span><button id="one" title="원본 크기 100% (1)">원본 보기</button><button id="fit" title="창에 맞춤 (0)">맞춤</button>' +
|
||||
'<span class="sep"></span><button id="copy" title="이미지 복사 (Ctrl+C) — 카카오톡·한글·그림판 등에 그림으로 붙여넣기" aria-label="이미지 복사">' +
|
||||
ICON('<rect x="7" y="7" width="10" height="10" rx="1.6"/><path d="M13 7V4.6A1.6 1.6 0 0 0 11.4 3H4.6A1.6 1.6 0 0 0 3 4.6v6.8A1.6 1.6 0 0 0 4.6 13H7"/>') +
|
||||
' 복사</button></div>' +
|
||||
' 복사</button>' +
|
||||
(dl ? '<a id="dl" href="' + dl.replace(/"/g, """) + '" download title="이미지 파일 내려받기">' +
|
||||
ICON('<path d="M10 3v10M6 9l4 4 4-4M4 16h12"/>') + " 다운로드</a>" : "") +
|
||||
"</div>" +
|
||||
"<script>(function(){" +
|
||||
"var SRC=" + JSON.stringify(src) + ",TITLE=" + JSON.stringify(title) + ";document.title=TITLE;" +
|
||||
"var img=document.getElementById('img'),stage=document.getElementById('stage'),pct=document.getElementById('pct');" +
|
||||
@@ -2399,7 +2408,7 @@
|
||||
"function zoomAt(n,cx,cy){n=Math.min(MAX,Math.max(MIN,n));x=cx-(cx-x)*n/s;y=cy-(cy-y)*n/s;s=n;apply();}" +
|
||||
"function centerAt(n){s=n;x=(innerWidth-img.naturalWidth*s)/2;y=(innerHeight-BAR-img.naturalHeight*s)/2+4;if(y<8)y=8;apply();}" +
|
||||
"function fitScale(){return Math.min((innerWidth-32)/img.naturalWidth,(innerHeight-BAR-24)/img.naturalHeight);}" +
|
||||
"img.onload=function(){var f=fitScale();centerAt(f<1?f:1);};" +
|
||||
"img.onload=function(){var f=fitScale();centerAt(" + (opts.actual ? "1" : "f<1?f:1") + ");};" +
|
||||
"img.onerror=function(){document.getElementById('err').style.display='flex';};img.src=SRC;" +
|
||||
"stage.addEventListener('wheel',function(e){e.preventDefault();zoomAt(s*Math.exp(-e.deltaY*0.0015),e.clientX,e.clientY);},{passive:false});" +
|
||||
"var drag=null;stage.addEventListener('pointerdown',function(e){if(e.button!==0)return;drag={x:e.clientX,y:e.clientY,ox:x,oy:y};stage.setPointerCapture(e.pointerId);stage.classList.add('drag');});" +
|
||||
@@ -2434,6 +2443,17 @@
|
||||
try { win.focus(); } catch (_) {}
|
||||
}
|
||||
|
||||
// ── 댓글에 첨부된 사진(업무 창 댓글 목록·댓글 대화창) — 누르면 내려받지 않고 이미지 창(100%, 끌어 이동·휠 확대·다운로드·원본 보기)
|
||||
// 으로 연다(2026-10-22). Ctrl·Shift·가운데 단추로 누르면 예전처럼 링크(새 탭·다운로드)로.
|
||||
document.addEventListener("click", function (e) {
|
||||
const a = e.target.closest && e.target.closest("a.pj-comment-att-img, .pj-chat-att-img a");
|
||||
if (!a || e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;
|
||||
const img = a.querySelector("img");
|
||||
if (!img) return;
|
||||
e.preventDefault();
|
||||
openImageWindow(img, { actual: true, download: a.getAttribute("href"), name: img.getAttribute("alt") || a.getAttribute("title") || "" });
|
||||
});
|
||||
|
||||
// ── 댓글·답글 입력칸 — 전송·붙여넣기 뒤에도 70px 고정, 긴 글은 내부 스크롤.
|
||||
function fitComposer(ta) {
|
||||
if (!ta || ta.tagName !== "TEXTAREA") return;
|
||||
|
||||
Reference in New Issue
Block a user