From 97825dc24f555d7f735b05d49216c174f9f13cb7 Mon Sep 17 00:00:00 2001
From: Leif Johansson <leifj@sunet.se>
Date: Sun, 18 Jul 2010 23:01:42 +0200
Subject: major update for the sunet ds

---
 src/main/webapp/wayf-swamid.jsp | 153 ++++++++++++++--------------------------
 1 file changed, 54 insertions(+), 99 deletions(-)

(limited to 'src/main/webapp/wayf-swamid.jsp')

diff --git a/src/main/webapp/wayf-swamid.jsp b/src/main/webapp/wayf-swamid.jsp
index e42e618..631ee53 100644
--- a/src/main/webapp/wayf-swamid.jsp
+++ b/src/main/webapp/wayf-swamid.jsp
@@ -48,7 +48,7 @@
 <logic:notPresent name="entityID" scope="request">
 <logic:notPresent name="shire" scope="request">
 
-<jsp:forward page = "wayferror.jsp"/>
+<jsp:forward page = "wayferror-swamid.jsp"/>
 </logic:notPresent>
 </logic:notPresent>
 
@@ -140,9 +140,14 @@
 </logic:present>
 
 <head>
-    <link rel="stylesheet" title="normal" type="text/css"
-    href="wayf-sunet.css" /> <title>Identity Provider Selection</title>
-    </head>
+    <title>Identity Provider Selection</title>
+    <link rel="stylesheet" title="normal" type="text/css" href="wayf-swamid.css"/>
+    <link rel="stylesheet" title="normal" type="text/css" href="css/ui-lightness/jquery-ui-1.8.2.custom.css"/>
+    <link rel="stylesheet" title="normal" type="text/css" href="css/ui.selectmenu.css"/>
+    <script language="javascript" type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
+    <script language="javascript" type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>
+    <!-- script language="javascript" type="text/javascript" src="js/ui.selectmenu.js"></script -->
+</head>
 
 <body>
   <div id="container">
@@ -189,7 +194,7 @@
                 <bean:define id="ei" name="entityID" />
                 <bean:define id="re" name="returnX"/>
 
-                 <a tabindex="10" href="<bean:write name="requestURL" />?entityID=<%= java.net.URLEncoder.encode(ei.toString(), "utf-8") %>&return=<%= java.net.URLEncoder.encode(re.toString(), "utf-8") %>&returnIDxParam=<%= java.net.URLEncoder.encode( returnIDParam.toString(), "utf-8" ) %>&cache=perm&action=selection&origin=<jsp:getProperty name="site" property="name" />">
+                <a tabindex="10" href="<bean:write name="requestURL" />?entityID=<%= java.net.URLEncoder.encode(ei.toString(), "utf-8") %>&return=<%= java.net.URLEncoder.encode(re.toString(), "utf-8") %>&returnIDxParam=<%= java.net.URLEncoder.encode( returnIDParam.toString(), "utf-8" ) %>&cache=perm&action=selection&origin=<jsp:getProperty name="site" property="name" />">
                     <jsp:getProperty name="site" property="displayName" />
                 </a>
               </logic:present>
@@ -198,8 +203,7 @@
                 <bean:define id="shire" name="shire" />
                 <bean:define id="pid" name="providerId" />
                 <a tabindex="10" href="<bean:write name="requestURL" />?target=<%= java.net.URLEncoder.encode(targ.toString(),"utf-8") %>&shire=<%= java.net.URLEncoder.encode(shire.toString(),"utf-8") %>&providerId=<%= java.net.URLEncoder.encode(pid.toString(),"utf-8") %>&time=<bean:write name="time" />&cache=perm&action=selection&origin=<jsp:getProperty name="site" property="name" />">
-                    <jsp:getProperty name="site"
-                    property="displayName" />
+                    <jsp:getProperty name="site" property="displayName" />
                 </a>
               </logic:notPresent>
             </p>
@@ -221,71 +225,26 @@
             <input type="hidden" name="target" value="<bean:write name="target" />" />
             <input type="hidden" name="providerId" value="<bean:write name="providerId" />" />
             <logic:present name="time" scope="request">
