Skip to content

Commit

Permalink
sync with pattest
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksptang committed Nov 25, 2024
1 parent add5233 commit 3263f93
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 24 deletions.
16 changes: 14 additions & 2 deletions step-web/src/main/webapp/js/backbone/views/view_display_passage.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ var PassageDisplayView = DisplayView.extend({
// ((typeof step.keyedVersions[version] === "object") && (step.keyedVersions[version].languageCode === "en"))) &&
if (step.util.bookOrderInBible(reference) > -1) { // }) {
var xgenObj = passageHtml.find('.xgen');
if ((xgenObj.length == 1) || ((xgenObj.length == 2) && ($(xgenObj[0]).text() === "")))
if ((xgenObj.length == 1) || ((xgenObj.length == 2) && ($(xgenObj[0]).text().trim().length < 2))) // sometimes there is a \n so length == 1 is OK
$(xgenObj[xgenObj.length - 1]).append('<button style="font-size:10px;line-height:10px;vertical-align:middle" type="button" onclick="step.util.showSummary(\'' +
reference + '\')" title="Show summary information" class="select-version stepButton">' + __s.book_summary + '</button>');
reference + '\')" title="Show summary information" class="stepButton">' + __s.book_summary + '</button>');
}
if (!justLoadedTOS) step.util.addGrammar();
var elmntsWithCaretChar = $("span:contains(^)");
Expand All @@ -175,6 +175,18 @@ var PassageDisplayView = DisplayView.extend({
$($("span:contains(^)")[ii]).attr("var", "other")
}
}
var isDebugMode = $.getUrlVars().indexOf("debug") > -1;
var hasMatthewHenryConciseCommentary = bibleVersions.indexOf("MHCC") > -1;
if (hasMatthewHenryConciseCommentary || isDebugMode) {
var intros = passageHtml.find('.introduction');
if (intros.length > 0) {
intros.show();
if (isDebugMode && !hasMatthewHenryConciseCommentary) {
intros.children().css('color', 'orange');
alert("One of the selected Bible or commentary has the \"introduction\" tag. They are usually hidden. Since the URL has debug in the query string, they are unhidden in orange color. If you do not need to review the \"introduction\" tag, you can ignore them.");
}
}
}
},

