mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 16:44:23 +08:00
1 parent
3816226ba5
commit
15c64ed6f2
3 files changed
+19
-15
No files matched your search
@@ -801,7 +801,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<aside class="meta-panel">
|
<aside class="meta-panel" data-empty="true">
|
||||||
<div id="metaTabs" class="navigation-tabs">
|
<div id="metaTabs" class="navigation-tabs">
|
||||||
<button id="documentMetaTab" type="button" data-selected="true">文档</button>
|
<button id="documentMetaTab" type="button" data-selected="true">文档</button>
|
||||||
<button id="fontsMetaTab" type="button" data-selected="false" tabindex="-1">字体</button>
|
<button id="fontsMetaTab" type="button" data-selected="false" tabindex="-1">字体</button>
|
||||||
@@ -911,7 +911,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div id="metaFontsPanel" hidden>
|
<div id="metaFontsPanel" hidden>
|
||||||
<section class="doc-font-panel">
|
<section id="docFontPanel" class="doc-font-panel" hidden>
|
||||||
<div class="panel-row">
|
<div class="panel-row">
|
||||||
<div id="docFontPanelTitle" class="panel-title compact">文档字体</div>
|
<div id="docFontPanelTitle" class="panel-title compact">文档字体</div>
|
||||||
<span id="docFontSummary" class="count-pill">0</span>
|
<span id="docFontSummary" class="count-pill">0</span>
|
||||||
|
|||||||
@@ -1892,7 +1892,13 @@ body[data-hide-meta] .meta-panel {
|
|||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.meta-panel[data-empty="true"] #metaDocumentPanel,
|
||||||
|
.meta-panel[data-empty="true"] #metaSecurityPanel {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#metaFontsPanel > .doc-font-panel,
|
#metaFontsPanel > .doc-font-panel,
|
||||||
|
#metaFontsPanel > .doc-font-panel[hidden] + .font-panel,
|
||||||
#metaSecurityPanel > .security-panel {
|
#metaSecurityPanel > .security-panel {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
|
|||||||
+11
-13
@@ -675,6 +675,7 @@ const el = {
|
|||||||
annotationClose: document.querySelector("#annotationClose"),
|
annotationClose: document.querySelector("#annotationClose"),
|
||||||
annotationSubmit: document.querySelector("#annotationSubmit"),
|
annotationSubmit: document.querySelector("#annotationSubmit"),
|
||||||
annotationDetail: document.querySelector("#annotationDetail"),
|
annotationDetail: document.querySelector("#annotationDetail"),
|
||||||
|
docFontPanel: document.querySelector("#docFontPanel"),
|
||||||
docFontList: document.querySelector("#docFontList"),
|
docFontList: document.querySelector("#docFontList"),
|
||||||
docFontSummary: document.querySelector("#docFontSummary"),
|
docFontSummary: document.querySelector("#docFontSummary"),
|
||||||
availableFontSummary: document.querySelector("#availableFontSummary"),
|
availableFontSummary: document.querySelector("#availableFontSummary"),
|
||||||
@@ -12672,9 +12673,9 @@ function renderMeta(keepDetails = false) {
|
|||||||
el.metaPanel.setAttribute("data-busy", String(!!doc.detailsPending));
|
el.metaPanel.setAttribute("data-busy", String(!!doc.detailsPending));
|
||||||
document.title = `${nativeHost ? "OFDGo" : "OFDGo WebUI"} - ${state.doc ? state.fileName : "OFD编辑器"}`;
|
document.title = `${nativeHost ? "OFDGo" : "OFDGo WebUI"} - ${state.doc ? state.fileName : "OFD编辑器"}`;
|
||||||
el.metaFile.textContent = state.doc ? state.fileName : "-";
|
el.metaFile.textContent = state.doc ? state.fileName : "-";
|
||||||
el.metaTitle.textContent = doc.title || "-";
|
|
||||||
el.metaAuthor.textContent = doc.author || "-";
|
|
||||||
for (const [field, value] of [
|
for (const [field, value] of [
|
||||||
|
[el.metaTitle, doc.title || ""],
|
||||||
|
[el.metaAuthor, doc.author || ""],
|
||||||
[el.metaSubject, doc.subject || ""],
|
[el.metaSubject, doc.subject || ""],
|
||||||
[el.metaAbstract, doc.abstract || ""],
|
[el.metaAbstract, doc.abstract || ""],
|
||||||
[el.metaCreationDate, formatDocumentTime(doc.creationDate)],
|
[el.metaCreationDate, formatDocumentTime(doc.creationDate)],
|
||||||
@@ -12684,6 +12685,8 @@ function renderMeta(keepDetails = false) {
|
|||||||
[el.metaDocId, doc.docId || ""],
|
[el.metaDocId, doc.docId || ""],
|
||||||
[el.metaDocUsage, doc.docUsage || ""],
|
[el.metaDocUsage, doc.docUsage || ""],
|
||||||
[el.metaCover, doc.cover || ""],
|
[el.metaCover, doc.cover || ""],
|
||||||
|
[el.metaType, doc.docType || ""],
|
||||||
|
[el.metaVersion, doc.version || ""],
|
||||||
]) {
|
]) {
|
||||||
field.textContent = value;
|
field.textContent = value;
|
||||||
field.parentElement.hidden = !value;
|
field.parentElement.hidden = !value;
|
||||||
@@ -12702,12 +12705,11 @@ function renderMeta(keepDetails = false) {
|
|||||||
return row;
|
return row;
|
||||||
}));
|
}));
|
||||||
el.metaCustomData.hidden = !doc.customData?.length;
|
el.metaCustomData.hidden = !doc.customData?.length;
|
||||||
el.metaType.textContent = doc.docType || "-";
|
|
||||||
el.metaVersion.textContent = doc.version || "-";
|
|
||||||
el.metaFonts.textContent = String(doc.fontCount || 0);
|
|
||||||
el.pageTotal.textContent = String(doc.pageCount || 0);
|
el.pageTotal.textContent = String(doc.pageCount || 0);
|
||||||
if (keepDetails && doc.detailsPending) return;
|
if (keepDetails && doc.detailsPending) return;
|
||||||
el.metaSignatures.textContent = doc.detailsPending ? "正在检查签名" : doc.detailsError ? "读取失败" : String(doc.signatureCount || 0);
|
const detailsStatus = doc.detailsPending ? "读取中" : doc.detailsError ? "读取失败" : "";
|
||||||
|
el.metaSignatures.textContent = detailsStatus || String(doc.signatureCount || 0);
|
||||||
|
el.metaFonts.textContent = detailsStatus || String(doc.fontCount || 0);
|
||||||
renderMetaContent(el.signatureList, [doc.signatures, doc.signatureError], renderSignatures);
|
renderMetaContent(el.signatureList, [doc.signatures, doc.signatureError], renderSignatures);
|
||||||
updateStructureControls();
|
updateStructureControls();
|
||||||
renderMetaContent(el.docFontList, doc.fonts || [], renderDocumentFonts);
|
renderMetaContent(el.docFontList, doc.fonts || [], renderDocumentFonts);
|
||||||
@@ -13299,15 +13301,10 @@ function mountAnnotationNotes(index, surface, annotations) {
|
|||||||
|
|
||||||
function renderDocumentFonts() {
|
function renderDocumentFonts() {
|
||||||
const fonts = state.doc?.fonts || [];
|
const fonts = state.doc?.fonts || [];
|
||||||
|
el.docFontPanel.hidden = !fonts.length;
|
||||||
el.docFontList.replaceChildren();
|
el.docFontList.replaceChildren();
|
||||||
el.docFontSummary.textContent = fontSummary(fonts);
|
el.docFontSummary.textContent = fontSummary(fonts);
|
||||||
if (!fonts.length) {
|
if (!fonts.length) return;
|
||||||
const empty = document.createElement("div");
|
|
||||||
empty.className = "font-empty";
|
|
||||||
empty.textContent = "暂无字体";
|
|
||||||
el.docFontList.append(empty);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const fragment = document.createDocumentFragment();
|
const fragment = document.createDocumentFragment();
|
||||||
for (const font of fonts) {
|
for (const font of fonts) {
|
||||||
const row = document.createElement("div");
|
const row = document.createElement("div");
|
||||||
@@ -13756,6 +13753,7 @@ function updateInvoiceControl(disabled) {
|
|||||||
|
|
||||||
function updateDocumentControls() {
|
function updateDocumentControls() {
|
||||||
const count = state.doc?.documents?.length || 0, index = managedDocumentIndex(), manager = state.documentManagement;
|
const count = state.doc?.documents?.length || 0, index = managedDocumentIndex(), manager = state.documentManagement;
|
||||||
|
el.metaPanel.setAttribute("data-empty", String(!state.doc));
|
||||||
const busy = document.body.hasAttribute("data-busy");
|
const busy = document.body.hasAttribute("data-busy");
|
||||||
const disabled = !state.doc || !state.ready || state.exporting || busy;
|
const disabled = !state.doc || !state.ready || state.exporting || busy;
|
||||||
el.printButton.disabled = disabled;
|
el.printButton.disabled = disabled;
|
||||||
|
|||||||
Reference in new issue
Block a user