v4.3.19-17: 탐정 앱 PDF 편집기 — 파일 자동 오픈 불가를 다운로드 보조로 완화
원인: /pdf-editor-open은 caseId만 전달하고 파일명은 전혀 안 넘김 —
Stirling-PDF(외부 PDF 편집기)의 실제 프론트엔드 번들을 직접 열어봤는데
"token" 쿼리파라미터 하나만 읽고 원격 파일 로드 기능 자체가 없음(자체
storage API는 있지만 별도 로그인 필요, 우리는 미설정). 즉 특정 파일을
자동으로 여는 건 우리 쪽에서 고칠 수 있는 버그가 아니라 외부 툴의
한계임을 확인.
대신 ✏️ 클릭 시 편집기 새창 열기와 동시에 그 파일을 다운로드시켜서,
사용자가 편집기 창에 끌어다 놓기만 하면 되도록 마찰을 최소화. 툴팁도
실제 동작을 정확히 설명하도록 수정.
This commit is contained in:
@@ -911,6 +911,18 @@ function onPriChange(){
|
||||
renderCaseList();saveCases();
|
||||
}
|
||||
function onNotesChange(){/* auto-save on blur */}
|
||||
// Stirling-PDF (the external editor at /pdf-editor) has no supported way to
|
||||
// preload a remote file via URL — confirmed by inspecting its own frontend
|
||||
// bundle, which only reads a "token" query param, nothing file-related. Its
|
||||
// stateful "storage" API exists but requires a login we don't run. So instead
|
||||
// of pretending the file opens automatically, trigger a real download of the
|
||||
// exact same file alongside opening the editor tab, so the user only has to
|
||||
// drag one file (already in Downloads) instead of hunting for it again.
|
||||
function dtDownloadForEditor(url,name){
|
||||
const a=document.createElement('a');
|
||||
a.href=url;a.download=name;a.style.display='none';
|
||||
document.body.appendChild(a);a.click();document.body.removeChild(a);
|
||||
}
|
||||
function handleNotesTab(e){
|
||||
if(e.key!=='Tab')return;
|
||||
e.preventDefault();
|
||||
@@ -1332,7 +1344,7 @@ function renderFileRow(f,name){
|
||||
<span style="flex-shrink:0">${icon}</span>
|
||||
${nameHtml}
|
||||
<span style="font-size:10px;color:var(--muted);flex-shrink:0">${fmtFileSize(f.size)}</span>
|
||||
${isPdf?`<a href="/pdf-editor-open?caseId=${encodeURIComponent(currentCaseId)}" target="_blank" class="dt-cl-del" style="opacity:.7" title="PDF 편집기에서 열기 (수정 후 다운로드하면 사건 폴더에 자동 저장됩니다)">✏️</a>`:''}
|
||||
${isPdf?`<a href="/pdf-editor-open?caseId=${encodeURIComponent(currentCaseId)}" target="_blank" class="dt-cl-del" style="opacity:.7" onclick="dtDownloadForEditor('${escJsAttr(f.url)}','${escJsAttr(f.name)}')" title="PDF 편집기를 새 창에서 엽니다. 이 파일은 자동으로 열리지 않으니(외부 편집기 한계), 다운로드된 파일을 편집기 창에 끌어다 놓으세요. 수정 후 다운로드하면 사건 폴더에 자동 저장됩니다.">✏️</a>`:''}
|
||||
${(f.category==='photo'||isText)?`<button class="dt-cl-del" onclick="dtQuickAddToTimeline('${escJsAttr(f.relPath)}',this)" title="날짜 인식 (타임라인 탭에서 확인 후 추가)">🕐+</button>
|
||||
<button class="dt-cl-del" onclick="dtManualDateSuggest('${escJsAttr(f.relPath)}',this)" title="날짜 인식">📅</button>`:''}
|
||||
<button class="dt-cl-del" onclick="deleteFile('${escJsAttr(f.relPath)}')" title="삭제">✕</button>
|
||||
|
||||
Reference in New Issue
Block a user