Remove PDF download from translation UI
This commit is contained in:
1 parent
e0a48122ba
commit
d37d303f78
2 files changed
+1
-56
No files matched your search
@@ -169,7 +169,6 @@
|
||||
"btn_reTranslate": "重新翻译",
|
||||
"preview_cantPreviewType": "无法预览此文件类型",
|
||||
"preview_noOriginalCache": "无原文缓存可供预览。",
|
||||
"pdf_preparing": "正在准备打印,请稍候...",
|
||||
"preview_bilingual": "双语预览",
|
||||
"preview_translatedOnly": "仅译文预览",
|
||||
"configImportSuccess": "配置导入成功!",
|
||||
@@ -362,7 +361,6 @@
|
||||
"btn_reTranslate": "Re-translate",
|
||||
"preview_cantPreviewType": "Cannot preview this file type",
|
||||
"preview_noOriginalCache": "No original file cached for preview.",
|
||||
"pdf_preparing": "Preparing PDF...",
|
||||
"preview_bilingual": "Bilingual Preview",
|
||||
"preview_translatedOnly": "Translation Only Preview",
|
||||
"configImportSuccess": "Configuration imported successfully!",
|
||||
@@ -555,7 +553,6 @@
|
||||
"btn_reTranslate": "Terjemahkan Ulang",
|
||||
"preview_cantPreviewType": "Tidak dapat melihat pratinjau tipe file ini",
|
||||
"preview_noOriginalCache": "Tidak ada file asli yang di-cache.",
|
||||
"pdf_preparing": "Menyiapkan PDF...",
|
||||
"preview_bilingual": "Pratinjau Dwi Bahasa",
|
||||
"preview_translatedOnly": "Pratinjau Hanya Terjemahan",
|
||||
"configImportSuccess": "Konfigurasi berhasil diimpor!",
|
||||
|
||||
@@ -805,11 +805,6 @@
|
||||
:class="getFileIcon(key)"></i>{{ key === 'markdown_zip' ? t('downloadMdZip') : (key === 'markdown' ? t('downloadMdEmbedded') : key.toUpperCase())
|
||||
}}</a>
|
||||
</li>
|
||||
<li v-if="task.downloads.html && !task.downloads.pptx">
|
||||
<a class="dropdown-item" href="#"
|
||||
@click.prevent="printPdf(task.downloads.html, task.translatedStem)"><i
|
||||
class="bi bi-file-earmark-pdf me-2"></i>PDF</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="btn-group"
|
||||
@@ -932,11 +927,6 @@
|
||||
}}
|
||||
</a>
|
||||
</li>
|
||||
<li v-if="previewTask.downloads.html && !previewTask.downloads.pptx">
|
||||
<a class="dropdown-item" href="#" @click.prevent="printPdf(previewTask.downloads.html, previewTask.translatedStem)">
|
||||
<i class="bi bi-file-earmark-pdf me-2"></i>PDF
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -957,7 +947,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<iframe id="printFrame" ref="printFrame" style="display: none;"></iframe>
|
||||
|
||||
<!-- Header controls now in left panel top-right -->
|
||||
</div>
|
||||
@@ -1979,47 +1968,6 @@
|
||||
localStorage.setItem('ui_sync_scroll_enabled', syncScrollEnabled.value);
|
||||
};
|
||||
|
||||
const printPdf = (url, stem) => {
|
||||
const msg = t('pdf_preparing') || "正在准备打印,请稍候...";
|
||||
const toastContainer = document.createElement('div');
|
||||
toastContainer.className = 'toast-container position-fixed top-0 start-50 translate-middle-x p-3';
|
||||
toastContainer.style.zIndex = '1090';
|
||||
toastContainer.innerHTML = `
|
||||
<div class="toast align-items-center text-bg-primary border-0 fade show" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="d-flex">
|
||||
<div class="toast-body">
|
||||
<i class="bi bi-printer-fill me-2"></i>${msg}
|
||||
</div>
|
||||
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
document.body.appendChild(toastContainer);
|
||||
setTimeout(() => {
|
||||
const t = toastContainer.querySelector('.toast');
|
||||
if (t) {
|
||||
t.classList.remove('show');
|
||||
setTimeout(() => {
|
||||
if (toastContainer.parentNode) toastContainer.remove();
|
||||
}, 500);
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
const ifr = document.getElementById('printFrame');
|
||||
fetch(url).then(r => r.text()).then(h => {
|
||||
ifr.srcdoc = h;
|
||||
ifr.onload = () => {
|
||||
setTimeout(() => {
|
||||
ifr.contentWindow.focus();
|
||||
const originalTitle = document.title;
|
||||
if (stem) document.title = stem;
|
||||
ifr.contentWindow.print();
|
||||
setTimeout(() => { document.title = originalTitle; }, 1000);
|
||||
}, 500);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const copyLog = (e, l) => {
|
||||
navigator.clipboard.writeText(l.replace(/<br>/g, '\n')).then(() => {
|
||||
const btn = e.currentTarget;
|
||||
@@ -2250,7 +2198,7 @@
|
||||
t, createNewTask, removeTask, handleTaskFileSelect, handleTaskFileDrop, toggleTaskState,
|
||||
handleGlossaryFiles, clearGlossary, openGlossaryModal,
|
||||
addGlossaryRow, deleteGlossaryRow, saveGlossary, exportGlossaryCsv, triggerGlossaryImport,
|
||||
openPreview, setPreviewMode, toggleSyncScroll, printPdf, copyLog, getFileIcon,
|
||||
openPreview, setPreviewMode, toggleSyncScroll, copyLog, getFileIcon,
|
||||
exportConfig, importConfig, setLang, setTheme, capitalize,
|
||||
currentWorkflowConfig, ocrOptions, stepMap,
|
||||
originalPane, translatedFrame, splitInstance, splitContainer, previewTask,
|
||||
|
||||
Reference in new issue
Block a user