From c6d33dfe36e61cbb69e805f475dcc0818e8b0fc3 Mon Sep 17 00:00:00 2001 From: Patrick Tang <36460266+patricksptang@users.noreply.github.com> Date: Thu, 31 Oct 2024 23:21:56 -0700 Subject: [PATCH] Update the summary page to David's suggestions. --- .../src/main/webapp/js/search_selection.js | 138 +++--- step-web/src/main/webapp/js/step.util.js | 419 ++++++++++-------- 2 files changed, 307 insertions(+), 250 deletions(-) diff --git a/step-web/src/main/webapp/js/search_selection.js b/step-web/src/main/webapp/js/search_selection.js index 739eeadc2d..cea473a827 100644 --- a/step-web/src/main/webapp/js/search_selection.js +++ b/step-web/src/main/webapp/js/search_selection.js @@ -18,73 +18,74 @@ step.searchSelect = { rangeWasUpdated: false, andOrNotUpdated: false, timer: undefined, + // idx2osisCHapterJsword has to stay here because when this is running inside the html files for iFrames, step.util is no reachable. idx2osisChapterJsword: { - "Gen": 0, - "Exo": 1, "Exod": 1, - "Lev": 2, - "Num": 3, - "Deu": 4, "Deut": 4, - "Jos": 5, "Josh": 5, - "Judg": 6, - "Rut": 7, "Ruth": 7, - "1Sa": 8, "1Sam": 8, - "2Sa": 9, "2Sam": 9, - "1Ki": 10, "1Kgs": 10, - "2Ki": 11, "2Kgs": 11, - "1Ch": 12, "1Chr": 12, - "2Ch": 13, "2Chr": 13, - "Ezr": 14, "Ezra": 14, - "Neh": 15, - "Est": 16, "Esth": 16, - "Job": 17, - "Psa": 18, "Ps": 18, - "Pro": 19, "Prov": 19, - "Ecc": 20, "Eccl": 20, - "Song": 21, - "Isa": 22, - "Jer": 23, - "Lam": 24, - "Eze": 25, "Ezek": 25, - "Dan": 26, - "Hos": 27, - "Joe": 28, "Joel": 28, - "Amo": 29, "Amos": 29, - "Obd": 30, "Obad": 30, - "Jon": 31, "Jonah": 31, - "Mic": 32, - "Nah": 33, - "Hab": 34, - "Zep": 35, "Zeph": 35, - "Hag": 36, - "Zec": 37, "Zech": 37, - "Mal": 38, - "Mat": 39, "Matt": 39, - "Mar": 40, "Mark": 40, - "Luk": 41, "Luke": 41, - "Joh": 42, "John": 42, - "Act": 43, "Acts": 43, - "Rom": 44, - "1Cor": 45, - "2Cor": 46, - "Gal": 47, - "Eph": 48, - "Phili": 49, "Phil": 49, - "Col": 50, - "1Th": 51, "1Thess": 51, - "2Th": 52, "2Thess": 52, - "1Ti": 53, "1Tim": 53, - "2Ti": 54, "2Tim": 54, - "Tit": 55, "Titus": 55, - "Phile": 56, "Phlm": 56, - "Heb": 57, - "Jam": 58, "Jas": 58, - "1Pe": 59, "1Pet": 59, - "2Pe": 60, "2Pet": 60, - "1Jo": 61, "1John": 61, - "2Jo": 62, "2John": 62, - "3Jo": 63, "3John": 63, - "Jude": 64, - "Rev": 65 + "gen": 0, + "exo": 1, "exod": 1, + "lev": 2, + "num": 3, + "deu": 4, "deut": 4, + "jos": 5, "josh": 5, + "judg": 6, + "rut": 7, "ruth": 7, + "1sa": 8, "1sam": 8, + "2sa": 9, "2sam": 9, + "1ki": 10, "1kgs": 10, + "2ki": 11, "2kgs": 11, + "1ch": 12, "1chr": 12, + "2ch": 13, "2chr": 13, + "ezr": 14, "ezra": 14, + "neh": 15, + "est": 16, "esth": 16, + "job": 17, + "psa": 18, "ps": 18, + "pro": 19, "prov": 19, + "ecc": 20, "eccl": 20, + "song": 21, + "isa": 22, + "jer": 23, + "lam": 24, + "eze": 25, "ezek": 25, + "dan": 26, + "hos": 27, + "joe": 28, "joel": 28, + "amo": 29, "amos": 29, + "obd": 30, "obad": 30, + "jon": 31, "jonah": 31, + "mic": 32, + "nah": 33, + "hab": 34, + "zep": 35, "zeph": 35, + "hag": 36, + "zec": 37, "zech": 37, + "mal": 38, + "mat": 39, "matt": 39, + "mar": 40, "mark": 40, + "luk": 41, "luke": 41, + "joh": 42, "john": 42, + "act": 43, "acts": 43, + "rom": 44, + "1cor": 45, + "2cor": 46, + "gal": 47, + "eph": 48, + "phili": 49, "phil": 49, + "col": 50, + "1th": 51, "1thess": 51, + "2th": 52, "2thess": 52, + "1ti": 53, "1tim": 53, + "2ti": 54, "2tim": 54, + "tit": 55, "titus": 55, + "phile": 56, "phlm": 56, + "heb": 57, + "jam": 58, "jas": 58, + "1pe": 59, "1pet": 59, + "2pe": 60, "2pet": 60, + "1jo": 61, "1john": 61, + "2jo": 62, "2john": 62, + "3jo": 63, "3john": 63, + "jude": 64, + "rev": 65 }, groupsOT: [ {groupName: __s.book_of_moses, show: false, books: [0, 1, 2, 3, 4], bookOrderPos: [-1, -1, -1, -1, -1]}, @@ -600,7 +601,7 @@ step.searchSelect = { if (pos > -1) separatorChar = copyOfRange.substr(pos, 1); else pos = copyOfRange.length; var currentOsisID = copyOfRange.substr(0, pos); - var posOfBook = this.idx2osisChapterJsword[currentOsisID]; + var posOfBook = this.idx2osisChapterJsword[currentOsisID.toLowerCase()]; if ((posOfBook > -1) && (typeof arrayOfTyplicalBooksAndChapters !== "undefined") && (arrayOfTyplicalBooksAndChapters[posOfBook].length === 2)) { @@ -997,8 +998,7 @@ step.searchSelect = { shortNameToDisplay = (this.userLang.toLowerCase().indexOf("en") == 0) ? currentOsisID : data[i].suggestion.shortName.replace(/ /g, "").substr(0, 6); } var longID = currentOsisID; - //var posOfBook = step.util.bookOrderInBible(currentOsisID); // when this is running inside the html files for iFrames, this is no reachable. - var posOfBook = this.idx2osisChapterJsword[currentOsisID]; + var posOfBook = this.idx2osisChapterJsword[currentOsisID.toLowerCase()]; if (posOfBook > -1) { if (typeof step.passageSelect.osisChapterJsword[posOfBook][3] !== "undefined") longID = step.passageSelect.osisChapterJsword[posOfBook][3]; if (typeof arrayOfTyplicalBooksAndChapters !== "undefined") { diff --git a/step-web/src/main/webapp/js/step.util.js b/step-web/src/main/webapp/js/step.util.js index 60e7eff619..15f96cc484 100644 --- a/step-web/src/main/webapp/js/step.util.js +++ b/step-web/src/main/webapp/js/step.util.js @@ -2619,7 +2619,7 @@ step.util = { )()).modal("show"); step.util.blockBackgroundScrolling("videoModal"); }, - showSummary: function (reference) { + showSummary: function (reference, tabToShow) { element = document.getElementById('showBookOrChapterSummaryModal'); if (element) element.parentNode.removeChild(element); $(".modal-backdrop.in").remove(); @@ -2633,114 +2633,192 @@ step.util = { longBookName = arrayOfTyplicalBooksAndChapters[posOfBook][0]; var chapterNum = (tmpArray.length > 1) ? parseInt(tmpArray[1].split(":")[0].split("-")[0].split(";")[0]) : 1; if (typeof chapterNum !== "number") chapterNum = 1; - var bibleSummary = - '
Video overviews by the BibleProject' + - '
Overview of Old Testament' + - '
' + - '

