fix: 실적 표 칸 풍선 도움말 제거 · 댓글 사진 창 기본 맞춤(창에 꽉 차게)

- [실적] 매출 실적·광고비 표 몸통 칸(입력 칸·날짜 칸·광고비 줄)의 title 풍선 도움말 제거(저장 뒤에도 안 붙임), 열 머리글은 그대로
- [프로젝트] 댓글 사진 이미지 창: 처음 = 맞춤, 창 크기 = 사진 비율이라 가장자리 검은 공간 없이 꽉 참,
  막대는 사진 위에 뜸, 창 크기를 바꿔도 맞춤 상태면 다시 맞춤(확대·끌기 뒤엔 그대로)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 12:49:40 +09:00
parent 88c0c961cc
commit 808361b62c
16 changed files with 84 additions and 41 deletions
+1 -3
View File
@@ -712,9 +712,7 @@
td.classList.remove("is-upload", "is-api");
const ro = td.querySelector(".perf-roas"); // 광고비가 바뀌면 ROAS 는 새로고침 때 다시 계산
if (ro) ro.remove();
td.title = res.formula ? "계산식 " + res.formula + " — 눌러 고치기"
: manual !== "" ? "직접 입력값 — 눌러 고치기(비우고 저장하면 " + (FIXED_METRIC ? "지움" : "API 값") + ")"
: "눌러 " + MANUAL_WORD + " 직접 입력";
// 칸 풍선 도움말은 두지 않는다(2026-10-22 사용자 요청) — 설명은 표 아래 안내 문구에
// 총매출·수수료·차감 매출을 바로 바꾼다(기본 보기 = 차감 매출 — 예전엔 총매출만 바뀌어 계산식 결과가 안 보였다).
// 서버가 수수료를 안 돌려주면(광고비) 그 칸만 새로고침 때까지 흐리게.
const shown = { "v-gross": res.amount, "v-commission": res.commission, "v-net": res.net };
+32 -15
View File
@@ -2350,15 +2350,27 @@
// 창 크기 = 이미지 원본 크기(+ 여백·도구 막대), 화면보다 크면 화면 95% 까지. 처음엔 원본(100%), 창보다 크면 창에 맞춤.
// 창 안: 휠 = 마우스 위치 기준 확대·축소, 끌기 = 이동, 아래 막대 − / % / + · 1:1(원본) · 맞춤,
// 더블클릭 = 원본 ↔ 맞춤, 키보드 + − 0(맞춤) 1(원본). 이미지는 같은 서버 첨부 주소라 로그인 쿠키로 그대로 열린다.
// opts(2026-10-22 댓글 사진) — actual: 창보다 커도 처음부터 100%(원본)로(끌어서 이동), download: 다운로드 주소(막대에 [다운로드]),
// name: 창 제목·파일 이름. 막대의 [원본 보기] = 100% 로 되돌리기(예전 "1:1").
// opts(2026-10-22 댓글 사진) — fill: 창 = 사진 비율 그대로·맞춤으로 꽉 차게(가장자리 검은 공간 없음, 막대는 사진 위에 뜸,
// 창 크기를 바꿔도 맞춤 상태면 다시 맞춤), 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;
const w = Math.round(Math.min(Math.max(nw + 48, 560), sw * 0.95)); // 최소 560 — 아래 막대(다운로드 포함)가 한 줄로 다 들어가게
const h = Math.round(Math.min(Math.max(nh + 110, 360), sh * 0.95));
let w, h;
if (opts.fill) {
// 창 안쪽 = 사진 비율 그대로(화면 92%, 높이는 브라우저 머리 약 90px 뺀 만큼 안에서 원본 이하).
// 폭은 최소 560 — 아래 막대(다운로드 포함)가 한 줄로 들어가게, 작은 사진은 그만큼 키워 꽉 채운다.
const maxW = sw * 0.92, maxH = sh * 0.92 - 90;
let sc = Math.min(1, maxW / nw, maxH / nh);
if (nw * sc < 560) sc = Math.min(560 / nw, maxH / nh);
w = Math.max(560, Math.round(nw * sc));
h = Math.round(nh * sc);
} else {
w = Math.round(Math.min(Math.max(nw + 48, 560), sw * 0.95)); // 최소 560 — 아래 막대(다운로드 포함)가 한 줄로 다 들어가게
h = Math.round(Math.min(Math.max(nh + 110, 360), sh * 0.95));
}
const left = Math.round(((window.screenX || 0) + Math.max(0, (window.outerWidth - w) / 2)));
const top = Math.round(((window.screenY || 0) + Math.max(0, (window.outerHeight - h) / 2)));
const win = window.open("", "pj-img-" + Date.now(),
@@ -2405,23 +2417,28 @@
"<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');" +
"var s=1,x=0,y=0,MIN=0.05,MAX=16,BAR=60;" +
"var s=1,x=0,y=0,MIN=0.05,MAX=16,BAR=60,FILL=" + (opts.fill ? "true" : "false") + ",fitted=false;" +
"function apply(){img.style.transform='translate('+x+'px,'+y+'px) scale('+s+')';pct.textContent=Math.round(s*100)+'%';}" +
"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(" + (opts.actual ? "1" : "f<1?f:1") + ");};" +
"function zoomAt(n,cx,cy){fitted=false;n=Math.min(MAX,Math.max(MIN,n));x=cx-(cx-x)*n/s;y=cy-(cy-y)*n/s;s=n;apply();}" +
// FILL(댓글 사진) = 여백·막대 자리 없이 창 전체에 맞춤(막대는 사진 위에 뜬다)
"function centerAt(n){s=n;fitted=false;x=(innerWidth-img.naturalWidth*s)/2;" +
"y=FILL?(innerHeight-img.naturalHeight*s)/2:(innerHeight-BAR-img.naturalHeight*s)/2+4;if(!FILL&&y<8)y=8;apply();}" +
"function fitScale(){return FILL?Math.min(innerWidth/img.naturalWidth,innerHeight/img.naturalHeight)" +
":Math.min((innerWidth-32)/img.naturalWidth,(innerHeight-BAR-24)/img.naturalHeight);}" +
"function fit(){centerAt(fitScale());fitted=true;}" +
"img.onload=function(){var f=fitScale();if(FILL){fit();}else{centerAt(f<1?f:1);}};" +
"addEventListener('resize',function(){if(fitted)fit();});" +
"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');});" +
"stage.addEventListener('pointermove',function(e){if(!drag)return;x=drag.ox+e.clientX-drag.x;y=drag.oy+e.clientY-drag.y;apply();});" +
"stage.addEventListener('pointermove',function(e){if(!drag)return;fitted=false;x=drag.ox+e.clientX-drag.x;y=drag.oy+e.clientY-drag.y;apply();});" +
"function end(){drag=null;stage.classList.remove('drag');}stage.addEventListener('pointerup',end);stage.addEventListener('pointercancel',end);" +
"stage.addEventListener('dblclick',function(e){if(Math.abs(s-1)<0.01){centerAt(fitScale());}else{zoomAt(1,e.clientX,e.clientY);}});" +
"stage.addEventListener('dblclick',function(e){if(Math.abs(s-1)<0.01){fit();}else{zoomAt(1,e.clientX,e.clientY);}});" +
"function mid(){return [innerWidth/2,(innerHeight-BAR)/2];}" +
"document.getElementById('in').onclick=function(){var m=mid();zoomAt(s*1.25,m[0],m[1]);};" +
"document.getElementById('out').onclick=function(){var m=mid();zoomAt(s/1.25,m[0],m[1]);};" +
"document.getElementById('one').onclick=function(){centerAt(1);};" +
"document.getElementById('fit').onclick=function(){centerAt(fitScale());};" +
"document.getElementById('fit').onclick=function(){fit();};" +
// 복사 = PNG 그림만(copyImageToClipboard 와 같은 이유 — 브라우저 기본 "이미지 복사"의 첨부 주소 HTML 은 로그인 없인 안 열림)
"var msg=document.getElementById('msg'),mt=0;" +
"function note(t,bad){msg.textContent=t;msg.className=bad?'show bad':'show';clearTimeout(mt);mt=setTimeout(function(){msg.className=bad?'bad':'';},1800);}" +
@@ -2434,7 +2451,7 @@
"document.getElementById('copy').onclick=copyImg;" +
"addEventListener('keydown',function(e){if((e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(e.code==='KeyC'||e.key==='c'||e.key==='C')){e.preventDefault();copyImg();return;}" +
"var m=mid();if(e.key==='+'||e.key==='='){zoomAt(s*1.25,m[0],m[1]);}else if(e.key==='-'||e.key==='_'){zoomAt(s/1.25,m[0],m[1]);}" +
"else if(e.key==='0'){centerAt(fitScale());}else if(e.key==='1'){centerAt(1);}else if(e.key==='Escape'){window.close();}});" +
"else if(e.key==='0'){fit();}else if(e.key==='1'){centerAt(1);}else if(e.key==='Escape'){window.close();}});" +
"})();<\/script></body></html>";
win.document.open();
win.document.write(html);
@@ -2445,7 +2462,7 @@
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");
@@ -2453,7 +2470,7 @@
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") || "" });
openImageWindow(img, { fill: true, download: a.getAttribute("href"), name: img.getAttribute("alt") || a.getAttribute("title") || "" });
});
// ── 댓글·답글 입력칸 — 전송·붙여넣기 뒤에도 70px 고정, 긴 글은 내부 스크롤.