[js-embedded-discovery] 01/02: EDS-96 Support ignoring diacritics while searching
Rod Widdowson
rdw at steadingsoftware.com
Mon Jun 9 14:19:47 UTC 2025
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository js-embedded-discovery.
View the commit online:
http://git.shibboleth.net/view/?p=js-embedded-discovery.git;a=commit;h=4726b7de5189e361bf4d4e2044687beacf2d4cc3
commit 4726b7de5189e361bf4d4e2044687beacf2d4cc3
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Jun 7 16:29:27 2025 +0100
EDS-96 Support ignoring diacritics while searching
https://shibboleth.atlassian.net/browse/EDS-96
Exbed the "compare the localizedname" code back in to idpselect
---
src/javascript/idpselect.js | 9 ++++++++-
src/javascript/typeahead.js | 5 +++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/javascript/idpselect.js b/src/javascript/idpselect.js
index a58cd0b..00a06d6 100644
--- a/src/javascript/idpselect.js
+++ b/src/javascript/idpselect.js
@@ -939,7 +939,7 @@ function IdPSelectUI() {
return true;
};
- dropDownControl = new TypeAheadControl(idpData, textInput, hidden, button, maxIdPCharsDropDown, getLocalizedName, getEntityId, geticon, ie6Hack, alwaysShow, maxResults, getKeywords);
+ dropDownControl = new TypeAheadControl(idpData, textInput, hidden, button, maxIdPCharsDropDown, getLocalizedName, getEntityId, geticon, ie6Hack, alwaysShow, maxResults, getKeywords, compareName);
var a = document.createElement('a');
a.appendChild(document.createTextNode(getLocalizedMessage('idpList.showList')));
@@ -1289,6 +1289,13 @@ function IdPSelectUI() {
return getEntityId(idp);
} ;
+ var compareName = function(compareName, typedName) {
+ if (compareName.toLowerCase().indexOf(typedName) != -1) {
+ return true;
+ }
+ return false;
+ }
+
var getKeywords = function(idp) {
if (ignoreKeywords || null == idp.Keywords) {
return null;
diff --git a/src/javascript/typeahead.js b/src/javascript/typeahead.js
index 329ecd8..6cd5775 100644
--- a/src/javascript/typeahead.js
+++ b/src/javascript/typeahead.js
@@ -1,4 +1,4 @@
-function TypeAheadControl(jsonObj, box, orig, submit, maxchars, getName, getEntityId, geticon, ie6hack, alwaysShow, maxResults, getKeywords)
+function TypeAheadControl(jsonObj, box, orig, submit, maxchars, getName, getEntityId, geticon, ie6hack, alwaysShow, maxResults, getKeywords, compareName)
{
//
// Squirrel away the parameters we were given
@@ -16,6 +16,7 @@ function TypeAheadControl(jsonObj, box, orig, submit, maxchars, getName, getEnti
this.getEntityId = getEntityId;
this.geticon = geticon;
this.getKeywords = getKeywords;
+ this.compareName = compareName;
}
TypeAheadControl.prototype.draw = function(setFocus) {
@@ -123,7 +124,7 @@ TypeAheadControl.prototype.getPossible = function(name) {
//
// Check name
//
- if (thisName.toLowerCase().indexOf(name) != -1) {
+ if (this.compareName(thisName, name)) {
hit = true;
}
//
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list