R1 cleanup: collAnon and dead code gone, no IndexedDB, honest PWA files
Build / Build (push) Successful in 51s
Build / Build (push) Successful in 51s
Starts the completion program (SocialPub docs/ROADMAP.md, "Owner decisions on finishing everything", 2026-10-17). - The localizer's namespace is decePubClient.Services; collAnon is gone from the repo. - Dead code: PagesBase, VConstants, SettingsOptions, ViewLanguage, unused APIs routes, InstanceService.Self, RequestStats.LastOf/AverageMs, PostAnon/DeleteTotallyAnon, unused AppStatusService methods and their main.js helpers (the app badge stays for Web Push), ExtensionMethods/SUtility leftovers (Markdig and BlazorZXingJs packages go), unused PublicCacheData/PageSettings/AppConfiguration fields, commented-out code. - The client log in IndexedDB, which nothing ever read, goes with the whole IndexedDB layer (DnetIndexedDb, IStorage): logs go to the browser console; main.js deletes the old "data" database once. - The solution names the real ClientModels project. Unused vendor assets (fontawesome, solid, open-iconic, rxjs) go. - robots.txt disallows everything; manifest.json and index.html say decePub; the service worker's cache name follows each publish's assets version, so old caches are purged. - MessageType is Visibility (member names kept: they are resx keys); ExpandMessage.razor is Thread.razor (same route). - i18n: dead keys removed, Italian "camera" is "punto di vista", DInputBase/DCalendar validation messages come from ErrorMessages, DataTransfer's spinner has its label. - CLAUDE.md follows: client storage, JS interop, PWA, the D fields' messages. Verified: dotnet build decePubClient.csproj and decePubClient.sln -c Release (0 errors, no new warnings); a Pasture publish served by the pasture's decepub peer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
1 parent
e4414f1ac9
commit
fd2f2e7c65
79 files changed
+155
-6673
No files matched your search
+10
-99
@@ -15,13 +15,12 @@ window.logFromJs = (message, where) => {
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
window.isServiceWorkerAvailable = () => {
|
||||
try {
|
||||
return navigator.serviceWorker.valueOf().controller != null
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "isServiceWorkerAvailable")
|
||||
}
|
||||
// The client once kept its error log in IndexedDB (DnetIndexedDb's database "data"). Nothing uses IndexedDB now, so a
|
||||
// browser that still holds that database drops it.
|
||||
try {
|
||||
window.indexedDB?.deleteDatabase("data")
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
window.getLanguage = () => {
|
||||
try {
|
||||
@@ -31,27 +30,9 @@ window.getLanguage = () => {
|
||||
window.logFromJs(e.message, "getLanguage")
|
||||
}
|
||||
}
|
||||
window.setLanguage = (lang) => {
|
||||
try {
|
||||
navigator.language = lang
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "setLanguage")
|
||||
}
|
||||
}
|
||||
window.isOnline = async () => {
|
||||
try {
|
||||
const isOnline = navigator.onLine
|
||||
//const url = "https://contents.nuvola.xyz/api/assets/6d9f5e55-2034-456f-92e7-d9ec51066443"
|
||||
//let isOnlineStatusCode = true
|
||||
|
||||
//try {
|
||||
// const online = await fetch(url)
|
||||
// isOnlineStatusCode = online.status >= 200 && online.status < 399
|
||||
//} catch (_) {
|
||||
// isOnlineStatusCode = false
|
||||
//}
|
||||
|
||||
if (navigator.connection !== undefined &&
|
||||
navigator.connection.effectiveType !== undefined &&
|
||||
navigator.connection.type !== undefined) {
|
||||
@@ -59,54 +40,15 @@ window.isOnline = async () => {
|
||||
return isOnline
|
||||
|
||||
return navigator.connection.type === "cellular" ?
|
||||
navigator.connection.effectiveType.indexOf("2g") === -1 /*&& isOnlineStatusCode*/ :
|
||||
navigator.connection.effectiveType.indexOf("2g") === -1 :
|
||||
true
|
||||
} else
|
||||
return isOnline //&& isOnlineStatusCode
|
||||
return isOnline
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "isOnline")
|
||||
}
|
||||
}
|
||||
window.clearCache = async () => {
|
||||
try {
|
||||
const cachesNames = await caches.keys()
|
||||
for (let i = 0; i < cachesNames.length; i++)
|
||||
await caches.delete(cachesNames[i])
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "clearCache")
|
||||
}
|
||||
}
|
||||
window.clearLocalStorage = () => {
|
||||
try {
|
||||
localStorage.removeItem("PrivateCacheData")
|
||||
localStorage.removeItem("AuthData")
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "clearLocalStorage")
|
||||
}
|
||||
}
|
||||
window.reloadPage = () => {
|
||||
try {
|
||||
location.reload(true)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "reloadPage")
|
||||
}
|
||||
}
|
||||
window.getHeight = (classId) => {
|
||||
try {
|
||||
const elements = document.querySelectorAll(classId)
|
||||
let px = 0
|
||||
if (!elements) return 0
|
||||
elements.forEach(v => px += v.offsetHeight)
|
||||
return px
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "getHeight")
|
||||
}
|
||||
}
|
||||
window.setAppBadge = (counter) => {
|
||||
try {
|
||||
navigator.setAppBadge(counter)
|
||||
@@ -168,7 +110,6 @@ window.revealActive = strip => {
|
||||
window.logFromJs(e.message, "revealActive")
|
||||
}
|
||||
}
|
||||
// a phone: narrower than Tailwind's md, or held sideways (as short as the short: variant)
|
||||
// the reader asked for less motion: what would move by itself (a gifv) waits for a tap
|
||||
window.prefersReducedMotion = () => {
|
||||
try {
|
||||
@@ -179,7 +120,7 @@ window.prefersReducedMotion = () => {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// a phone: narrower than Tailwind's md, or held sideways (as short as the short: variant)
|
||||
window.isMobileMedia = () => {
|
||||
try {
|
||||
return window.matchMedia("(max-width: 767.98px), (max-height: 30rem)").matches
|
||||
@@ -188,37 +129,7 @@ window.isMobileMedia = () => {
|
||||
window.logFromJs(e.message, "isMobileMedia")
|
||||
}
|
||||
}
|
||||
window.canShareStuff = () => {
|
||||
try {
|
||||
return navigator.share !== undefined
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "canShareStuff")
|
||||
}
|
||||
}
|
||||
window.shareTextUrl = (title, text, url) => {
|
||||
try {
|
||||
navigator.share({
|
||||
title: title,
|
||||
text: text,
|
||||
url: url
|
||||
})
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "shareTextUrl")
|
||||
}
|
||||
}
|
||||
window.shareText = (title, text) => {
|
||||
try {
|
||||
navigator.share({
|
||||
title: title,
|
||||
text: text
|
||||
})
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
window.logFromJs(e.message, "shareText")
|
||||
}
|
||||
}// This device's position for located posts and the Nearby feed, asked only when the reader chooses one of them. It
|
||||
// This device's position for located posts and the Nearby feed, asked only when the reader chooses one of them. It
|
||||
// goes to PrivaPub only, which keeps located posts on the server and rounds what it stores.
|
||||
window.feedPosition = () => new Promise(resolve => {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user