-               <input type="hidden" name="time" value="<bean:write name="time" />" />
-            </logic:present>
+            <input type="hidden" name="time" value="<bean:write name="time" />" />
+          </logic:present>
           </logic:notPresent>
           <logic:present name="entityID" scope="request">
             <input type="hidden" name="entityID" value="<bean:write name="entityID" />" />
             <input type="hidden" name="returnX" value="<bean:write name="returnX" />" />
             <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" />
           </logic:present>
-          <input tabindex="20" type="submit" value="Clear" />
+          <input tabindex="20" type="submit" class="ui-widget button" value="Clear" />
           </div>
         </form>
 
   </logic:present> <!-- Previous Selections -->
 
-<logic:present name="showComments" scope="Request">
-
-<!-- PROGRAMMING NOTE
- 
-   Add the "instant serach" dialogue.
-
-</logic:present>
-
-    <div class="list">
-       <logic:present name="sites" scope="request">
-              <h2>Enter institution name:</h2>
-              <form autocomplete="OFF" action="">
-                <div>
-                  <logic:notPresent name="entityID" scope="request">
-                    <input type="hidden" name="shire" value="<bean:write name="shire" />" />
-                    <input type="hidden" name="target" value="<bean:write name="target" />" />
-                    <input type="hidden" name="providerId" value="<bean:write name="providerId" />" />
-                    <logic:present name="time" scope="request">
-                       <input type="hidden" name="time" value="<bean:write name="time" />" />
-                    </logic:present>
-                  </logic:notPresent>
-                  <logic:present name="entityID" scope="request">
-                    <input type="hidden" name="entityID" value="<bean:write name="entityID" />" />
-                    <input type="hidden" name="returnX" value="<bean:write name="returnX" />" />
-                    <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" />
-                  </logic:present>
-                  <input type="hidden" id="enterOrigin" name="origin" value="unspec" />
-                  <input type="hidden" id="enterType"   name="action" value="search" />
-                  <input type="text"   id="enterText"   name="string" value="" tabindex="25" size="54"/>
-                  <input type="submit" id="enterSubmit"               value="Search"/>
-                  <input type="hidden"                  name="cache"  value="perm"/>
-                </div>
-              </form>
-        </logic:present>   
-     
-        <h2>
-
-<logic:present name="showComments" scope="Request">
-
-Provide a static drop down or a dynamically republished one. - you may wish to remove this code
-
-</logic:present>
-
-Or choose from a list:
-
-        </h2>
+        <h2>Type part of the name or select from the list below:</h2>
 
         <logic:present name="sites" scope="request">
         <logic:notPresent name="siteLists" scope="request">
 
-            <form method="get" action="<bean:write name="requestURL" />">
+            <form id="originform" method="get" action="<bean:write name="requestURL" />">
               <div>
                 <logic:notPresent name="entityID" scope="request">
                     <input type="hidden" name="shire" value="<bean:write name="shire" />" />
@@ -301,15 +260,16 @@ Or choose from a list:
                     <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" />
                  </logic:present>
                  <input type="hidden" name="action" value="selection" />
-                 <select name="origin" id="hackForie6" tabindex="40">      
+                 <input type="text" class="ui-widget" id="originSearch" name="string" value="" tabindex="25" size="30"/>
+                 <select name="origin" id="origin" class="ui-widget" tabindex="40">      
                      <logic:iterate id="site" name="sites">
                          <option value="<jsp:getProperty name="site" property="name" />">
                              <jsp:getProperty name="site" property="displayName" />
                          </option>
                      </logic:iterate>
                  </select>
-                 <input type="submit" value="Select" tabindex="50" />
-                 <select name="cache" tabindex="60">
+                 <input type="submit" class="ui-widget button" value="Select" tabindex="50" />
+                 <select name="cache" tabindex="60" class="ui-widget">
                      <option value="false"> Do not remember</option>
                      <option value="session" selected="selected"> Remember for session</option>
                      <option value="perm"> Remember for a week</option>
@@ -409,7 +369,7 @@ Or choose from a list:
                </td></tr>
              </table>
              <p>
