From 0139433e25d4552083e3ab9fe5daa9e3502f8c17 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Tue, 13 Oct 2026 15:23:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E7=B2=BE=E7=AE=80=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/index.html | 7 ++++--- assets/webui/ofdgo.css | 7 +++++-- assets/webui/ofdgo.js | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/assets/webui/index.html b/assets/webui/index.html index b760810..5b5a581 100644 --- a/assets/webui/index.html +++ b/assets/webui/index.html @@ -365,21 +365,22 @@
-
+
+
-
+
diff --git a/assets/webui/ofdgo.css b/assets/webui/ofdgo.css index 685f2dd..c59a483 100644 --- a/assets/webui/ofdgo.css +++ b/assets/webui/ofdgo.css @@ -1552,8 +1552,7 @@ body[data-hide-meta] .meta-panel { width: 600px; } -.resource-dialog form > .form-actions { - grid-template-columns: minmax(0, 1fr) auto; +.resource-dialog .form-status:not(:empty) { margin-top: 12px; } @@ -1642,6 +1641,10 @@ body[data-hide-meta] .meta-panel { min-height: 28px; } +.resource-actions > #resourceClose { + margin-left: auto; +} + .resource-actions > [hidden] { display: none; } diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index 5a07cf4..abcc631 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -23,7 +23,7 @@ const batch = { items: [], formats: [], running: false, canceled: false, worker: const batchElements = Object.fromEntries(["Button", "Panel", "Form", "Input", "Add", "Clear", "Count", "Format", "Compression", "FontRow", "FontMode", "Destination", "DPIRow", "DPI", "List", "Empty", "Progress", "Status", "Close", "Cancel", "Start"].map(name => [name, document.querySelector(`#convert${name}`)])); const fontBinding = { font: null, choices: [], sequence: 0 }; const fontBindingElements = Object.fromEntries(["Panel", "Form", "Title", "Name", "SourceRow", "Source", "File", "Hint", "Status", "Cancel", "Submit"].map(name => [name, document.querySelector(`#fontBinding${name}`)])); -const resourceElements = Object.fromEntries(["ManageButton", "Panel", "Form", "Kind", "List", "Empty", "Reference", "Add", "Preview", "Export", "Rename", "Replace", "Delete", "Locate", "Close", "Binding", "Page", "Object", "Pick", "Bind", "Unbind", "Viewer", "Status", "File"].map(name => [name, document.querySelector(`#resource${name}`)])); +const resourceElements = Object.fromEntries(["ManageButton", "Panel", "Form", "Kind", "List", "Empty", "Reference", "Actions", "Add", "Preview", "Export", "Rename", "Replace", "Delete", "Locate", "Close", "Binding", "BindingActions", "Page", "Object", "Pick", "Bind", "Unbind", "Viewer", "Status", "File"].map(name => [name, document.querySelector(`#resource${name}`)])); const resourceManager = { items: [], selected: null, targets: [], pick: null, busy: false, sequence: 0, url: null, font: null, fileAction: null }; let wasmPromise = null; @@ -5189,6 +5189,8 @@ function updateResourceControls() { resourceElements.Delete.title = item?.kind === "Attachment" ? "删除附件" : item?.references?.length ? "资源仍被引用" : "删除资源"; resourceElements.Locate.disabled = disabled || !item?.references?.length; resourceElements.Binding.hidden = !editing || !actionable; + const actions = resourceElements.Binding.hidden ? resourceElements.Actions : resourceElements.BindingActions; + if (resourceElements.Close.parentElement !== actions) actions.append(resourceElements.Close); const target = resourceManager.targets.find(target => target.id === resourceElements.Object.value); resourceElements.Pick.disabled = disabled || !editing || !actionable || Boolean(state.composite); resourceElements.Bind.disabled = disabled || !actionable || !target || target.bound;