mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +08:00
1 parent
cbd0f7ca44
commit
92ddacaf66
3 files changed
+13
-17
No files matched your search
@@ -291,8 +291,8 @@
|
||||
</div>
|
||||
<label class="form-row" data-annotation="watermark"><span>排列</span><select id="annotationTile"><option value="single">单个</option><option value="tile">平铺</option></select></label>
|
||||
<div class="form-row" data-annotation="watermark"><label id="annotationPlacementLabel" for="annotationPlacement">位置</label><div class="annotation-placement"><select id="annotationPlacement"><option value="page">居中</option><option value="custom">指定</option></select><button id="annotationPick" class="button" type="button">定位</button></div></div>
|
||||
<label class="form-row" data-annotation="watermark"><span>应用</span><select id="annotationScope"><option value="current">本页</option><option value="all">全文</option><option value="custom">指定</option></select></label>
|
||||
<label class="form-row" data-annotation="note watermark stamp link"><span>页面</span><input id="annotationPages" type="text" required></label>
|
||||
<label class="form-row" data-annotation="watermark"><span>应用</span><select id="annotationScope"><option value="current">本页</option><option value="all">全部</option><option value="custom">指定</option></select></label>
|
||||
<label class="form-row" data-annotation="note watermark stamp link"><span>页码</span><input id="annotationPages" type="text" required></label>
|
||||
<div class="form-actions"><div id="annotationCreateStatus" class="form-status" role="status"></div><button id="annotationCreateCancel" class="button" type="button">取消</button><button class="button" type="submit">确定</button></div>
|
||||
</form>
|
||||
</dialog>
|
||||
@@ -433,7 +433,7 @@
|
||||
</section>
|
||||
<div class="panel-row">
|
||||
<div class="panel-title compact">文档</div>
|
||||
<button id="infoButton" class="small-button" type="button" aria-label="编辑文档信息" aria-haspopup="dialog" aria-controls="infoPanel" hidden>修改</button>
|
||||
<button id="infoButton" class="small-button" type="button" aria-label="修改文档信息" aria-haspopup="dialog" aria-controls="infoPanel" hidden>修改</button>
|
||||
</div>
|
||||
<div id="editNotice" class="font-permission-hint" role="status" hidden></div>
|
||||
<dl class="meta-list">
|
||||
|
||||
@@ -1485,12 +1485,6 @@ button.outline-link:hover {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.edit-text::selection,
|
||||
.edit-text ::selection {
|
||||
color: #fff;
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.editing-select .edit-layer {
|
||||
display: block;
|
||||
}
|
||||
|
||||
+10
-8
@@ -1328,7 +1328,7 @@ function openPagePanel() {
|
||||
for (const [input, key] of [[el.pageWidth, "width"], [el.pageHeight, "height"]]) {
|
||||
const same = pages.every(page => page[key] === pages[0][key]);
|
||||
input.value = same ? String(pages[0][key]) : "";
|
||||
input.placeholder = same ? "" : "不同";
|
||||
input.placeholder = same ? "" : "混合";
|
||||
}
|
||||
el.pageRangeRow.hidden = pages.length === 1;
|
||||
el.pageRange.textContent = `共${pages.length}页`;
|
||||
@@ -1446,7 +1446,7 @@ async function toggleEditor() {
|
||||
|
||||
function confirmTextReflow(item) {
|
||||
return canEditObject(item, "reflow") && (canEditObject(item, "layoutKnown")
|
||||
|| window.confirm("原文排版未知,将重新排版。继续?"));
|
||||
|| window.confirm("将重新排版原文,是否继续?"));
|
||||
}
|
||||
|
||||
function openCreatePanel() {
|
||||
@@ -2699,7 +2699,7 @@ async function loadWASM() {
|
||||
} else if (data.type === "import") {
|
||||
if (wasmRequests.get(data.id)?.openSeq === state.openSeq && state.importing && !el.importCancel.disabled) {
|
||||
const label = { ids: "正在检查", pages: "正在导入", resources: "正在读取", commit: "正在完成" }[data.phase];
|
||||
el.importStatus.textContent = data.total ? `${label}${data.completed}/${data.total}页` : label;
|
||||
el.importStatus.textContent = data.total ? `${label} ${data.completed} / ${data.total} 页` : label;
|
||||
setProgress(label, data.total ? data.completed / data.total * 100 : null);
|
||||
if (data.phase === "commit") el.importCancel.disabled = el.cancelExportButton.disabled = true;
|
||||
}
|
||||
@@ -2714,7 +2714,7 @@ async function loadWASM() {
|
||||
if (data.ok) {
|
||||
request.resolve(data.data);
|
||||
} else {
|
||||
const err = new Error(missingGlyphMessage(data.missingGlyphs) || (data.reasonCode === "layoutRequired" ? "请先设置段落排版,再跨段或换行修改" : data.error));
|
||||
const err = new Error(missingGlyphMessage(data.missingGlyphs) || (data.reasonCode === "layoutRequired" ? "跨段或换行修改需先设置段落排版" : data.error));
|
||||
if (data.canceled) {
|
||||
err.name = "AbortError";
|
||||
}
|
||||
@@ -3513,9 +3513,10 @@ async function exportFile(whole, indices = null, value = el.exportFormat.value)
|
||||
const fileName = saving && indices !== null ? `${baseFileName()}_选页.ofd` : whole ? `${baseFileName()}.${extension}` : pageFileName(extension);
|
||||
const pageIndex = state.pageIndex;
|
||||
const dpi = exportFormatUsesDPI(format.value) ? currentImageDPI() : 0;
|
||||
const status = saving ? "正在保存文档" : whole ? STATUS.exporting : STATUS.pageExporting;
|
||||
state.exporting = true;
|
||||
updateControls();
|
||||
setBusy(true, `正在生成 ${label}`, null, whole ? STATUS.exporting : STATUS.pageExporting);
|
||||
setBusy(true, `正在生成 ${label}`, null, status);
|
||||
try {
|
||||
const file = window.showSaveFilePicker ? await window.showSaveFilePicker({
|
||||
suggestedName: fileName,
|
||||
@@ -3530,7 +3531,7 @@ async function exportFile(whole, indices = null, value = el.exportFormat.value)
|
||||
if (!await canvasEditor.commitText()) return;
|
||||
if (!await canvasEditor.commitCrop()) return;
|
||||
openSeq = state.openSeq;
|
||||
setBusy(true, `正在生成 ${label}`, null, whole ? STATUS.exporting : STATUS.pageExporting);
|
||||
setBusy(true, `正在生成 ${label}`, null, status);
|
||||
}
|
||||
const result = saving ? await callWASM("ofdgoSaveDocument", indices, file) : whole
|
||||
? await callWASM("ofdgoExportDocument", format.value, dpi, indices, file)
|
||||
@@ -3549,9 +3550,10 @@ async function exportFile(whole, indices = null, value = el.exportFormat.value)
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (openSeq === state.openSeq) {
|
||||
if (el.batchPagesPanel.open) el.batchPagesStatus.textContent = err.name === "AbortError" ? "导出已取消" : err.message;
|
||||
const canceled = saving ? "保存已取消" : "导出已取消";
|
||||
if (el.batchPagesPanel.open) el.batchPagesStatus.textContent = err.name === "AbortError" ? canceled : err.message;
|
||||
if (err.name === "AbortError") {
|
||||
setStatus("导出已取消");
|
||||
setStatus(canceled);
|
||||
} else {
|
||||
showError(err, false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user