Sync Mode6Test frontend improvements: pinch zoom 500% max, no flicker/flip, deferred rendering

This commit is contained in:
2026-01-20 19:33:12 +00:00
parent cbb14e69fb
commit 7de75b0596
44 changed files with 168752 additions and 13 deletions
+39
View File
@@ -0,0 +1,39 @@
// PocketBase auth bootstrap shared by pages
(function (global) {
const pb = new PocketBase('https://pocketbase.ccllc.pro');
function authHeaders() {
if (pb.authStore.isValid && pb.authStore.token) {
return { Authorization: `Bearer ${pb.authStore.token}` };
}
return {};
}
function getDisplayName() {
const model = pb.authStore.model || {};
return (
model.display_name ||
model.name ||
model.email ||
model.username ||
'Unknown'
);
}
function getEmail() {
const model = pb.authStore.model || {};
// Prefer email, but fall back to username if email missing
return model.email || model.username || null;
}
async function ensureAuth() {
if (pb.authStore.isValid) return true;
const path = new URL(window.location.href).pathname;
if (!path.endsWith('signin.html')) {
window.location.href = 'signin.html';
}
return false;
}
global.Auth = { pb, authHeaders, ensureAuth, getDisplayName, getEmail };
})(window);