From Eden to wilderness

' + - 'Genesis chapters 1-11 - Beginnings' + - '
Genesis chapters 12-50 - Abraham to Joseph' + - '
Exodus chapters 1-18 - Exodus from Egypt' + - '
Exodus chapters 19-40 - Covenant at Sinai' + - '
Leviticus - Ceremonial laws' + - '
Numbers - Wilderness years' + - '
Deuteronomy - Moses\' farewell' + - '

From conquest to King Saul

' + - 'Joshua - Taking the land' + - '
Judges - Living among enemies' + - '
Ruth - David\'s ancestors\' love story' + - '
1 Samuel - Prophets versus Kings' + - '

From King David to exile

' + - '2 Samuel - Uniting the Kingdom' + - '
1 Kings - Dividing the kingdom' + - '
2 Kings - End of Israel & Judah' + - '
1 Chronicles - Retelling 1 & 2 Samuel' + - '
2 Chronicles - Retelling Judah\'s Kings' + - '

Return and faith on trial

' + - 'Ezra - Return from exile' + - '
Nehemiah - Rebuilding Jerusalem' + - '
Esther - Surviving in exile' + - '
Job - Understanding suffering' + - '

Worship and wisdom

' + - 'Psalms - Songs of worship' + - '
Proverbs - Understanding society' + - '
Ecclesiastes - Understanding life' + - '
Song of Solomon - Understanding love' + - '

