Ver código fonte

feat(branding): use custom logo for onlyoffice preview tab

root 1 mês atrás
pai
commit
4550dccd01
2 arquivos alterados com 19 adições e 1 exclusões
  1. BIN
      site/static/fb-logo.png
  2. 19 1
      site/static/oo-preview.html

BIN
site/static/fb-logo.png


+ 19 - 1
site/static/oo-preview.html

@@ -3,7 +3,10 @@
 <head>
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1" />
-  <title>OnlyOffice 预览</title>
+  <title>繁星文档预览</title>
+  <link rel="icon" type="image/png" href="/fb-logo.png?v=20260309a" />
+  <link rel="shortcut icon" type="image/png" href="/fb-logo.png?v=20260309a" />
+  <link rel="apple-touch-icon" href="/fb-logo.png?v=20260309a" />
   <style>
     html,body{height:100%;margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:#f5f7fa}
     .bar{padding:10px 14px;background:#111827;color:#fff;font-size:14px;word-break:break-all}
@@ -19,10 +22,25 @@
   <div class="bar" id="hint"></div>
   <div id="editor"></div>
   <script>
+    function applyBrandFavicon() {
+      var href = "/fb-logo.png?v=20260309a";
+      ["icon", "shortcut icon", "apple-touch-icon"].forEach(function(rel){
+        var el = document.querySelector('link[rel="' + rel + '"]');
+        if (!el) {
+          el = document.createElement("link");
+          el.setAttribute("rel", rel);
+          document.head.appendChild(el);
+        }
+        el.setAttribute("href", href);
+      });
+    }
+    applyBrandFavicon();
+
     const hintEl = document.getElementById("hint");
     const p = new URLSearchParams(location.search);
     const rawUrl = p.get("url") || "";
     const title = p.get("title") || (rawUrl ? rawUrl.split("/").pop() : "untitled.docx");
+    document.title = "繁星文档预览 - " + title;
     const fileType = (p.get("type") || title.split(".").pop() || "docx").toLowerCase();
     const fileDocType = docType(fileType);
     const isCellDoc = fileDocType === "cell";