Skip to content

Commit

Permalink
General code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksptang committed Oct 30, 2024
1 parent ed46838 commit 84beda2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 119 deletions.
21 changes: 10 additions & 11 deletions step-web/src/main/webapp/js/search_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ step.searchSelect = {
this.bookOrder = [];
this.idx2BookOrder = {};

// var ua = navigator.userAgent.toLowerCase();
$("#searchmodalbody").addClass("scrollPart");
if ((this.userLang.indexOf('en') != 0) && (this.groupsOT[0].groupName === "Books of Moses") && (this.groupsOT[0].groupName !== "Pentateuch"))
this.groupsOT[0].groupName = __s.the_pentateuch;
Expand All @@ -160,7 +159,7 @@ step.searchSelect = {
for (var j = 0; j < activePassageData.length; j++) {
var actPsgeDataElm = activePassageData[j];
var itemType = actPsgeDataElm.itemType ? actPsgeDataElm.itemType : actPsgeDataElm.tokenType
if (itemType == "srchJoin") {
if (itemType === "srchJoin") {
var previousJoinsAndSearch = actPsgeDataElm.token.split(/(?=[aon])/);
for (var k = 0; k < previousJoinsAndSearch.length; k++) {
if (k > 0) {
Expand All @@ -178,7 +177,7 @@ step.searchSelect = {
for (var i = 0; i < activePassageData.length; i++) {
var actPsgeDataElm = activePassageData[i];
var itemType = actPsgeDataElm.itemType ? actPsgeDataElm.itemType : actPsgeDataElm.tokenType
if (itemType == REFERENCE) {
if (itemType === REFERENCE) {
if (existingReferences !== "") existingReferences += ",";
existingReferences += actPsgeDataElm.item.osisID.replace(/ /g, ',');
}
Expand Down Expand Up @@ -944,7 +943,7 @@ step.searchSelect = {
var versionAltName = '';
var data = step.util.activePassage().get("searchTokens") || [];
for (var i = 0; i < data.length; i++) {
if (data[i].itemType == VERSION) {
if (data[i].itemType === VERSION) {
this.version = data[i].item.initials;
versionAltName = data[i].item.shortInitials;
break;
Expand All @@ -967,9 +966,9 @@ step.searchSelect = {
var end = 0;
var arrayOfTyplicalBooksAndChapters;
if (typeof data === "string") {
if (data == "OTNT") end = 66;
else if (data == "OT") end = 39;
else if (data == "NT") {
if (data === "OTNT") end = 66;
else if (data === "OT") end = 39;
else if (data === "NT") {
start = 39;
end = 66;
}
Expand Down Expand Up @@ -1104,8 +1103,8 @@ step.searchSelect = {
if (htmlID === 'ob_table') $('#other_books_hdr').text('Other Books');
var bt = this._buildBookTableHeader(columns, htmlID);
$('#' + htmlID).append(this._buildBookTableHeader(columns, htmlID) + tableHTML + '</table>');
if (htmlID.substr(0, 2) == "nt") $("#nt_hdr").show();
else if (htmlID.substr(0, 2) == "ot") $("#ot_hdr").show();
if (htmlID.substr(0, 2) === "nt") $("#nt_hdr").show();
else if (htmlID.substr(0, 2) === "ot") $("#ot_hdr").show();
}
},

Expand Down Expand Up @@ -1190,8 +1189,8 @@ step.searchSelect = {
var numOfGroups = 0;
//$('#searchSelectError').text(__s.click_update_when_finish);
//$('#updateRangeButton').show();
if (idPrefix == 'ot') numOfGroups = this.groupsOT.length;
else if (idPrefix == 'nt') numOfGroups = this.groupsNT.length;
if (idPrefix === 'ot') numOfGroups = this.groupsOT.length;
else if (idPrefix === 'nt') numOfGroups = this.groupsNT.length;
idPrefix = '#' + idPrefix + '_tableg';
var allOn = true;
for (var i = 0; i < numOfGroups; i++) {
Expand Down
108 changes: 0 additions & 108 deletions step-web/src/main/webapp/js/step_ready.js
Original file line number Diff line number Diff line change
@@ -1,113 +1,5 @@
(function () {

// function addNavBar() {
// var html = '<div>' +
// '<div class="navbar-header search-form">' +
// '<div class="navbar-brand col-xs-12">' +
// '<span class="hidden-xs title" title="Reset to default configuration">' +
// '<a href="/?noredirect" id="logo">' +
// '<img src="/step.png" alt="STEP" width="90px" height="22px">' +
// '</a>' +
// '</span>' +
// '<span class="help">' +

// '<div class="headerButtons pull-right">' +
// '<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">' +
// '<span class="icon-bar"></span>' +
// '<span class="icon-bar"></span>' +
// '<span class="icon-bar"></span>' +
// '</button>' +

// '<a id="copy-icon" style="padding-left:5px" href="javascript:step.util.copyModal();" title="' + __s.copy + '">' +
// '<i class="glyphicon glyphicon-copy"></i><span class="hidden-xs navbarIconDesc">&nbsp;&nbsp;' + __s.copy + '</span>' +
// '</a>' +
// '<a id="report-icon" style="padding-left:5px" href="html/reports_by_step.html" target="_blank" title="Resources powered by STEPBible">' +
// '<i class="glyphicon glyphicon-th-list"></i><span class="navbarIconDesc hidden-xs">&nbsp;&nbsp;' + __s.report + '</span>' +
// '</a>' +
// '<a id="stats-icon" style="padding-left:5px" href="javascript:step.util.ui.initSidebar(\'analysis\');" title="' + __s.passage_stats + '">' +
// '<i class="glyphicon glyphicon-stats"></i><span class="hidden-xs navbarIconDesc">&nbsp;&nbsp;' + __s.passage_stats + '</span>' +
// '</a>' +
// '<a id="bookmark-icon" style="padding-left:5px" href="javascript:step.util.ui.initSidebar(\'history\');" title="' + __s.bookmarks_and_recent_texts + '">' +
// '<i class="glyphicon glyphicon-bookmark"></i><span class="hidden-xs navbarIconDesc">&nbsp;' + __s.bookmarks + '</span>' +
// '</a>' +
// '<a id="examples-icon" style="padding-left:5px" href="javascript:step.util.ui.showTutorial();" title="' + __s.frequently_asked_questions + '">' +
// '<i class="glyphicon glyphicon-question-sign"></i><span class="hidden-xs hidden-sm navbarIconDesc">&nbsp;' + __s.faq + '</span>' +
// '</a>' +
// '<a id="fonts-icon" style="padding-left:5px" class="navbarIconDesc" href="javascript:step.util.showFontSettings();"' +
// 'title="' + __s.font_sizes + '">' +
// '<span class="largerFont" style="color:white;background:#5E5E5E;font-size:22px">' + __s.passage_font_size_symbol + '</span>' +
// '<span class="hidden-xs navbarIconDesc">&nbsp;' + __s.font + '</span>' +
// '</a>' +
// '<span class="navbar-collapse collapse">' +
// '<span class="dropdown">' +
// '<a id="languages-icon" style="padding-left:5px" class="dropdown-toggle" data-toggle="dropdown" title="' + __s.installation_book_language+ '">' +
// '<i class="glyphicon icon-language">' +
// '<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"/></svg>' +
// '</i>' +
// '<span style="vertical-align:bottom" class="navbarIconDesc">' + __s.installation_book_language + '</span>' +
// '</a>' +
// '<ul id="languageMenu" class="kolumny pull-right dropdown-menu">' +
// '<li><a href="http://crowdin.net/project/step" target="_new">' + __s.translate_step + '</a></li>' +
// '</ul>' +
// '</span>';

// if (!step.state.isLocal()) {
// html += '<a style="padding-left:5px" id="raiseSupportTrigger" data-toggle="modal" data-backdrop="static" data-target="#raiseSupport" title="' + __s.help_feedback + '">' +
// '<i class="glyphicon glyphicon-bullhorn"></i><span class="navbarIconDesc">&nbsp;' + __s.help_feedback + '</span>' +
// '</a>';
// }
// html += '<span class="dropdown">' +
// '<a id="more-icon" style="padding-left:5px" class="dropdown-toggle helpMenuTrigger" data-toggle="dropdown" title="' + __s.help + '">' +
// '<i class="glyphicon glyphicon-option-vertical"></i><span style="vertical-align:bottom;line-height:10px" class="navbarIconDesc">' + __s.more + '</span>' +
// '</a>' +
// '<ul class="dropdown-menu pull-right helpMenu" dir="' + (step.state.isLtR() ? "ltr" : "rtl") + '">';

// if (!step.state.isLocal()) {
// html += '<li><a href="/downloads.jsp" title="' + __s.download_desktop_step_about + '">' + __s.download_desktop_step + '</a></li>';
// }

// html += '<li class="quick_tutorial"><a href="javascript:void(0)" name="TUTORIAL">' + __s.quick_tutorial_link + '</a></li>' +
// '<li><a href="https://www.stepbible.org/videos" target="_blank">' + __s.video_help + '</a></li>' +
// '<li><a href="https://stepbibleguide.blogspot.com" target="_blank">' + __s.help_online + '</a></li>';
// if (step.state.isLocal()) {
// html += '<li class="available_bibles_and_commentaries"><a href="/versions.jsp" target="_blank" name="AVAILABLE_BIBLES_AND_COMMENTARIES">' + __s.available_versions + '</a></li>' +
// '<li><a href="/setup.jsp">' + __s.tools_settings + '</a></li>';
// }
// else {
// html += '<li><a href="https://stepweb.atlassian.net/wiki/display/SUG/Resources" target="_blank">' + __s.available_versions + '</a></li>';
// }
// html += '<li class="classicalUI"><a href="javascript:void(0)">' + __s.display_classical_ui + '&nbsp;<span id="classicalUICheck" class="glyphicon glyphicon-check" style="font-size:11px"></span></a></li>' +
// '<li class="resetEverything"><a href="javascript:void(0)">' + __s.tools_forget_my_profile + '</a></li>' +
// '<li><a href="https://stepbibleguide.blogspot.com/p/volunteers.html" target="_blank">' + __s.we_need_help + '</a></li>';
// if (!step.state.isLocal()) {
// html+= '<li><a href="javascript:void(0)" id="provideFeedback" data-toggle="modal" data-backdrop="static" data-target="#raiseSupport">' + __s.help_feedback + '</a></li>' +
// '<li><a href="/html/cookies_policy.html" target="_blank">' + __s.help_privacy_policy + '</a></li>';
// }
// html += '<li><a target="_new" href="https://stepbibleguide.blogspot.com/p/copyrights-licences.html" name="COPYRIGHT">' + __s.copyright_info_link + '</a></li>' +
// '<li class="aboutModalTrigger"><a href="javascript:void(0)" name="ABOUT">' + __s.help_about + '</a></li>';
// if (step.state.isLocal()) {
// html += '<li><a href="/shutdown.jsp">' + __s.tools_exit + '</a></li>';
// }
// html += '</ul>' +
// '</span>' +
// '</span>' +
// '</div>' +
// '</span>' +
// '<form role="form">' +
// '<div class="input-group" id="top_input_area" style="display:none">' +
// '<input id="masterSearch" type="text" class="form-control input-lg">' +
// '<span class="input-group-btn findButton">' +
// '<span>Search</span><i class="find glyphicon glyphicon-search"></i>' +
// '</span>' +
// '</div>' +
// '</form>' +
// '</div>' +
// '</div>' +
// '</div>';
// $("#stepnavbar").append(html);
// };


function initDataSources() {
//format the versions correctly
step.keyedVersions = {};
Expand Down

0 comments on commit 84beda2

Please sign in to comment.