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

noreply at shibboleth.net noreply at shibboleth.net
Wed Mar 28 10:55:14 BST 2012


Author: rdw
Date: Wed Mar 28 10:55:13 2012
New Revision: 109

URL: http://svn.shibboleth.net/view/js-embedded-discovery?rev=109&view=rev
Log:
EDS-32 clip alt txt.  Also apply same clipping to title as to the text on the IdP buttons

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

Modified: trunk/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/js-embedded-discovery/trunk/doc/RELEASE-NOTES.txt?rev=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/doc/RELEASE-NOTES.txt (original)
+++ trunk/doc/RELEASE-NOTES.txt Wed Mar 28 10:55:13 2012
@@ -1,6 +1,7 @@
-Chnaged in V1.1.0
+Changed in V1.1.0
 EDS-34 Allow configuration of dropdown rather than typeahead.
 EDS-88 Allow configuration to not set focus to search box.
+EDS-32 Clip Alt txt
 
 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=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/src/javascript/idpselect.js (original)
+++ trunk/src/javascript/idpselect.js Wed Mar 28 10:55:13 2012
@@ -29,6 +29,7 @@
     var samlIdPCookieTTL;
     var maxIdPCharsDropDown;
     var maxIdPCharsButton;
+    var maxIdPCharsAltTxt;
     var alwaysShow;
     var maxResults;
     var ignoreKeywords;
@@ -133,8 +134,9 @@
         maxWidth = paramsSupplied.maxWidth;
         maxHeight = paramsSupplied.maxHeight;
         bestRatio = paramsSupplied.bestRatio;
-        maxIdPCharsButton =  paramsSupplied.maxIdPCharsButton;
+        maxIdPCharsButton = paramsSupplied.maxIdPCharsButton;
         maxIdPCharsDropDown = paramsSupplied.maxIdPCharsDropDown;
+        maxIdPCharsAltTxt = paramsSupplied.maxIdPCharsAltTxt;
 
         if (typeof navigator == 'undefined') {
             lang = paramsSupplied.defaultLanguage;
@@ -513,7 +515,11 @@
         }
 
         img.src = bestFit.value;
-        img.alt = getLocalizedName(idp);
+        var altTxt = getLocalizedName(idp);
+        if (altTxt.length > maxIdPCharsAltTxt) {
+            altTxt = altTxt.substring(0, maxIdPCharsAltTxt) + '...';
+        }
+        img.alt = altTxt;
 
         var w = bestFit.width;
         var h = bestFit.height;
@@ -593,10 +599,10 @@
 
         var nameDiv = buildDiv(undefined, 'TextDiv');
         var nameStr = getLocalizedName(idp);
-        div.title = nameStr;
         if (nameStr.length > maxIdPCharsButton) {
             nameStr = nameStr.substring(0, maxIdPCharsButton) + '...';
         }
+        div.title = nameStr;
         nameDiv.appendChild(document.createTextNode(nameStr));
         aval.appendChild(nameDiv);
 

Modified: trunk/src/javascript/idpselect_config.js
URL: http://svn.shibboleth.net/view/js-embedded-discovery/trunk/src/javascript/idpselect_config.js?rev=109&r1=108&r2=109&view=diff
==============================================================================
--- trunk/src/javascript/idpselect_config.js (original)
+++ trunk/src/javascript/idpselect_config.js Wed Mar 28 10:55:13 2012
@@ -24,7 +24,7 @@
     this.preferredIdP = null;        // Array of entityIds to always show
     this.hiddenIdPs = null;          // Array of entityIds to delete
     this.ignoreKeywords = false;     // Do we ignore the <mdui:Keywords/> when looking for candidates
-    this.showListFirst = false;      // Do we start with a list of IdPs or just one
+    this.showListFirst = false;      // Do we start with a list of IdPs or just the dropdown
     this.samlIdPCookieTTL = 730;     // in days
     this.setFocusTextBox = true;     // Set to false to supress focus 
     this.testGUI = false;
@@ -107,6 +107,7 @@
     this.maxPreferredIdPs = 3;
     this.maxIdPCharsButton = 33;
     this.maxIdPCharsDropDown = 58;
+    this.maxIdPCharsAltTxt = 60;
 
     this.minWidth = 20;
     this.minHeight = 20;



More information about the commits mailing list