[js-embedded-discovery COMMIT] in /trunk: doc/RELEASE-NOTES.txt src/javascript/idpselect.js

noreply at shibboleth.net noreply at shibboleth.net
Mon Jan 5 08:59:58 EST 2015


Author: rdw
Date: Mon Jan  5 08:59:58 2015
New Revision: 118

URL: http://svn.shibboleth.net/view/js-embedded-discovery?rev=118&view=rev
Log:
EDS-52 deduplicate input stream by entityID

Modified:
    trunk/doc/RELEASE-NOTES.txt
    trunk/src/javascript/idpselect.js

Modified: trunk/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/js-embedded-discovery/trunk/doc/RELEASE-NOTES.txt?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/doc/RELEASE-NOTES.txt (original)
+++ trunk/doc/RELEASE-NOTES.txt Mon Jan  5 08:59:58 2015
@@ -9,6 +9,7 @@
 EDS-30 Use %20 as the separator for entityIDs in the cookie, but continue to understand '+'
 EDS-58 Configurable writing of the cookie.  Allows the SP to write it instead.
 EDS-33 Ordering of multiple selected IdPs is backwards.
+EDS-52 Deduplicate by entityId prior to displaying choices.
 
 Changed in V1.0.3
 =============================================

Modified: trunk/src/javascript/idpselect.js
URL: http://svn.shibboleth.net/view/js-embedded-discovery/trunk/src/javascript/idpselect.js?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/src/javascript/idpselect.js (original)
+++ trunk/src/javascript/idpselect.js Mon Jan  5 08:59:58 2015
@@ -86,6 +86,7 @@
         if (!load(parms.dataSource)) {
             return;
         }
+        deDupe();
         stripHidden(parms.hiddenIdPs);
 
         idpData.sort(function(a,b) {return getLocalizedName(a).localeCompare(getLocalizedName(b));});
@@ -307,6 +308,21 @@
         return true;
     };
 
+    /** Deduplicate by entityId */
+    var deDupe = function() {
+        var names = [];
+        var j;
+        for (j = 0; j < idpData.length; ) {
+            var eid = getEntityId(idpData[j]);
+            if (null == names[eid]) {
+                names[eid] = eid;
+                j = j + 1;
+            } else {
+                idpData.splice(j, 1);
+            }
+        }
+    }
+
     /**
        Strips the supllied IdP list from the idpData
     */



More information about the commits mailing list