Major Prophets

' + - 'Isaiah chapters 1-39 - Judah\'s judgement' + - '
Isaiah chapters 40-66 - Comfort and hope' + - '
Jeremiah - Warnings of Judgement' + - '
Lamentations - Jerusalem\'s destruction' + - '
Ezekiel chapters 1-33 - Nations judge' + - '
Ezekiel chapters 34-48 - A new Temple' + - '
Daniel - Witnessing in exile' + - '

Minor (brief) Prophets

' + - 'Hosea - Acting out God\'s love' + - '
Joel - Day of the Lord' + - '
Amos - Judgement is inescapable' + - '
Obadiah - Judgement on Edom' + - '
Jonah - Anyone can repent' + - '
Micah - Judgement\'s restoration' + - '
Nahum - Judgement on Nineveh' + - '
Habakkuk - Judgement on evil' + - '
Zephaniah - Judgement\'s remnant' + - '
Haggai - Rebuilding the temple' + - '
Zechariah - Repentance after exile' + - '
Malachi - God is coming' + - '
' + - '
Overview of New Testament' + - '
' + - '

Life of Jesus

' + - 'Matthew chapters 1-13 - The King\'s ministry' + - '
Matthew chapters 14-28 - Opposition & victory' + - '
Mark - Jesus the Man' + - '
Luke chapters 1-9 - The saviour\'s ministry' + - '
Luke chapters 10-24 - Opposition & victory' + - '
John chapters 1-12 - God\'s son ministry' + - '
John chapters 13-21 - Opposition & victory' + - '
Acts chapters 1-12 - Peter grows the church' + - '
Acts chapters 13-28 - Paul spreads the church' + - '

Pauline letters to churches

' + - 'Romans - Paul\'s theology, need for justification' + - '
Romans - Life of those justified by faith' + - '
1 Corinthians - Church problems' + - '
2 Corinthians - Leadership problems' + - '
Galatians - Freedom from Law' + - '
Ephesians - Church unity' + - '
Philippians - Encouragement' + - '
Colossians - Christian lifestyle' + - '
1 Thessalonians - Expecting the End' + - '
2 Thessalonians - The End delayed' + - '

Pauline letters to individuals

' + - '1 Timothy - False teachings' + - '
2 Timothy - Paul\'s farewell' + - '
Titus - A difficult ministry' + - '
Philemon - Slaves as brothers' + - '

Letters from others

' + - 'Hebrews - Jewish Christianity' + - '
James - Trials of faith' + - '
1 Peter - Life among unbelievers' + - '
2 Peter - Peter\'s farewell' + - '
1 John - God loves us' + - '
2 John - Love each other' + - '
3 John - Practical love' + - '
Jude - Deserters' + - '

Prophecies for the future

' + - 'Revelation chapters 1-11 - The world gets worse' + - '
Revelation chapters 12-22 - Final war & peace' + - '' + - '
'; if ((osisID === "1Sam") || (osisID === "2Sam")) urlForiFrame = "1_2Sam"; else if ((osisID === "1Kngs") || (osisID === "2Kngs")) urlForiFrame = "1_2Kngs"; else if ((osisID === "1Chr") || (osisID === "2Chr")) urlForiFrame = "1_2Chr"; var curOsisID = osisID.toLowerCase(); $.getJSON("html/json/" + curOsisID + ".json", function(summary) { + var bibleSummary = + '
Videos listed below are from the BibleProject' + + '
Overview of Old Testament' + + '' + + '
' + + '