-               <input type="submit" value="Select" tabindex="50"  />
+               <input type="submit" class="ui-widget button" value="Select" tabindex="50"  />
                <select name="cache" tabindex="60" >
                  <option value="false"> Do not remember</option>
                  <option value="session" selected="selected"> Remember for session</option>
@@ -452,14 +412,15 @@ Or choose from a list:
 
                     <input type="hidden" name="action" value="search" />
                     <input type="text" name="string" tabindex="70" />
-                    <input type="submit" value="Search" tabindex="80" />
+                    <input type="submit" class="ui-widget button" value="Search" tabindex="80" />
                 </p>
               </div>
             </form>
 
-<!-- The end of the old code.  Below is where search results go 00>
+<!-- The end of the old code.  Below is where search results go -->
 
 </logic:present>
+<!--
             <logic:present name="searchResultsEmpty" scope="request">
                 <p class="error">
 
@@ -469,11 +430,7 @@ No provider was found that matches your search criteria, please try again.
             </logic:present>
 
             <logic:present name="searchresults" scope="request">
-                <h3>
-
-Search results:
-
-                </h3>
+                <h3>Search results:</h3>
                 <form method="get" action="<bean:write name="requestURL" />">
                   <div>
                     <ul>
@@ -499,7 +456,7 @@ Search results:
                       <input type="hidden" name="returnIDParam" value="<bean:write name="returnIDParam" />" />
                    </logic:present>
                    <input type="hidden" name="action" value="selection" />
-                   <input type="submit" value="Select" tabindex="100" />
+                   <input type="submit" class="ui-widget button" value="Select" tabindex="100" />
                    <select name="cache" tabindex="100" >
                      <option value="false"> Do not remember</option>
                      <option value="session" selected="selected"> Remember for session</option>
@@ -509,6 +466,7 @@ Search results:
                    </div>
                 </form>     
             </logic:present>
+-->
         </div>
     </div>
 
@@ -602,37 +560,35 @@ function changedFed(X, Selected) {
         empty array.
  -->
 </logic:present>
-   <script language="javascript" type="text/javascript" src="Suggest.js"></script>
+
    <script language="javascript" type="text/javascript">
 <!--  
-window.onload = function() {
-
-<logic:notPresent  name="siteLists" scope="request">
-     var ie6Hack = [ document.getElementById("hackForie6")];
-</logic:notPresent>
-
-<logic:present name="siteLists" scope="request">
-     var ie6Hack = [ document.getElementById("FedSelect"), document.getElementById("originIdp")];
-</logic:present>
-     var control = new TypeAheadControl(theElements,
-             document.getElementById("enterText"),
-             document.getElementById("enterOrigin"),
-             document.getElementById("enterSubmit"),
-             document.getElementById("enterType"),
-             ie6Hack);
-
-
-     document.getElementById("enterText").focus();
-}
-
-
-var theElements = [
-  <logic:iterate id="site" name="sites">
-     ["<%= ((edu.internet2.middleware.shibboleth.wayf.IdPSite)site).getDisplayName().replace("\n","").toString() %>",
-      "<jsp:getProperty name="site" property="name" />"],
-  </logic:iterate>
- ];
-
+$(function() {
+   var idps = [
+<logic:iterate id="site" name="sites">
+     {
+        label: "<%= ((edu.internet2.middleware.shibboleth.wayf.IdPSite)site).getDisplayName().replace("\n","").toString() %>",
+        value: "<jsp:getProperty name="site" property="name" />"
+     },
+</logic:iterate>
+   ]; 
+   $('#originSearch').autocomplete({
+      minLength: 0,
+      source: idps,
+      focus: function(event, ui) {
+         $('#originSearch').val(ui.item.label);
+	 return false;
+      },
+      select: function(event, ui) {
+	 $('#originSearch').val(ui.item.label);
+         $('#origin').val(ui.item.value);
+         return false;
+      }
+   });
+   $('#originSearch').focus();
+   //$('.button').button();
+   //$('select').selectmenu({style: 'dropdown'});
+});
 -->
    </script>
 </logic:present>
@@ -640,4 +596,3 @@ var theElements = [
   
 </body>
 </html>
-  
-- 
cgit v1.1