From dcf033e275b234661d31f3cd2cf0e5b41ac692a3 Mon Sep 17 00:00:00 2001 From: dmckinnon78 Date: Tue, 26 Sep 2023 09:24:21 -0600 Subject: [PATCH] Changed reports so that when using localhost they don't add the version number to the json path. --- step-web/src/main/webapp/html/gospel_harmony.html | 5 ++++- step-web/src/main/webapp/html/lectionary.html | 5 ++++- step-web/src/main/webapp/html/mcheynes_readings.html | 4 +++- step-web/src/main/webapp/html/miracles.html | 5 ++++- step-web/src/main/webapp/html/names.html | 5 ++++- step-web/src/main/webapp/html/nt_letters.html | 5 ++++- .../src/main/webapp/html/one_year_chrono_NT_related_OT.html | 4 +++- .../main/webapp/html/one_year_chrono_OT_and_NT_together.html | 5 ++++- .../src/main/webapp/html/one_year_chrono_OT_related_NT.html | 5 ++++- step-web/src/main/webapp/html/one_year_themes_chrono.html | 5 ++++- step-web/src/main/webapp/html/ot_in_nt.html | 5 ++++- step-web/src/main/webapp/html/ot_parallel.html | 5 ++++- step-web/src/main/webapp/html/parashot.html | 5 ++++- step-web/src/main/webapp/html/places.html | 5 ++++- .../src/main/webapp/html/two_year_chrono_OT_related_NT.html | 4 +++- 15 files changed, 57 insertions(+), 15 deletions(-) diff --git a/step-web/src/main/webapp/html/gospel_harmony.html b/step-web/src/main/webapp/html/gospel_harmony.html index 91d1cb789f..9ba6cba96e 100644 --- a/step-web/src/main/webapp/html/gospel_harmony.html +++ b/step-web/src/main/webapp/html/gospel_harmony.html @@ -198,7 +198,10 @@

