extensions: real PDF/DOC icons + fix translate default URL
- pdf-editor 0.1.1 → 0.1.2: manifest.icon is a data:image/svg+xml red PDF document badge (dock renders it as <img>). Same on toolbar-menu.icon. Item-level icons dropped — those go through the native OS menu that doesn't render data URIs. - translate 0.1.0 → 0.1.1: default LibreTranslate mirror was translate.argosopentech.com, which is now a dead domain — panel just said "Failed" on every request. Switched default to translate.disroot.org (currently up), added a datalist of known mirrors, and a one-shot migration off the dead default so existing installs recover on next load. - docx-editor 0.1.0 → 0.1.1: manifest.icon is a data:image/svg+xml blue DOC document badge, index.js no longer overrides it with 📝, and the panel header uses the same inline SVG. Same rationale as pdf-editor — every extension was rendering as either 📄 or 📝, so PDF and Word were visually identical to the Notepad.
This commit is contained in:
parent
b791871390
commit
862e92543c
6 changed files with 32 additions and 18 deletions
|
|
@ -1,25 +1,24 @@
|
|||
{
|
||||
"id": "pdf-editor",
|
||||
"name": "PDF Editor",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"description": "Open a PDF in a full tab: read it, highlight and mark it up, reorder or rotate or drop pages, fill in its form fields, then save a new copy. Annotations are written into the saved file as real PDF content. The original is never touched.",
|
||||
"author": "Silent Mode",
|
||||
"icon": "📄",
|
||||
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYgMmg4bDYgNnYxMmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJ6IiBmaWxsPSIjZGMyNjI2Ii8+PHBhdGggZD0iTTE0IDJ2Nmg2eiIgZmlsbD0iIzk5MWIxYiIvPjx0ZXh0IHg9IjEyIiB5PSIxNyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9InN5c3RlbS11aSwtYXBwbGUtc3lzdGVtLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNS41IiBmb250LXdlaWdodD0iODAwIiBmaWxsPSIjZmZmIj5QREY8L3RleHQ+PC9zdmc+",
|
||||
"main": "index.js",
|
||||
"capabilities": ["toolbar-menu", "open-tab", "context-menu-item"],
|
||||
"toolbar-menu": {
|
||||
"title": "PDF Editor",
|
||||
"icon": "📄",
|
||||
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYgMmg4bDYgNnYxMmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJ6IiBmaWxsPSIjZGMyNjI2Ii8+PHBhdGggZD0iTTE0IDJ2Nmg2eiIgZmlsbD0iIzk5MWIxYiIvPjx0ZXh0IHg9IjEyIiB5PSIxNyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9InN5c3RlbS11aSwtYXBwbGUtc3lzdGVtLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNS41IiBmb250LXdlaWdodD0iODAwIiBmaWxsPSIjZmZmIj5QREY8L3RleHQ+PC9zdmc+",
|
||||
"items": [
|
||||
{ "id": "open", "label": "Open a PDF…", "icon": "📄" }
|
||||
{ "id": "open", "label": "Open a PDF…" }
|
||||
]
|
||||
},
|
||||
"context-menu-items": [
|
||||
{
|
||||
"id": "open-link",
|
||||
"label": "Open PDF in editor",
|
||||
"when": "linkURL",
|
||||
"icon": "📄"
|
||||
"when": "linkURL"
|
||||
}
|
||||
],
|
||||
"updateURL": "https://navigate.st/bns/theseus.x/extensions/pdf-editor/updates.json"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "translate",
|
||||
"name": "Translate",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Right-click a selection to translate it. Sidebar panel with LibreTranslate or Google as the backend.",
|
||||
"author": "Silent Mode",
|
||||
"icon": "🌐",
|
||||
|
|
|
|||
|
|
@ -115,17 +115,23 @@
|
|||
</label>
|
||||
<label id="ltUrlLabel">
|
||||
LibreTranslate server URL
|
||||
<input id="ltUrl" type="url" placeholder="https://translate.argosopentech.com" />
|
||||
<input id="ltUrl" type="url" placeholder="https://translate.disroot.org" list="ltMirrors" />
|
||||
<datalist id="ltMirrors">
|
||||
<option value="https://translate.disroot.org"></option>
|
||||
<option value="https://translate.plausibility.cloud"></option>
|
||||
<option value="https://lingva.ml"></option>
|
||||
</datalist>
|
||||
</label>
|
||||
<label id="ltKeyLabel">
|
||||
LibreTranslate API key (optional)
|
||||
<input id="ltKey" type="text" placeholder="only if your instance requires one" />
|
||||
</label>
|
||||
<div class="hint">
|
||||
LibreTranslate is a free MIT-licensed engine. Public instances rate-limit; if you
|
||||
hit "too many requests", pick another URL or self-host. Google (unofficial) uses
|
||||
<code>translate.googleapis.com/translate_a/single</code> — free, no key, but
|
||||
unofficial and Google can break it at any time.
|
||||
LibreTranslate is a free MIT-licensed engine. Public instances rate-limit — if you
|
||||
hit "too many requests" or a mirror is down, pick another URL from the list or
|
||||
self-host. Google (unofficial) uses
|
||||
<code>translate.googleapis.com/translate_a/single</code> — no key, but unofficial
|
||||
and Google can break it at any time.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -164,7 +170,12 @@
|
|||
const defaultTarget = LANGS.some(([c]) => c === browserLang) && browserLang !== "en" ? browserLang : "en";
|
||||
|
||||
const S = window.silentmode?.storage;
|
||||
const settingsState = { backend: "libretranslate", ltUrl: "https://translate.argosopentech.com", ltKey: "" };
|
||||
const DEFAULT_LT_URL = "https://translate.disroot.org";
|
||||
// Old defaults that we now migrate off — argosopentech.com went offline.
|
||||
// If a user's saved URL matches one of these, silently upgrade it to the
|
||||
// current working default so the panel isn't broken out of the box.
|
||||
const DEAD_LT_URLS = new Set(["https://translate.argosopentech.com"]);
|
||||
const settingsState = { backend: "libretranslate", ltUrl: DEFAULT_LT_URL, ltKey: "" };
|
||||
const uiState = { src: "auto", tgt: defaultTarget };
|
||||
|
||||
async function loadState() {
|
||||
|
|
@ -175,6 +186,11 @@
|
|||
const ui = await S.get("ui", null);
|
||||
if (ui && typeof ui === "object") Object.assign(uiState, ui);
|
||||
} catch (e) { console.warn("load state failed:", e); }
|
||||
// One-shot migration off a dead default URL.
|
||||
if (DEAD_LT_URLS.has(settingsState.ltUrl)) {
|
||||
settingsState.ltUrl = DEFAULT_LT_URL;
|
||||
if (S) try { await S.set("settings", settingsState); } catch {}
|
||||
}
|
||||
backendSel.value = settingsState.backend;
|
||||
ltUrl.value = settingsState.ltUrl;
|
||||
ltKey.value = settingsState.ltKey;
|
||||
|
|
@ -184,7 +200,7 @@
|
|||
}
|
||||
async function saveSettings() {
|
||||
settingsState.backend = backendSel.value;
|
||||
settingsState.ltUrl = ltUrl.value.trim().replace(/\/+$/, "") || "https://translate.argosopentech.com";
|
||||
settingsState.ltUrl = ltUrl.value.trim().replace(/\/+$/, "") || DEFAULT_LT_URL;
|
||||
settingsState.ltKey = ltKey.value.trim();
|
||||
if (S) try { await S.set("settings", settingsState); } catch {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"id": "docx-editor",
|
||||
"name": "Word editor",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Open, edit and save Word documents (.docx) in a full Theseus tab. Ribbon-style formatting, tables, lists, images and links; headers, footers, footnotes, page setup and the document's own styles are carried through a save untouched.",
|
||||
"author": "Silent Mode",
|
||||
"icon": "📝",
|
||||
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYgMmg4bDYgNnYxMmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJ6IiBmaWxsPSIjMjU2M2ViIi8+PHBhdGggZD0iTTE0IDJ2Nmg2eiIgZmlsbD0iIzFlNDBhZiIvPjx0ZXh0IHg9IjEyIiB5PSIxNyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9InN5c3RlbS11aSwtYXBwbGUtc3lzdGVtLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNS41IiBmb250LXdlaWdodD0iODAwIiBmaWxsPSIjZmZmIj5ET0M8L3RleHQ+PC9zdmc+",
|
||||
"main": "index.js",
|
||||
"capabilities": ["sidebar-panel", "open-tab"],
|
||||
"updateURL": "https://navigate.st/bns/theseus.x/extensions/community/docx-editor/updates.json"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ module.exports = {
|
|||
api.registerSidebarPanel({
|
||||
id: "main",
|
||||
title: "Word editor",
|
||||
icon: "📝",
|
||||
page: "panel.html",
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<div class="head"><span class="ico">📝</span><h1>Word editor</h1></div>
|
||||
<div class="head"><span class="ico" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z" fill="#2563eb"/><path d="M14 2v6h6z" fill="#1e40af"/><text x="12" y="17" text-anchor="middle" font-family="system-ui,-apple-system,sans-serif" font-size="5.5" font-weight="800" fill="#fff">DOC</text></svg></span><h1>Word editor</h1></div>
|
||||
|
||||
<div class="body">
|
||||
<p class="lede">Open a .docx in a full tab. Headers, footers, footnotes, page setup and
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue