[IMP] OneBSpace rebrand of OpenCADStudio -> OneCAD Draft (wordmark, about, crash banner, 23 locales; strip SW/manifest; air-gap: update check, donations, discussions, external help links)

This commit is contained in:
Z User committed 2026-10-18 21:25:27 +00:00
1 parent c9e763006e
commit 193f2ae9ab
57 files changed
+760 -1091

No files matched your search

-18
View File
@@ -1,18 +0,0 @@
{
"name": "Open CAD Studio",
"short_name": "OCS",
"description": "A free CAD editor for DWG and DXF drawings.",
"start_url": "./",
"scope": "./",
"display": "standalone",
"background_color": "#1e1e1e",
"theme_color": "#1e1e1e",
"icons": [
{
"src": "logo.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "any"
}
]
}
+22 -22
View File
@@ -1,90 +1,90 @@
{
"ar-SA": {
"title": "Open CAD Studio — الويب",
"title": "OneCAD Draft — الويب",
"loading": "جارٍ التحميل…"
},
"bg-BG": {
"title": "Open CAD Studio — Уеб",
"title": "OneCAD Draft — Уеб",
"loading": "Зареждане…"
},
"cs-CZ": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Načítání…"
},
"de-DE": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Wird geladen…"
},
"el-GR": {
"title": "Open CAD Studio — Ιστός",
"title": "OneCAD Draft — Ιστός",
"loading": "Φόρτωση…"
},
"en-US": {
"title": "Open CAD Studio Web App",
"title": "OneCAD Draft Web App",
"loading": "Loading…"
},
"es-ES": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Cargando…"
},
"fi-FI": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Ladataan…"
},
"fr-FR": {
"title": "Open CAD Studio — Site Web",
"title": "OneCAD Draft — Site Web",
"loading": "Chargement…"
},
"hi-IN": {
"title": "Open CAD Studio — वेब",
"title": "OneCAD Draft — वेब",
"loading": "लोड हो रहा है…"
},
"hu-HU": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Betöltés…"
},
"it-IT": {
"title": "Open CAD Studio — Rete",
"title": "OneCAD Draft — Rete",
"loading": "Caricamento…"
},
"ja-JP": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "読み込み中…"
},
"ko-KR": {
"title": "Open CAD Studio — 웹",
"title": "OneCAD Draft — 웹",
"loading": "로드 중…"
},
"lo-LA": {
"title": "ເວັບແອັບ Open CAD Studio",
"title": "ເວັບແອັບ OneCAD Draft",
"loading": "ກຳລັງໂຫຼດ…"
},
"nl-NL": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Laden…"
},
"pl-PL": {
"title": "Open CAD Studio — Sieć",
"title": "OneCAD Draft — Sieć",
"loading": "Ładowanie…"
},
"pt-BR": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Carregando…"
},
"ru-RU": {
"title": "Open CAD Studio — Веб-сайт",
"title": "OneCAD Draft — Веб-сайт",
"loading": "Загрузка…"
},
"tr-TR": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "Yükleniyor…"
},
"zh-CN": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "正在加载…"
},
"zh-TW": {
"title": "Open CAD Studio — Web",
"title": "OneCAD Draft — Web",
"loading": "載入中…"
}
}
-140
View File
@@ -1,140 +0,0 @@
// Open CAD Studio web app service worker: offline app-shell caching.
//
// Trunk copies this file to dist/app/sw.js (copy-file link in web-app.html),
// so it is served at /app/sw.js and its scope is /app/ — the whole app. The
// page registers it with a relative URL; see the inline script in
// web-app.html.
//
// Caching strategy
// - Navigations (any path under /app/, deep links included): network-first.
// A successful response is cached under the canonical shell URL (the
// scope root) and returned, so updates land on the next visit; offline
// the cached shell is served instead, which also serves as the fallback
// for deep-linked paths.
// - Other same-origin GET requests (wasm, js, workers, fonts, JSON):
// cache-first with a background revalidate. Trunk content-hashes the
// heavy assets (OpenCADStudio-<hash>[_bg].{js,wasm}), so a cached copy
// can never be stale and revalidation is effectively free; non-hashed
// files (fonts/*.ttf, *.json, ocs-*.js) are silently refreshed in the
// background. Everything the app loads is captured during the first
// online visit, after which the ~55 MB bundle is served from the cache
// instead of re-downloaded on every visit.
// - Non-GET and cross-origin requests: passthrough (never intercepted).
//
// Versioning
// CACHE_VERSION below is a placeholder ("v1") so this file works verbatim
// under `trunk serve`. The Pages workflow stamps it with a hash of the
// finished bundle after every build, so each deploy ships a fresh cache
// name and the activate step below deletes the previous deploy's cache.
//
// Update flow
// A changed sw.js installs a new worker, but this code deliberately never
// calls skipWaiting() and never reloads the page: the browser keeps the
// new worker in the "waiting" state until every tab running the old
// version has closed, so an in-progress editing session is never disrupted
// mid-session. The new worker (and its new cache) takes over on the first
// visit after that. Nothing is shown to the user — the browser chrome
// already handles the "update available" UX.
const CACHE_VERSION = "v1"; // stamped by the Pages workflow (bundle hash)
const CACHE_NAME = `ocs-app-${CACHE_VERSION}`;
const SHELL_URL = new URL("./", self.registration.scope);
self.addEventListener("install", (event) => {
// Precache the app shell (index.html) so offline navigation works from the
// first visit after registration. If the shell cannot be fetched the
// install fails and the browser retries on a later navigation — a broken
// shell must never be cached.
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => cache.addAll([SHELL_URL.href])),
);
});
self.addEventListener("activate", (event) => {
// Delete every cache from previous versions, then start controlling pages
// that loaded before this worker was ready, so the current visit's requests
// are captured without needing a reload.
event.waitUntil(
(async () => {
const names = await caches.keys();
await Promise.all(
names
.filter((name) => name !== CACHE_NAME)
.map((name) => caches.delete(name)),
);
await self.clients.claim();
})(),
);
});
// Cache a copy of a response unless it is not a complete success. Quota or
// write errors are swallowed: caching must never break the app itself.
const put = async (cache, key, response) => {
if (!response || !response.ok) return;
try {
await cache.put(key, response.clone());
} catch {}
};
self.addEventListener("fetch", (event) => {
const request = event.request;
// Only same-origin GETs are ours to serve.
if (request.method !== "GET") return;
if (new URL(request.url).origin !== self.location.origin) return;
// Range requests (media seeking) cannot be served from a full-body cache.
if (request.headers.has("range")) return;
if (request.mode === "navigate") {
event.respondWith(
(async () => {
const cache = await caches.open(CACHE_NAME);
// Only the scope root is the app shell: caching any other in-scope
// navigation here would store e.g. a font or JSON body under the
// shell key and serve it for every offline navigation.
const isShell = new URL(request.url).pathname === SHELL_URL.pathname;
try {
const fresh = await fetch(request);
if (isShell) await put(cache, SHELL_URL, fresh);
return fresh;
} catch {
const cached = await cache.match(SHELL_URL);
if (cached) return cached;
return new Response("Open CAD Studio is offline.", {
status: 503,
headers: {"Content-Type": "text/plain; charset=utf-8"},
});
}
})(),
);
return;
}
// Cache-first with background revalidate. On a hit the cached copy is
// returned immediately and a fresh one is fetched (and cached) in the
// background; on a miss the network response is cached before being
// returned, making the next visit offline-capable.
event.respondWith(
(async () => {
const cache = await caches.open(CACHE_NAME);
const cached = await cache.match(request);
const network = fetch(request)
.then(async (fresh) => {
await put(cache, request, fresh);
return fresh;
})
.catch(() => undefined);
if (cached) {
// Keep the worker alive until the background revalidate finishes.
event.waitUntil(network);
return cached;
}
const fresh = await network;
if (fresh) return fresh;
return new Response("Open CAD Studio is offline.", {
status: 503,
headers: {"Content-Type": "text/plain; charset=utf-8"},
});
})(),
);
});
+5 -5
View File
@@ -1,22 +1,22 @@
[
{
"id": "QFDMSRNrZOU",
"title": "Create 2D Chair DWG Drawing in Open CAD Studio"
"title": "Create 2D Chair DWG Drawing in OneCAD Draft"
},
{
"id": "bHwKKOdBtCQ",
"title": "Open CAD Studio: Object Snap Explained"
"title": "OneCAD Draft: Object Snap Explained"
},
{
"id": "JRlmIInZRiQ",
"title": "How to Install Open CAD Studio – Free DWG Authoring Tool"
"title": "How to Install OneCAD Draft – Free DWG Authoring Tool"
},
{
"id": "4_glyJFo0qI",
"title": "Open CAD Studio as a Free DWG File Viewer with No Login Needed"
"title": "OneCAD Draft as a Free DWG File Viewer with No Login Needed"
},
{
"id": "uN9zxM7p_fc",
"title": "Open CAD Studio Tutorial: Create a 2D DWG Drawing & Export to PDF"
"title": "OneCAD Draft Tutorial: Create a 2D DWG Drawing & Export to PDF"
}
]