From Eden to wilderness

' + + 'Genesis chapters 1-11 - Beginnings' + + '' + + '
Genesis chapters 12-50 - Abraham to Joseph' + + '' + + '
Exodus chapters 1-18 - Exodus from Egypt' + + '' + + '
Exodus chapters 19-40 - Covenant at Sinai' + + '' + + '
Leviticus - Ceremonial laws' + + '' + + '
Numbers - Wilderness years' + + '' + + '
Deuteronomy - Moses\' farewell' + + '' + + '

From conquest to King Saul

' + + 'Joshua - Taking the land' + + '' + + '
Judges - Living among enemies' + + '' + + '
Ruth - David\'s ancestors\' love story' + + '' + + '
1 Samuel - Prophets versus Kings' + + '' + + '

From King David to exile

' + + '2 Samuel - Uniting the Kingdom' + + '' + + '
1 Kings - Dividing the kingdom' + + '' + + '
2 Kings - End of Israel & Judah' + + '' + + '
1 Chronicles - Retelling 1 & 2 Samuel' + + '' + + '
2 Chronicles - Retelling Judah\'s Kings' + + '' + + '

Return and faith on trial

' + + 'Ezra - Return from exile' + + '' + + '
Nehemiah - Rebuilding Jerusalem' + + '' + + '
Esther - Surviving in exile' + + '' + + '
Job - Understanding suffering' + + '' + + '

Worship and wisdom

' + + 'Psalms - Songs of worship' + + '' + + '
Proverbs - Understanding society' + + '' + + '
Ecclesiastes - Understanding life' + + '' + + '
Song of Solomon - Understanding love' + + '' + + '

Major Prophets

' + + 'Isaiah chapters 1-39 - Judah\'s judgement' + + '' + + '
Isaiah chapters 40-66 - Comfort and hope' + + '' + + '
Jeremiah - Warnings of Judgement' + + '' + + '
Lamentations - Jerusalem\'s destruction' + + '' + + '
Ezekiel chapters 1-33 - Nations judge' + + '' + + '
Ezekiel chapters 34-48 - A new Temple' + + '' + + '
Daniel - Witnessing in exile' + + '' + + '

Minor (brief) Prophets

' + + 'Hosea - Acting out God\'s love' + + '' + + '
Joel - Day of the Lord' + + '' + + '
Amos - Judgement is inescapable' + + '' + + '
Obadiah - Judgement on Edom' + + '' + + '
Jonah - Anyone can repent' + + '' + + '
Micah - Judgement\'s restoration' + + '' + + '
Nahum - Judgement on Nineveh' + + '' + + '
Habakkuk - Judgement on evil' + + '' + + '
Zephaniah - Judgement\'s remnant' + + '' + + '
Haggai - Rebuilding the temple' + + '' + + '
Zechariah - Repentance after exile' + + '' + + '
Malachi - God is coming' + + '' + + '
' + + '
Overview of New Testament' + + '' + + '
' + + '

Life of Jesus

' + + 'Matthew chapters 1-13 - The King\'s ministry' + + '' + + '
Matthew chapters 14-28 - Opposition & victory' + + '' + + '
Mark - Jesus the Man' + + '' + + '
Luke chapters 1-9 - The saviour\'s ministry' + + '' + + '
Luke chapters 10-24 - Opposition & victory' + + '' + + '
John chapters 1-12 - God\'s son ministry' + + '' + + '
John chapters 13-21 - Opposition & victory' + + '' + + '
Acts chapters 1-12 - Peter grows the church' + + '' + + '
Acts chapters 13-28 - Paul spreads the church' + + '' + + '

Pauline letters to churches

' + + 'Romans chapters 1 - 4 - Paul\'s theology, need for justification' + + '' + + '
Romans chapters 5 - 16 - Life of those justified by faith' + + '' + + '
1 Corinthians - Church problems' + + '' + + '
2 Corinthians - Leadership problems' + + '' + + '
Galatians - Freedom from Law' + + '' + + '
Ephesians - Church unity' + + '' + + '
Philippians - Encouragement' + + '' + + '
Colossians - Christian lifestyle' + + '' + + '
1 Thessalonians - Expecting the End' + + '' + + '
2 Thessalonians - The End delayed' + + '' + + '

