@@ -125,7 +125,6 @@ export async function randomPassage() {
125125 }
126126}
127127export function nextPassage ( ) {
128- < << << << HEAD
129128 let bookIdx = BOOK_ORDER . indexOf ( state . settings . manualBook ) ;
130129 let chap = state . settings . manualChapter ;
131130 const maxCh = CHAPTER_COUNTS [ state . settings . manualBook ] ;
@@ -158,95 +157,21 @@ export function prevPassage() {
158157 updateManualNavigation ( nextBook , nextChapter ) ;
159158}
160159function updateManualNavigation ( book , chapter ) {
161- = === ===
162- if ( state . settings . readingMode === 'readingPlan' ) {
163- const plan = getActivePlan ( ) ;
164- const len = plan . length ;
165- let newIndex = ( state . settings . currentPassageIndex + 1 ) % len ;
166- if ( newIndex < 0 ) newIndex = len - 1 ;
167- state . settings . currentPassageIndex = newIndex ;
168- const passage = plan [ newIndex ] ;
169- const translation = getCurrentTranslation ( ) ;
170- updateURL ( translation , passage . book , passage . chapter ) ;
171- updateUIMode ( 'readingPlan' , translation , passage . displayRef ) ;
172- loadPassage ( passage . book , passage . chapter , translation ) ;
173- syncSelectorsToReadingPlan ( ) ;
174- } else {
175- let bookIdx = BOOK_ORDER . indexOf ( state . settings . manualBook ) ;
176- let chap = state . settings . manualChapter ;
177- const maxCh = CHAPTER_COUNTS [ state . settings . manualBook ] ;
178- let nextBook = state . settings . manualBook ;
179- let nextChapter = chap ;
180- if ( chap < maxCh ) {
181- nextChapter = chap + 1 ;
182- } else if ( bookIdx < BOOK_ORDER . length - 1 ) {
183- nextBook = BOOK_ORDER [ bookIdx + 1 ] ;
184- nextChapter = 1 ;
185- } else {
186- return ;
187- }
188- updateManualNavigation ( nextBook , nextChapter ) ;
189- }
190- document . getElementById ( 'scriptureSection' ) . scrollTop = 0 ;
191- }
192- export function prevPassage ( ) {
193- if ( state . settings . readingMode === 'readingPlan' ) {
194- const plan = getActivePlan ( ) ;
195- const len = plan . length ;
196- let newIndex = ( state . settings . currentPassageIndex - 1 + len ) % len ;
197- state . settings . currentPassageIndex = newIndex ;
198- const passage = plan [ newIndex ] ;
199- const translation = getCurrentTranslation ( ) ;
200- updateURL ( translation , passage . book , passage . chapter ) ;
201- updateUIMode ( 'readingPlan' , translation , passage . displayRef ) ;
202- loadPassage ( passage . book , passage . chapter , translation ) ;
203- syncSelectorsToReadingPlan ( ) ;
204- } else {
205- let bookIdx = BOOK_ORDER . indexOf ( state . settings . manualBook ) ;
206- let chap = state . settings . manualChapter ;
207- let nextBook = state . settings . manualBook ;
208- let nextChapter = chap ;
209- if ( chap > 1 ) {
210- nextChapter = chap - 1 ;
211- } else if ( bookIdx > 0 ) {
212- const prevBook = BOOK_ORDER [ bookIdx - 1 ] ;
213- nextBook = prevBook ;
214- nextChapter = CHAPTER_COUNTS [ prevBook ] ;
215- } else {
216- return ;
217- }
218- updateManualNavigation ( nextBook , nextChapter ) ;
219- }
220- document . getElementById ( 'scriptureSection' ) . scrollTop = 0 ;
221- }
222- function updateManualNavigation ( book , chapter ) {
223- state . settings . readingMode = 'manual' ;
224- > >>> >>> d11be95798768600c1b682f2957094b98cdb2d61
225160 state . settings . manualBook = book ;
226161 state . settings . manualChapter = chapter ;
227162 const translation = getCurrentTranslation ( ) ;
228163 updateURL ( translation , book , chapter ) ;
229164 const displayRef = `${ book } ${ chapter } ` ;
230- < << << << HEAD
231165 updateUIMode ( translation , displayRef ) ;
232- = === ===
233- updateUIMode ( 'manual' , translation , displayRef ) ;
234- > >>> >>> d11be95798768600c1b682f2957094b98cdb2d61
235166 loadSelectedChapter ( book , chapter ) ;
236167 syncBookChapterSelectors ( ) ;
237168 saveToStorage ( ) ;
238169 if ( state . settings . referencePanelOpen ) {
239170 updateReferencePanel ( ) ;
240171 }
241172}
242- << < << << HEAD
243173function updateUIMode ( translation , displayRef ) {
244174 const headerTitleEl = document . getElementById ( 'passageHeaderTitle' ) ;
245- = === ===
246- function updateUIMode ( mode , translation , displayRef ) {
247- const headerTitleEl = document . getElementById ( 'passageHeaderTitle' ) ;
248- const planLabelEl = document . getElementById ( 'planLabel' ) ;
249- > >>> >>> d11be95798768600c1b682f2957094b98cdb2d61
250175 const passageRefElement = document . getElementById ( 'passageReference' ) ;
251176 if ( headerTitleEl ) {
252177 headerTitleEl . textContent = `Holy Bible: ${ translation } ` ;
@@ -255,16 +180,6 @@ function updateUIMode(mode, translation, displayRef) {
255180 passageRefElement . textContent = displayRef ;
256181 state . currentPassageReference = displayRef ;
257182 }
258- < << << << HEAD
259- = === ===
260- if ( planLabelEl ) {
261- if ( mode === 'readingPlan' ) {
262- planLabelEl . textContent = `Reading plan: ${ getCurrentPlanLabel ( ) } ` ;
263- } else {
264- planLabelEl . textContent = '' ;
265- }
266- }
267- > >>> >>> d11be95798768600c1b682f2957094b98cdb2d61
268183}
269184export function syncBookChapterSelectors ( ) {
270185 const bookSel = document . getElementById ( 'bookSelect' ) ;
@@ -345,10 +260,6 @@ export function navigateFromURL() {
345260 return false ;
346261}
347262function loadDefaultPassage ( params ) {
348- < << << << HEAD
349- = === ===
350- state . settings . readingMode = 'readingPlan' ;
351- > >>> >>> d11be95798768600c1b682f2957094b98cdb2d61
352263 state . settings . manualBook = params . book ;
353264 state . settings . manualChapter = params . chapter ;
354265 state . settings . bibleTranslation = params . translation ;
0 commit comments