mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-26 08:49:49 -04:00
MAID: cleanup uneeded last verse code now that you store that data in Reference
This commit is contained in:
parent
e3b84c7913
commit
7c91fc472c
@ -105,4 +105,4 @@
|
|||||||
"android"
|
"android"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -53,7 +53,9 @@ export class Passage implements OnInit
|
|||||||
|
|
||||||
next()
|
next()
|
||||||
{
|
{
|
||||||
if (this.ref.Section.end.verse !== '*' && this.ref.Section.end.verse !== this.data.lastverse.toString())
|
let last_verse_for_end = this.ref.Section.end.book.chapters[parseInt(this.ref.Section.end.chapter)].toString();
|
||||||
|
|
||||||
|
if (this.ref.Section.end.verse !== '*' && this.ref.Section.end.verse !== last_verse_for_end)
|
||||||
this.ref.Section.end.chapter = this.ref.Section.end.chapter;
|
this.ref.Section.end.chapter = this.ref.Section.end.chapter;
|
||||||
else
|
else
|
||||||
this.ref.Section.end.chapter = (parseInt(this.ref.Section.end.chapter) + 1).toString();
|
this.ref.Section.end.chapter = (parseInt(this.ref.Section.end.chapter) + 1).toString();
|
||||||
@ -91,6 +93,8 @@ export class Passage implements OnInit
|
|||||||
|
|
||||||
expand()
|
expand()
|
||||||
{
|
{
|
||||||
|
let last_verse_for_end = this.ref.Section.end.book.chapters[parseInt(this.ref.Section.end.chapter)];
|
||||||
|
|
||||||
// if your verse is at the beginning, to go the prev chapter and add 3 verses from that
|
// if your verse is at the beginning, to go the prev chapter and add 3 verses from that
|
||||||
if (parseInt(this.ref.Section.start.verse) < 4)
|
if (parseInt(this.ref.Section.start.verse) < 4)
|
||||||
{
|
{
|
||||||
@ -106,18 +110,18 @@ export class Passage implements OnInit
|
|||||||
this.ref.Section.start.verse = (parseInt(this.ref.Section.start.verse) - 3).toString();
|
this.ref.Section.start.verse = (parseInt(this.ref.Section.start.verse) - 3).toString();
|
||||||
|
|
||||||
// if your verse is at the end, go to the next chapter
|
// if your verse is at the end, go to the next chapter
|
||||||
if (this.ref.Section.end.verse === '*' || parseInt(this.ref.Section.end.verse) + 3 > this.data.lastverse)
|
if (this.ref.Section.end.verse === '*' || parseInt(this.ref.Section.end.verse) + 3 > last_verse_for_end)
|
||||||
{
|
{
|
||||||
this.ref.Section.end.chapter = (parseInt(this.ref.Section.end.chapter) + 1).toString();
|
this.ref.Section.end.chapter = (parseInt(this.ref.Section.end.chapter) + 1).toString();
|
||||||
if (this.ref.Section.end.verse === '*')
|
if (this.ref.Section.end.verse === '*')
|
||||||
this.ref.Section.end.verse = '3';
|
this.ref.Section.end.verse = '3';
|
||||||
else
|
else
|
||||||
this.ref.Section.end.verse = (parseInt(this.ref.Section.end.verse) + 3 - this.data.lastverse).toString();
|
this.ref.Section.end.verse = (parseInt(this.ref.Section.end.verse) + 3 - last_verse_for_end).toString();
|
||||||
|
|
||||||
if (this.ref.Section.end.chapter === (this.ref.Section.end.book.last_chapter + 1).toString())
|
if (this.ref.Section.end.chapter === (this.ref.Section.end.book.last_chapter + 1).toString())
|
||||||
{
|
{
|
||||||
this.ref.Section.end.chapter = this.ref.Section.end.book.last_chapter.toString();
|
this.ref.Section.end.chapter = this.ref.Section.end.book.last_chapter.toString();
|
||||||
this.ref.Section.end.verse = this.data.lastverse.toString();
|
this.ref.Section.end.verse = last_verse_for_end.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // or add 3 verses
|
else // or add 3 verses
|
||||||
|
@ -32,8 +32,7 @@ export class BibleService
|
|||||||
testament: '',
|
testament: '',
|
||||||
ref: Reference.toString(section),
|
ref: Reference.toString(section),
|
||||||
status: 0,
|
status: 0,
|
||||||
msg: ':)',
|
msg: ':)'
|
||||||
lastverse: 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Number(section.start.chapter) > section.start.book.last_chapter)
|
if (Number(section.start.chapter) > section.start.book.last_chapter)
|
||||||
@ -121,7 +120,6 @@ export class BibleService
|
|||||||
"ch": this.chapters[j].ch,
|
"ch": this.chapters[j].ch,
|
||||||
"vss": vss
|
"vss": vss
|
||||||
});
|
});
|
||||||
this.result.lastverse = this.chapters[j].vss.length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,8 +143,7 @@ export type BiblePassageResult = {
|
|||||||
testament: string,
|
testament: string,
|
||||||
ref: string,
|
ref: string,
|
||||||
status: number,
|
status: number,
|
||||||
msg: string,
|
msg: string,
|
||||||
lastverse: number,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type BiblePassage = {
|
type BiblePassage = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user