fixed tallies

This commit is contained in:
unknown 2021-03-26 22:02:27 -04:00
parent 2e5d6aa4db
commit c3f9325a51

View File

@ -52,11 +52,11 @@ let ElemItem = props =>
return h("div", {key:0}, [ return h("div", {key:0}, [
h("div", {key:1}, h("div", {key:1},
[ [
h("span", {key:0}, props.title), h("span", {key:2}, props.title),
h("em", {key:1}, props.id) h("em", {key:3}, props.id)
] ]
), ),
h("small", {key:3}, props.bible) h("small", {key:4}, props.bible)
]) ])
}; };
let ElemPager = ({count, active}) => let ElemPager = ({count, active}) =>
@ -222,6 +222,10 @@ let ElemTreeNode = ({node, tree}) =>
let Node = { let Node = {
Create:(inID, inDisplay, inChildren)=> Create:(inID, inDisplay, inChildren)=>
{ {
if(!inDisplay)
{
inDisplay = inID;
}
let node = { let node = {
ID:inID, ID:inID,
Display:inDisplay, Display:inDisplay,
@ -311,6 +315,7 @@ var App = {
Active:[], Active:[],
Root: Root:
Node.Create("root", "All", [ Node.Create("root", "All", [
Node.Create("", "Unclassified"),
Node.Create("ideologies", "Ideologies", [ Node.Create("ideologies", "Ideologies", [
Node.Create("gospel-the", "The Gospel"), Node.Create("gospel-the", "The Gospel"),
Node.Create("free-will", "Free Will"), Node.Create("free-will", "Free Will"),
@ -328,6 +333,7 @@ var App = {
Active:[], Active:[],
Root: Root:
Node.Create("all", "All", [ Node.Create("all", "All", [
Node.Create("", "Unclassified"),
Node.Create("old ", "Old Testament", Node.Create("old ", "Old Testament",
[ [
Node.Create("pent", "Pentatuch", Node.Create("pent", "Pentatuch",
@ -359,7 +365,7 @@ var App = {
Node.Create("Psalms", "Psalms"), Node.Create("Psalms", "Psalms"),
Node.Create("Proverbs", "Proverbs"), Node.Create("Proverbs", "Proverbs"),
Node.Create("Ecclesiastes", "Ecclesiastes"), Node.Create("Ecclesiastes", "Ecclesiastes"),
Node.Create("Song of Songs", "Song of Songs"), Node.Create("Song of Solomon", "Song of Songs"),
]), ]),
Node.Create("majo", "Major Prophets", Node.Create("majo", "Major Prophets",
[ [
@ -371,27 +377,35 @@ var App = {
]), ]),
Node.Create("mino", "Minor Prophets", Node.Create("mino", "Minor Prophets",
[ [
Node.Create("Hosea", "Hosea"), Node.Create("Hosea"),
Node.Create("Joel", "Joel"), Node.Create("Joel"),
Node.Create("Amos", "Amos"), Node.Create("Amos"),
Node.Create("Obadiah", "Obadiah"), Node.Create("Obadiah"),
Node.Create("Jonah", "Jonah"), Node.Create("Jonah"),
Node.Create("Micah", "Micah"), Node.Create("Micah"),
Node.Create("Nahum", "Nahum"), Node.Create("Nahum"),
Node.Create("Habakkuk", "Habakkuk"), Node.Create("Habakkuk"),
Node.Create("Zephaniah", "Zephaniah"), Node.Create("Zephaniah"),
Node.Create("Haggai", "Haggai"), Node.Create("Haggai"),
Node.Create("Zechariah", "Zechariah"), Node.Create("Zechariah"),
Node.Create("Malachi", "Malachi") Node.Create("Malachi")
]) ])
]), ]),
Node.Create("nt", "New Testament", [ Node.Create("nt", "New Testament", [
Node.Create("1", "Matthew"), Node.Create("gospels", "The Gospels", [
Node.Create("2", "Mark"), Node.Create("Matthew"),
Node.Create("3", "Luke"), Node.Create("Mark"),
Node.Create("4", "John"), Node.Create("Luke"),
Node.Create("5", "Acts"), Node.Create("John"),
Node.Create("6", "Romans"), ]),
Node.Create("Acts"),
Node.Create("Romans"),
Node.Create("1 Corinthians"),
Node.Create("2 Corinthians"),
Node.Create("Galatians"),
Node.Create("Ephesians"),
Node.Create("1 Thessalonians"),
Node.Create("Romans"),
]) ])
]) ])
} }
@ -499,7 +513,7 @@ var App = {
{ {
Node.IterateUp(inLeaf, inBranch=> Node.IterateUp(inLeaf, inBranch=>
{ {
inBranch.Leaves = inBranch.Leaves.concat(inLeaf.Leaves); inBranch.Leaves = _.union(inBranch.Leaves, inLeaf.Leaves)
}); });
}; };
@ -511,26 +525,25 @@ var App = {
let id = columns[i+1]; let id = columns[i+1];
let year = columns[i+2]; let year = columns[i+2];
let bible = columns[i+3].split("*"); let bible = columns[i+3].split("*");
var topics; let topics = columns[i+4].split("*");
try
{
topics = columns[i+4].split("*");
}
catch(e)
{
console.log(e);
}
let output = { title, id, year, topics, bible }; let output = { title, id, year, topics, bible };
let matched = false;
topics.forEach(t=> topics.forEach(t=>
{ {
let match = structTopics[t]; let match = structTopics[t];
if(match) if(match)
{ {
match.Leaves.push(output); match.Leaves.push(output);
matched = true;
} }
}); });
if(!matched)
{
structTopics[""].Leaves.push(output);
}
matched = false;
bible.forEach(t=> bible.forEach(t=>
{ {
let passage = Util.ParsePassage(t); let passage = Util.ParsePassage(t);
@ -538,15 +551,20 @@ var App = {
if(match) if(match)
{ {
match.Leaves.push(output); match.Leaves.push(output);
matched = true;
} }
}); });
if(!matched)
{
structBible[""].Leaves.push(output);
}
App.State.Items.All[Math.floor(i/4)] = output; App.State.Items.All.push(output);
} }
Object.values(structTopics).forEach(itrUp); Object.values(structTopics).forEach(itrUp);
Object.values(structBible).forEach(itrUp); Object.values(structBible).forEach(itrUp);
console.log(App.State.Items.All.length);
}) })
.then(inAccept=> .then(inAccept=>
{ {