_addForeignLangToInterLinear: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ var MainSearchView = Backbone.View.extend({
break;
default: // The following line probably should not have "+ encodeURIComponent(options[ii].item)" because it is repeated two lines later
searchArgs += URL_SEPARATOR + options[ii].itemType + "=" + encodeURIComponent(options[ii].item);
console.log("Check view_main_search.js line 603 " + options[ii].itemType + "=" + encodeURIComponent(options[ii].item));
}
searchArgs += "=" + encodeURIComponent(options[ii].item.value);
break;
Expand All @@ -605,7 +604,6 @@ var MainSearchView = Backbone.View.extend({
break;
default:
args += URL_SEPARATOR + options[ii].itemType + "=" + encodeURIComponent(options[ii].item);
console.log("default search: " + options[ii].itemType + "=" + encodeURIComponent(options[ii].item));
break;
}
}
Expand All @@ -623,7 +621,6 @@ var MainSearchView = Backbone.View.extend({
args += (args.length > 0) ? URL_SEPARATOR : "";
args += refArgs;
}
console.log("navigateSearch from view_main_search: ", args);
step.router.navigateSearch(args);
if (numOfBibleVersions > 1) step.util.showIntroOfMultiVersion();
},
Expand Down Expand Up @@ -1030,7 +1027,6 @@ var MainSearchView = Backbone.View.extend({
}
},
showAnalysis: function () {
console.log("Showing stats");
//trigger side bar
require(["sidebar"], function (module) {
//read up on requirejs to see if init can form part of download call
Expand All @@ -1051,8 +1047,6 @@ var MainSearchView = Backbone.View.extend({
}
},
showBooks: function () {
console.log("Triggering book selection");

var dropdownOfBooks = $("<select>");
var versions = _.template(
"<% _.each(versions, function(version, i) { %> <option value='<%= version.item.initials %>'><%= version.item.name %></option> <% }) %>")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ var PickBibleView = Backbone.View.extend({
for (var i = 0; i < inputFields.length; i ++) {
var curInputField = $(inputFields[i]);
var curLangCode = curInputField.data("lang");
console.log("lang code " + curLangCode );
// We currently only have commentaries in English, ancient Greek, Greek, German, Dutch and Latin
if (" en _ancient _all de grc nl la ".indexOf(" " + curLangCode.toLowerCase() + " ") == -1) {
var curButton = this.$el.find(".btn").has("input[data-lang='" + curLangCode + "']");
Expand Down Expand Up @@ -473,10 +472,8 @@ var PickBibleView = Backbone.View.extend({
this.$el.find(".tab-pane").empty();
var uniqueBibleList = [];
for (var key in bibleList) {
if (bibleList[key].length == 0) {
// console.log("No Bible module for " + key);
if (bibleList[key].length == 0)
delete bibleList[key];
}
else if (selectedLanguage === "_all") {
if (uniqueBibleList.indexOf(bibleList[key][0].languageCode) > -1) console.log("Same language code shows up in two groups of language: " + bibleList[key][0].languageCode);
else uniqueBibleList.push(bibleList[key][0].languageCode);
Expand Down
1 change: 0 additions & 1 deletion step-web/src/main/webapp/js/backbone/views/view_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ var SidebarView = Backbone.View.extend({
(typeof ref === "undefined") &&
(typeof currentMorph === "undefined") &&
(strong === "H0001")) {
console.log("MODULE_GET_INFO undefined H0001");
return;
}
strong = step.util.fixStrongNumForVocabInfo(strong, false);
Expand Down
9 changes: 2 additions & 7 deletions step-web/src/main/webapp/js/color_code_grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,16 +1365,12 @@ var cf = {
for (var count = morphCode.length; ((count > 0) && (index == undefined)); count --) {
index = ot_var[morphCode.substr(0, count)];
}
if (index == undefined) {
// console.log("cannot find code " + morphCode + " name: " + morphName);
if (index == undefined)
return;
}
else {
var resultStr = cv[C_otMorph].txtArray[index];
if (resultStr == undefined) {
// console.log("Cannot find code: " + morphCode + " name: " + morphName);
if (resultStr == undefined)
return;
}
result[morphName] = resultStr;
}
},
Expand Down Expand Up @@ -1582,7 +1578,6 @@ var cf = {
}
else console.log("error at addClassForTHOT cannot find >");
}
//else console.log("error at addClassForTHOT cssCode is zero " + endingQuotePos + " morphCode " + morphCode);
}
}
else break;
Expand Down
3 changes: 0 additions & 3 deletions step-web/src/main/webapp/js/copy_text.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ step.copyText = {
var textToCopy = ""
for (var m = 0; m < copyOfPassage.length; m++) {
var posSearch = $(copyOfPassage[m]).html().search(/<br\s*[\/]?>/);
if (posSearch> -1) {
console.log("pos: " + posSearch + " " + $(copyOfPassage[m]).html());
}
textToCopy += $(copyOfPassage[m]).text().replace(/ /g, " ")
.replace(/ /g, " ").replace(/ /g, " ").replace(/\t /g, "\t")
.replace(/\n\s+\n/g, "\n\n").replace(/\n\n\n/g, "\n\n").replace(/\n\n\t/g, "\n\t").replace(/^\n/g, "")
Expand Down
1 change: 0 additions & 1 deletion step-web/src/main/webapp/js/order_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ function saveVersionOrder() {
var url = allVersions + allReferences;
step.util.closeModal("orderVersionModal");
if (!step.util.checkFirstBibleHasPassage(newMasterVersion, osisIds, otherVersions)) return;
console.log("navigateSearch from order_version.html: " + url)
step.router.navigateSearch(url, true, true);
}

Expand Down

0 comments on commit 3263f93

Please sign in to comment.