Skip to content

Commit

Permalink
A bit of the JS for issue #304. Got interrupted, more later.
Browse files Browse the repository at this point in the history
  • Loading branch information
martindholmes committed Jun 9, 2024
1 parent 442e943 commit 9d7aabc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions js/StaticSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* input[type='number'].staticSearch_num (optional; inputs for numerical filters)
* input[type='checkbox'].staticSearch_bool (optional: checkboxes for boolean filters)
* input[type='text'].staticSearch_text (NOT YET IMPLEMENTED: type-in search filter boxes)
* input[type='checkbox']#ssCaseSensitivePhrasal (optional; checkbox to control case-sensitivity
* in phrasal searches)
*
* The first is mandatory, although the user is
* not required to use it; they may choose simply
Expand Down Expand Up @@ -114,6 +116,13 @@ class StaticSearch{
this.searchButton2.addEventListener('click', function(){this.doSearch(); return false;}.bind(this));
}

//Optional case-sensitivity checkbox for phrasal searches.
this.chkCaseSensitivePhrasal = document.querySelector("input#ssChkCaseSensitivePhrasal");
if (this.chkCaseSensitivePhrasal){
this.queryBox.addEventListener('change', function(){this.showHideCaseSensitivityControl(); return false;})
}


//Clear button will be there if there are filter controls.
this.clearButton = document.querySelector("button#ssClear");
if (this.clearButton){
Expand Down Expand Up @@ -2010,6 +2019,15 @@ if (this.discardedTerms.length > 0){
}
}

/** @function StaticSearch~showHideSensitivityControl
* @description This function triggers from the onchange event of the
* query text box; if we find a phrasal search typed in there, we display
* the case-sensitivity checkbox.
* @return {boolean} true on success, false on failure
*/
showHideSensitivityControl(){
//if (this.queryBox.match)
}

/** @function StaticSearch~phraseToRegex
* @description This method takes a phrase and converts it
Expand Down

0 comments on commit 9d7aabc

Please sign in to comment.