[js-embedded-discovery] 02/02: EDS-85 Identify IDP from Scopes and DomainHints
Rod Widdowson
rdw at steadingsoftware.com
Tue Jun 10 12:19:17 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=1dcfc2d1f75e10d15e91714f2f8596e2b3801078
commit 1dcfc2d1f75e10d15e91714f2f8596e2b3801078
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Jun 9 20:17:21 2025 +0100
EDS-85 Identify IDP from Scopes and DomainHints
https://shibboleth.atlassian.net/browse/EDS-85
Add listening to Domainhints in the JSON where Domainhints is a string.
(no specified extension)
---
src/javascript/idpselect.js | 19 +++++++++++++------
src/javascript/typeahead.js | 10 +++++-----
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/src/javascript/idpselect.js b/src/javascript/idpselect.js
index 728522e..3bb0854 100644
--- a/src/javascript/idpselect.js
+++ b/src/javascript/idpselect.js
@@ -972,7 +972,7 @@ function IdPSelectUI() {
return true;
};
- dropDownControl = new TypeAheadControl(idpData, textInput, hidden, button, maxIdPCharsDropDown, getLocalizedName, getEntityId, geticon, ie6Hack, alwaysShow, maxResults, getKeywords, compareName);
+ dropDownControl = new TypeAheadControl(idpData, textInput, hidden, button, maxIdPCharsDropDown, getLocalizedName, getEntityId, geticon, ie6Hack, alwaysShow, maxResults, getHints, compareName);
var a = document.createElement('a');
a.appendChild(document.createTextNode(getLocalizedMessage('idpList.showList')));
@@ -1339,13 +1339,20 @@ function IdPSelectUI() {
return false;
}
- var getKeywords = function(idp) {
+ var getHints = function(idp) {
+ var keys;
if (ignoreKeywords || null == idp.Keywords) {
- return null;
+ keys = null;
+ } else {
+ keys = getLocalizedEntry(idp.Keywords);
}
- var s = getLocalizedEntry(idp.Keywords);
-
- return s;
+ if (keys == null) {
+ return idp.Hints;
+ }
+ if (idp.Hints == null) {
+ return keys;
+ }
+ return keys + " " + idp.Hints;
}
var getLocalizedEntry = function(theArray){
diff --git a/src/javascript/typeahead.js b/src/javascript/typeahead.js
index 8e8cb91..66a6fb7 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, compareName)
+function TypeAheadControl(jsonObj, box, orig, submit, maxchars, getName, getEntityId, geticon, ie6hack, alwaysShow, maxResults, getHints, compareName)
{
//
// Squirrel away the parameters we were given
@@ -15,7 +15,7 @@ function TypeAheadControl(jsonObj, box, orig, submit, maxchars, getName, getEnti
this.getName = getName;
this.getEntityId = getEntityId;
this.geticon = geticon;
- this.getKeywords = getKeywords;
+ this.getHints = getHints;
this.compareName = compareName;
}
@@ -135,9 +135,9 @@ TypeAheadControl.prototype.getPossible = function(name) {
}
if (!hit) {
- var thisKeywords = this.getKeywords(this.elementList[inIndex]);
- if (null != thisKeywords &&
- thisKeywords.toLowerCase().indexOf(name) != -1) {
+ var thisHints = this.getHints(this.elementList[inIndex]);
+ if (null != thisHints &&
+ this.compareName(thisHints, 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