From 73977e6bfe1ebb6157d1621400f72574f326b4a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 22:21:49 +0000 Subject: [PATCH] This build was committed by a bot. --- .../{index-Dk1VBKCH.js => index-DiYgOCm5.js} | 17 ++++++++--------- dist/index.html | 2 +- dist/sw.js | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) rename dist/assets/{index-Dk1VBKCH.js => index-DiYgOCm5.js} (98%) diff --git a/dist/assets/index-Dk1VBKCH.js b/dist/assets/index-DiYgOCm5.js similarity index 98% rename from dist/assets/index-Dk1VBKCH.js rename to dist/assets/index-DiYgOCm5.js index 5a25a92..5e2065a 100644 --- a/dist/assets/index-Dk1VBKCH.js +++ b/dist/assets/index-DiYgOCm5.js @@ -1387,9 +1387,8 @@ const ghApi = async (path, method = "GET", body = null) => { return r.status === 404 ? null : r.json(); }; const parseGhUrl = (u) => { - const p = u.substring(5).split("/"), owner = p[0], repoPart = p[1] || "", branch = repoPart.includes("@") ? repoPart.split("@")[1] : "main", repo = repoPart.split("@")[0], path = p.slice(2).join("/"); - const dirPath = path ? path + "/" : ""; - return { owner, repo, branch, path, full: `${owner}/${repo}/contents/${dirPath}index.json?ref=${branch}`, dir: `${owner}/${repo}/contents/${dirPath}`.replace(/\/$/, "") + "/" }; + const p = u.substring(5).split("/"), owner = p[0], repoPart = p[1] || "", branch = repoPart.includes("@") ? repoPart.split("@")[1] : "main", repo = repoPart.split("@")[0], path = p.slice(2).join("/").replace(/\/$/, ""); + return { owner, repo, branch, path, apiPath: `${owner}/${repo}/contents${path ? "/" + path : ""}` }; }; $(el.threadRepoInput).on("change", async () => { const u = el.threadRepoInput.value.trim(); @@ -1427,7 +1426,7 @@ $(el.threadSyncBtn).on("click", async () => { const info = parseGhUrl(u); try { if (mode) { - const remoteItems = await ghApi(`${info.owner}/${info.repo}/contents/${info.path}?ref=${info.branch}`) || [], remoteMap = {}; + const remoteItems = await ghApi(`${info.apiPath}?ref=${info.branch}`) || [], remoteMap = {}; remoteItems.forEach((i) => { const d = deserializeThreadName(i.name); if (d) remoteMap[d.id] = { name: i.name, sha: i.sha }; @@ -1436,7 +1435,7 @@ $(el.threadSyncBtn).on("click", async () => { for (const t of THREAD.list) { if (t.status === "deleted") { if (remoteMap[t.id]) { - await ghApi(`${info.owner}/${info.repo}/contents/${info.path}/${remoteMap[t.id].name}`, "DELETE", { message: `Delete thread ${t.id}`, sha: remoteMap[t.id].sha, branch: info.branch }); + await ghApi(`${info.apiPath}/${remoteMap[t.id].name}`, "DELETE", { message: `Delete thread ${t.id}`, sha: remoteMap[t.id].sha, branch: info.branch }); await localforage.removeItem("rem_t_" + t.id); } toRemove.push(t.id); @@ -1446,10 +1445,10 @@ $(el.threadSyncBtn).on("click", async () => { if (t.status === "modified" || t.status === "new") { const newName = serializeThreadName(t), msgs = await localforage.getItem("rem_t_" + t.id); if (remoteMap[t.id] && remoteMap[t.id].name !== newName) { - await ghApi(`${info.owner}/${info.repo}/contents/${info.path}/${remoteMap[t.id].name}`, "DELETE", { message: `Rename thread ${t.id}`, sha: remoteMap[t.id].sha, branch: info.branch }); + await ghApi(`${info.apiPath}/${remoteMap[t.id].name}`, "DELETE", { message: `Rename thread ${t.id}`, sha: remoteMap[t.id].sha, branch: info.branch }); } - const ex = await ghApi(`${info.owner}/${info.repo}/contents/${info.path}/${newName}?ref=${info.branch}`); - await ghApi(`${info.owner}/${info.repo}/contents/${info.path}/${newName}`, "PUT", { message: `Sync thread ${t.id}`, content: utob(JSON.stringify(msgs, null, 2)), branch: info.branch, sha: ex?.sha }); + const ex = await ghApi(`${info.apiPath}/${newName}?ref=${info.branch}`); + await ghApi(`${info.apiPath}/${newName}`, "PUT", { message: `Sync thread ${t.id}`, content: utob(JSON.stringify(msgs, null, 2)), branch: info.branch, sha: ex?.sha }); t.status = "synced"; } } @@ -1457,7 +1456,7 @@ $(el.threadSyncBtn).on("click", async () => { await THREAD.save(); alert("Pushed to GitHub."); } else { - const items = await ghApi(`${info.owner}/${info.repo}/contents/${info.path}?ref=${info.branch}`); + const items = await ghApi(`${info.apiPath}?ref=${info.branch}`); if (!items) { THREAD.list = []; await THREAD.save(); diff --git a/dist/index.html b/dist/index.html index f592f21..d2b28c8 100644 --- a/dist/index.html +++ b/dist/index.html @@ -12,7 +12,7 @@ - + diff --git a/dist/sw.js b/dist/sw.js index e670f4e..384ab35 100644 --- a/dist/sw.js +++ b/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),c={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>c[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"5f7ff0e511e85ad6a5d165a56b5997c2"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-Dk1VBKCH.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); +if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let o={};const c=e=>s(e,t),l={module:{uri:t},exports:o,require:c};i[t]=Promise.all(n.map(e=>l[e]||c(e))).then(e=>(r(...e),o))}}define(["./workbox-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"0bdb9c92bc46620107f6d34ba6a9bbae"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-DiYgOCm5.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});