Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/lib/components/ScriptureViewSofria.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ LOGGING:
let displayingIntroduction = $state(false);

const fnc = 'abcdefghijklmnopqrstuvwxyz';
/** calculate letter index from number
*
* 0-25 => a-z; 26+ => aa, ab, ... zz
*/
function createLetterIndex(index: number) {
return (
(index >= fnc.length ? fnc.charAt(Math.floor(index / fnc.length) - 1) : '') +
fnc.charAt(index % fnc.length)
);
}
let planDivObserver = $state(null); // To store the observer instance
let planObservationCompleted = $state(false);
// Function to observe the visibility of the plan div
Expand Down Expand Up @@ -290,7 +300,7 @@ LOGGING:
default:
break;
}
const phraseIndex = fnc.charAt(workspace.currentPhraseIndex);
const phraseIndex = createLetterIndex(workspace.currentPhraseIndex);
div.id = workspace.currentVerse + phraseIndex;
div.setAttribute('data-verse', workspace.currentVerse);
div.setAttribute('data-phrase', phraseIndex);
Expand Down Expand Up @@ -381,7 +391,7 @@ LOGGING:
}

if (callerSymbol === '+') {
callerSymbol = fnc.charAt(workspace.footnoteIndex % 26);
callerSymbol = createLetterIndex(workspace.footnoteIndex);
workspace.footnoteIndex++;
}

Expand Down