Pauline letters to individuals

' + + '1 Timothy - False teachings' + + '' + + '
2 Timothy - Paul\'s farewell' + + '' + + '
Titus - A difficult ministry' + + '' + + '
Philemon - Slaves as brothers' + + '' + + '

Letters from others

' + + 'Hebrews - Jewish Christianity' + + '' + + '
James - Trials of faith' + + '' + + '
1 Peter - Life among unbelievers' + + '' + + '
2 Peter - Peter\'s farewell' + + '' + + '
1 John - God loves us' + + '' + + '
2 John - Love each other' + + '' + + '
3 John - Practical love' + + '' + + '
Jude - Deserters' + + '' + + '

Prophecies for the future

' + + 'Revelation chapters 1-11 - The world gets worse' + + '' + + '
Revelation chapters 12-22 - Final war & peace' + + '' + + '' + + '
'; var bookSummary = '
Book summary of ' + longBookName + '
' + '' + '

' + summary.book_description + '

' + summary.book_overview + '

'; - if (" gen exod isa matt luke john acts rom rev ".indexOf(curOsisID) == -1) { + if (" gen exod isa ezek matt luke john acts rom rev ".indexOf(curOsisID) == -1) { bookSummary += '
' + '' + @@ -2756,8 +2834,34 @@ step.util = { } bookSummary += '

ESV Introduction:
' + summary.ESV_introduction + '

' + - '

ESV Summary:
' + summary.ESV_summary + '

' + - '
' + + '

ESV Summary:
' + summary.ESV_summary + '

'; + + var bookOrderInBible = step.searchSelect.idx2osisChapterJsword[curOsisID]; + if (typeof bookOrderInBible === "number") { + var lastChapter = step.passageSelect.osisChapterJsword[bookOrderInBible][1]; + if (typeof lastChapter === "number") { + bookSummary += '
'; + for (var curChapter = 1; curChapter <= lastChapter; curChapter ++) { + var jsonName = "chapter_" + curChapter + "_header"; + if ((typeof summary[jsonName] === "string") && (summary[jsonName] !== "*") && (summary[jsonName] !== "")) { + var endOfHeader = lastChapter; + for (var nextChapter = curChapter + 1; nextChapter <= endOfHeader; nextChapter ++) { + var jsonName2 = "chapter_" + nextChapter + "_header"; + if (typeof summary[jsonName2] === "string") + endOfHeader = nextChapter - 1; + } + bookSummary += ""; + } + jsonName = "chapter_" + curChapter + "_description"; + if ((typeof summary[jsonName] === "string") && (summary[jsonName] !== "*") && (summary[jsonName] !== "")) { + bookSummary += '"; + } + } + bookSummary += "
ChapterDescription
" + osisID + " " + curChapter + "-" + endOfHeader + "" + summary[jsonName] + "
' + osisID + " " + curChapter + "" + summary[jsonName] + "
"; + } + } + bookSummary += + '' + '
' + 'Copyright information for ESV' + '
' + @@ -2771,18 +2875,39 @@ step.util = { '


' + ''; if (chapterNum > 1) chptSummary += - '' + + '' + '' + ''; if ((posOfBook > -1) && (chapterNum < step.passageSelect.osisChapterJsword[posOfBook][1])) chptSummary += - '' + + '' + '' + ''; chptSummary += ''; - + var tabChptClass = ""; + var contentChptClass = ""; + var tabBookClass = ""; + var contentBookClass = ""; + var tabBibleClass = ""; + var contentBibleClass = ""; + if ((typeof tabToShow !== "string") || (tabToShow === "chapter")) { + tabChptClass = 'class="active"'; + contentChptClass = " in active"; + } + else if (tabToShow === "book") { + tabBookClass = 'class="active"'; + contentBookClass = " in active"; + } + else if (tabToShow === "bible") { + tabBibleClass = 'class="active"'; + contentBibleClass = " in active"; + } + else { + tabChptClass = 'class="active"'; + contentChptClass = " in active"; + } $(_.template( '