Harmony of the Gospels

} $.ajaxSetup({async: false}); var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + var tblRowHTML = "" $.getJSON(jsonPath + jsonFileName + ".json", function(array) { for (var i = 0; i < array.length; i ++ ) { diff --git a/step-web/src/main/webapp/html/lectionary.html b/step-web/src/main/webapp/html/lectionary.html index 83072155fe..ef258db62c 100644 --- a/step-web/src/main/webapp/html/lectionary.html +++ b/step-web/src/main/webapp/html/lectionary.html @@ -298,7 +298,10 @@ var earliest_date; var latest_date; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + // set 'date' to be the first Advent of the current year (or of the reference year if looking ahead/back) $.getJSON(jsonPath + jsonFileName1 + ".json", function(array) { var i = 0; diff --git a/step-web/src/main/webapp/html/mcheynes_readings.html b/step-web/src/main/webapp/html/mcheynes_readings.html index a1456282f4..fd968a2ec3 100644 --- a/step-web/src/main/webapp/html/mcheynes_readings.html +++ b/step-web/src/main/webapp/html/mcheynes_readings.html @@ -254,7 +254,9 @@

R. M. M'Cheyne's 1, 2, or 3 Year Readings

var clickText2 = '")>'; var clickText3 = ''; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } $.getJSON(jsonPath + jsonFileName + ".json", function(array) { diff --git a/step-web/src/main/webapp/html/miracles.html b/step-web/src/main/webapp/html/miracles.html index 4fd43be183..288e3e7361 100644 --- a/step-web/src/main/webapp/html/miracles.html +++ b/step-web/src/main/webapp/html/miracles.html @@ -195,7 +195,10 @@

Miracles in the Bible

else if (pos > 0) jsonFileName = tmp.substr(0,pos); } var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + $.ajaxSetup({async: false}); var tblRowHTML = "" $.getJSON(jsonPath + jsonFileName + ".json", function(array) { diff --git a/step-web/src/main/webapp/html/names.html b/step-web/src/main/webapp/html/names.html index 91a7bcd949..32e7bb0642 100644 --- a/step-web/src/main/webapp/html/names.html +++ b/step-web/src/main/webapp/html/names.html @@ -246,7 +246,10 @@

Names of God

} var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + $.getJSON(jsonPath + jsonFileName + ".json", function(array) { for (var i = 0; i < array.length; i ++ ) { var clickText = ""; diff --git a/step-web/src/main/webapp/html/nt_letters.html b/step-web/src/main/webapp/html/nt_letters.html index 8bdc35571e..c29c405c4c 100644 --- a/step-web/src/main/webapp/html/nt_letters.html +++ b/step-web/src/main/webapp/html/nt_letters.html @@ -220,7 +220,10 @@

New Testament Letter Structure

} $.ajaxSetup({async: false}); var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + var tblRowHTML = "" $.getJSON(jsonPath + jsonFileName + ".json", function(array) { for (var i = 0; i < array.length; i ++ ) { diff --git a/step-web/src/main/webapp/html/one_year_chrono_NT_related_OT.html b/step-web/src/main/webapp/html/one_year_chrono_NT_related_OT.html index d60d2af768..f6d0a77b2f 100644 --- a/step-web/src/main/webapp/html/one_year_chrono_NT_related_OT.html +++ b/step-web/src/main/webapp/html/one_year_chrono_NT_related_OT.html @@ -261,7 +261,9 @@

One Year Chronological NT with Related OT

var clickText2 = '")>'; var clickText3 = ''; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } $.getJSON(jsonPath + jsonFileName + ".json", function(array) { diff --git a/step-web/src/main/webapp/html/one_year_chrono_OT_and_NT_together.html b/step-web/src/main/webapp/html/one_year_chrono_OT_and_NT_together.html index 3c70f8a355..c04ad7b069 100644 --- a/step-web/src/main/webapp/html/one_year_chrono_OT_and_NT_together.html +++ b/step-web/src/main/webapp/html/one_year_chrono_OT_and_NT_together.html @@ -237,7 +237,10 @@

One Year Chronological OT and NT Together

var clickText2 = '")>'; var clickText3 = ''; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + $.getJSON(jsonPath + jsonFileName + ".json", function(array) { var anchor = ' id="today"'; diff --git a/step-web/src/main/webapp/html/one_year_chrono_OT_related_NT.html b/step-web/src/main/webapp/html/one_year_chrono_OT_related_NT.html index ddd981fc43..8007ada511 100644 --- a/step-web/src/main/webapp/html/one_year_chrono_OT_related_NT.html +++ b/step-web/src/main/webapp/html/one_year_chrono_OT_related_NT.html @@ -261,7 +261,10 @@

One Year Chronological OT with Related NT

var clickText2 = '")>'; var clickText3 = ''; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + $.getJSON(jsonPath + jsonFileName + ".json", function(array) { var anchor = ' id="today"'; diff --git a/step-web/src/main/webapp/html/one_year_themes_chrono.html b/step-web/src/main/webapp/html/one_year_themes_chrono.html index b7e4d63394..3af512e5b8 100644 --- a/step-web/src/main/webapp/html/one_year_themes_chrono.html +++ b/step-web/src/main/webapp/html/one_year_themes_chrono.html @@ -261,7 +261,10 @@

One Year Themes Collected Chronologically

var clickText2 = '")>'; var clickText3 = ''; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + $.getJSON(jsonPath + jsonFileName + ".json", function(array) { var anchor = ' id="today"'; diff --git a/step-web/src/main/webapp/html/ot_in_nt.html b/step-web/src/main/webapp/html/ot_in_nt.html index b498b6fb7f..ec84e82709 100644 --- a/step-web/src/main/webapp/html/ot_in_nt.html +++ b/step-web/src/main/webapp/html/ot_in_nt.html @@ -197,7 +197,10 @@

Old Testament used in New Testament

} $.ajaxSetup({async: false}); var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + var tblRowHTML = "" $.getJSON(jsonPath + jsonFileName + ".json", function(array) { for (var i = 0; i < array.length; i ++ ) { diff --git a/step-web/src/main/webapp/html/ot_parallel.html b/step-web/src/main/webapp/html/ot_parallel.html index d8665d6632..022fbfefc9 100644 --- a/step-web/src/main/webapp/html/ot_parallel.html +++ b/step-web/src/main/webapp/html/ot_parallel.html @@ -205,7 +205,10 @@

Old Testament parallels

} $.ajaxSetup({async: false}); var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + var tblRowHTML = "" $.getJSON(jsonPath + jsonFileName + ".json", function(array) { for (var i = 0; i < array.length; i ++ ) { diff --git a/step-web/src/main/webapp/html/parashot.html b/step-web/src/main/webapp/html/parashot.html index f8ebf541ac..326dcb7873 100644 --- a/step-web/src/main/webapp/html/parashot.html +++ b/step-web/src/main/webapp/html/parashot.html @@ -313,7 +313,10 @@ var first_sabbath_of_year; var first_sabbath_of_next_year; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + // set 'date' to be the first Sabbath of the current year $.getJSON(jsonPath + jsonFileName1 + ".json", function(array) { var i = 0; diff --git a/step-web/src/main/webapp/html/places.html b/step-web/src/main/webapp/html/places.html index 9f8d9fc8f7..f9073cfa30 100644 --- a/step-web/src/main/webapp/html/places.html +++ b/step-web/src/main/webapp/html/places.html @@ -226,7 +226,10 @@

Biblical locations

else if (pos > 0) jsonFileName = tmp.substr(0,pos); } var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } + $.ajaxSetup({async: false}); var tblRowHTML = "" $.getJSON(jsonPath + jsonFileName + ".json", function(array) { diff --git a/step-web/src/main/webapp/html/two_year_chrono_OT_related_NT.html b/step-web/src/main/webapp/html/two_year_chrono_OT_related_NT.html index a1cb45caf8..c2d6055424 100644 --- a/step-web/src/main/webapp/html/two_year_chrono_OT_related_NT.html +++ b/step-web/src/main/webapp/html/two_year_chrono_OT_related_NT.html @@ -261,7 +261,9 @@

Two Year Chronological OT with Related NT

var clickText2 = '")>'; var clickText3 = ''; var jsonPath = urlPart1 + "/html/json/"; - jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + if (urlPart1.indexOf("localhost") == -1 && urlPart1.indexOf("127.0.0.1") == -1) { + jsonPath += ("STEP_SERVER_VERSION_TOKEN".toLowerCase() !== "step_server_version_token") ? "STEP_SERVER_VERSION_TOKEN/" : ""; + } $.getJSON(jsonPath + jsonFileName + ".json", function(array) {