Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
First blank verse was just incrementing by 1, not 200 (i.e., we needed to give more room for subsequent import data)
  • Loading branch information
eb1 committed Aug 2, 2024
1 parent d2ab82a commit 7e846db
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions www/js/views/DocumentViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -3573,13 +3573,17 @@ define(function (require) {
verseID = window.Application.generateUUID(); // new verse in a new chapter -- create a new verse ID
norder += 100;
}
// EDB 30 Aug 2021: add blank verses
// EDB 30 Aug 2021: add blank verses (middle of content)
var vCount = (markers.match(/\\v /g) || []).length;
verseCount = verseCount + vCount; // most of the time, this will just increment by 1
if (vCount > 1) {
// special case -- blank verses
console.log("Blank verses found: " + vCount);
var tmpMrks, Idx1, Idx2;
if (spsExisting.length === 0) {
// new content -- give this verse some room, in case we come back and merge data in a subsequent import
norder = norder + 200;
}
for (var vIdx = 0; vIdx < (vCount - 1); vIdx++) {
// pull out the marker for this blank verse
Idx1 = markers.indexOf("\\v ", 0); // _this_ verse
Expand Down Expand Up @@ -3730,6 +3734,9 @@ define(function (require) {
break; // exit the for loop
}
}
} else {
// no source phrases -- just add space so we can go back in and fill in the verse in a subsequent merge
norder = norder + 200; // en/KJV longest is 90 words/verse (Esther 8:9)
}
sp = new spModel.SourcePhrase({
spid: spID,
Expand All @@ -3747,7 +3754,6 @@ define(function (require) {
prepuncts = "";
follpuncts = "";
punctIdx = 0;
norder = norder + 100; // en/KJV longest is 90 words/verse (Esther 8:9)
sps.push(sp);
// if necessary, send the next batch of SourcePhrase INSERT transactions
if ((sps.length % MAX_BATCH) === 0) {
Expand Down

0 comments on commit 7e846db

Please sign in to comment.