Skip to content

Commit

Permalink
Chapter and verse counts; ok button for multiple imports
Browse files Browse the repository at this point in the history
  • Loading branch information
eb1 committed May 14, 2015
1 parent b4ef54b commit 158750d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions www/js/views/DocumentViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ define(function (require) {
var markerList = new USFM.MarkerCollection();
var marker = null;
var lastAdapted = 0;
var verses = 0;
var verses = [];
var verseCount = 0;
var hasPunct = false;
var punctIdx = 0;
Expand Down Expand Up @@ -752,7 +752,7 @@ define(function (require) {
(arr[i] === "\\v") || (arr[i] === "\\va") || (arr[i] === "\\vp")) {
// join with the next
i++;
markers += arr[i];
markers += " " + arr[i];
}
i++;
} else if (arr[i].length === 0) {
Expand All @@ -771,6 +771,7 @@ define(function (require) {
chapter.set('versecount', verseCount);
chapter.set('lastadapted', lastAdapted);
verses.push(verseCount); // add this chapter's verseCount to the array
chapter.trigger('change');
verseCount = 0; // reset for the next chapter
lastAdapted = 0; // reset for the next chapter
stridx = markers.indexOf("\\c ") + 3;
Expand All @@ -787,7 +788,7 @@ define(function (require) {
});
chapters.add(chapter);
chapter.trigger('change');
console.log(": " + $(this).attr('s') + ", " + chapterID);
console.log(chapterName + ": " + chapterID);
}
// also do some processing for verse markers
if (markers && markers.indexOf("\\v ") !== -1) {
Expand Down Expand Up @@ -858,6 +859,7 @@ define(function (require) {
verses.push(verseCount);
}
book.set('chapters', verses);
book.trigger('change');

// done parsing -- update the status
if (status.length > 0) {
Expand Down Expand Up @@ -939,6 +941,7 @@ define(function (require) {
console.log("browserImportDocs");
$(".topcoat-progress-bar").show();
$("#progress").attr("style", "width: 0%;");
curFileIdx = 0;
var fileindex = 0;
var files = event.currentTarget.files;
fileCount = files.length;
Expand Down Expand Up @@ -968,6 +971,7 @@ define(function (require) {
fileCount = selected.length;
// Get a "real" file object for each of the selected files.
// This requires using the html5 filesystem API.
curFileIdx = 0;
var fileindex = 0;
var i = 0;
var project = this.model;
Expand Down

0 comments on commit 158750d

Please sign in to comment.