mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
ec2602746c
commit
eedfa72721
3 files changed
+14
-32
No files matched your search
@@ -706,14 +706,6 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<aside class="meta-panel">
|
<aside class="meta-panel">
|
||||||
<section id="appPanel" class="app-panel" hidden>
|
|
||||||
<div class="panel-row">
|
|
||||||
<div id="appPanelTitle" class="panel-title compact">应用</div>
|
|
||||||
<div class="panel-actions">
|
|
||||||
<span id="offlineStatus" class="app-status">准备中</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<div class="panel-row">
|
<div class="panel-row">
|
||||||
<div class="panel-title compact">文档</div>
|
<div class="panel-title compact">文档</div>
|
||||||
<div class="panel-actions">
|
<div class="panel-actions">
|
||||||
|
|||||||
+14
-17
@@ -458,6 +458,7 @@ a:focus-visible {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.app-update {
|
.app-update {
|
||||||
|
order: 2;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
@@ -473,6 +474,17 @@ a:focus-visible {
|
|||||||
background: #f2faf7;
|
background: #f2faf7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.toolbar-frame:has(.app-update:not([hidden]))::before {
|
||||||
|
order: 1;
|
||||||
|
flex: 0 0 1px;
|
||||||
|
align-self: center;
|
||||||
|
width: 1px;
|
||||||
|
height: 22px;
|
||||||
|
margin: 0 12px 0 2px;
|
||||||
|
background: var(--line);
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
.app-update[hidden] {
|
.app-update[hidden] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -2297,22 +2309,6 @@ body[data-hide-meta] .meta-panel {
|
|||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-panel {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
border-bottom: 1px solid var(--line);
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-panel .panel-row {
|
|
||||||
margin-bottom: 0;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.app-status {
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.navigation-tabs {
|
.navigation-tabs {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@@ -4156,7 +4152,8 @@ audio.page-media {
|
|||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
.tool-group + .tool-group::before {
|
.tool-group + .tool-group::before,
|
||||||
|
.toolbar-frame:has(.app-update:not([hidden]))::before {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -522,10 +522,8 @@ const el = {
|
|||||||
searchNext: document.querySelector("#searchNext"),
|
searchNext: document.querySelector("#searchNext"),
|
||||||
searchResults: document.querySelector("#searchResults"),
|
searchResults: document.querySelector("#searchResults"),
|
||||||
metaPanel: document.querySelector(".meta-panel"),
|
metaPanel: document.querySelector(".meta-panel"),
|
||||||
appPanel: document.querySelector("#appPanel"),
|
|
||||||
renderVectorButton: document.querySelector("#renderVectorButton"),
|
renderVectorButton: document.querySelector("#renderVectorButton"),
|
||||||
renderRasterButton: document.querySelector("#renderRasterButton"),
|
renderRasterButton: document.querySelector("#renderRasterButton"),
|
||||||
offlineStatus: document.querySelector("#offlineStatus"),
|
|
||||||
refreshAppButton: document.querySelector("#refreshAppButton"),
|
refreshAppButton: document.querySelector("#refreshAppButton"),
|
||||||
metaFile: document.querySelector("#metaFile"),
|
metaFile: document.querySelector("#metaFile"),
|
||||||
metaTitle: document.querySelector("#metaTitle"),
|
metaTitle: document.querySelector("#metaTitle"),
|
||||||
@@ -4164,14 +4162,11 @@ async function registerOffline() {
|
|||||||
|
|
||||||
async function prepareOffline() {
|
async function prepareOffline() {
|
||||||
if (nativeHost) {
|
if (nativeHost) {
|
||||||
el.appPanel.hidden = false;
|
|
||||||
el.offlineStatus.textContent = "可离线";
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!window.isSecureContext || !("serviceWorker" in navigator) || !("caches" in window) || !("locks" in navigator)) {
|
if (!window.isSecureContext || !("serviceWorker" in navigator) || !("caches" in window) || !("locks" in navigator)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
el.appPanel.hidden = false;
|
|
||||||
setProgress("正在准备离线", null, "正在准备离线");
|
setProgress("正在准备离线", null, "正在准备离线");
|
||||||
try {
|
try {
|
||||||
const registration = await registerOffline();
|
const registration = await registerOffline();
|
||||||
@@ -4183,10 +4178,8 @@ async function prepareOffline() {
|
|||||||
if (navigator.storage?.persist) {
|
if (navigator.storage?.persist) {
|
||||||
navigator.storage.persist().catch(() => false);
|
navigator.storage.persist().catch(() => false);
|
||||||
}
|
}
|
||||||
el.offlineStatus.textContent = "可离线";
|
|
||||||
watchApplicationUpdates(result.checksum);
|
watchApplicationUpdates(result.checksum);
|
||||||
} catch {
|
} catch {
|
||||||
el.offlineStatus.textContent = "未就绪";
|
|
||||||
}
|
}
|
||||||
el.refreshAppButton.disabled = false;
|
el.refreshAppButton.disabled = false;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in new issue
Block a user