moved to API

This commit is contained in:
2026-03-08 22:24:34 -07:00
parent cf6b2611aa
commit 2caf566bf6
94 changed files with 1257 additions and 40930 deletions

View File

@@ -3,6 +3,7 @@
let config = {
getAlphabets: () => null,
getGematriaDb: () => null,
getGematriaElements: () => ({
cipherEl: null,
inputEl: null,
@@ -24,6 +25,10 @@
return config.getAlphabets?.() || null;
}
function getConfiguredGematriaDb() {
return config.getGematriaDb?.() || null;
}
function getElements() {
return config.getGematriaElements?.() || {
cipherEl: null,
@@ -169,14 +174,20 @@
return state.loadingPromise;
}
state.loadingPromise = fetch("data/gematria-ciphers.json")
.then((response) => {
if (!response.ok) {
throw new Error(`Failed to load gematria ciphers (${response.status})`);
state.loadingPromise = Promise.resolve()
.then(async () => {
const configuredDb = getConfiguredGematriaDb();
if (configuredDb) {
return configuredDb;
}
return response.json();
const referenceData = await window.TarotDataService?.loadReferenceData?.();
return referenceData?.gematriaCiphers || null;
})
.then((db) => {
if (!db) {
throw new Error("Gematria cipher data unavailable from API.");
}
state.db = sanitizeGematriaDb(db);
return state.db;
})
@@ -342,6 +353,11 @@
...config,
...nextConfig
};
const configuredDb = getConfiguredGematriaDb();
if (configuredDb) {
state.db = sanitizeGematriaDb(configuredDb);
}
}
window.AlphabetGematriaUi = {