[java-identity-provider COMMIT] in /trunk/idp-conf/src/main/resources: messages/authn-messages.properties views/user-...

noreply at shibboleth.net noreply at shibboleth.net
Sat Oct 24 18:52:37 EDT 2015


Author: scantor
Date: Sat Oct 24 18:52:37 2015
New Revision: 7872

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7872&view=rev
Log:
IDP-111 - handle no-javascript case in user prefs view

Modified:
    trunk/idp-conf/src/main/resources/messages/authn-messages.properties
    trunk/idp-conf/src/main/resources/views/user-prefs.js
    trunk/idp-conf/src/main/resources/views/user-prefs.vm

Modified: trunk/idp-conf/src/main/resources/messages/authn-messages.properties
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/messages/authn-messages.properties?rev=7872&r1=7871&r2=7872&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/messages/authn-messages.properties	(original)
+++ trunk/idp-conf/src/main/resources/messages/authn-messages.properties	Sat Oct 24 18:52:37 2015
@@ -33,6 +33,7 @@
                         can use more advanced login approaches that are more convenient, but not always usable.
 idp.userprefs.options = The following options are available:
 idp.userprefs.spnego = Automatically try desktop login when available.
+idp.userprefs.no-js = This feature requires Javascript.
 
 # Classified Login Error messages
 

Modified: trunk/idp-conf/src/main/resources/views/user-prefs.js
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/views/user-prefs.js?rev=7872&r1=7871&r2=7872&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/views/user-prefs.js	(original)
+++ trunk/idp-conf/src/main/resources/views/user-prefs.js	Sat Oct 24 18:52:37 2015
@@ -18,18 +18,18 @@
 function readCookie(name) {
     var nameEQ = name + "=";
     var ca = document.cookie.split(';');
-    for(var i=0;i < ca.length;i++) {
+    for (var i = 0; i < ca.length; i++) {
         var c = ca[i];
-        while (c.charAt(0)==' ')
-            c = c.substring(1,c.length);
+        while (c.charAt(0) == ' ')
+            c = c.substring(1, c.length);
         if (c.indexOf(nameEQ) == 0)
-            return c.substring(nameEQ.length,c.length);
+            return c.substring(nameEQ.length, c.length);
     }
     return null;
 }
 
-function load() {
-    var checkbox = document.getElementById("spnego");
+function load(id) {
+    var checkbox = document.getElementById(id);
     if (checkbox != null) {
         var spnego = readCookie(checkbox.name);
         checkbox.checked = (spnego == "1");

Modified: trunk/idp-conf/src/main/resources/views/user-prefs.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/views/user-prefs.vm?rev=7872&r1=7871&r2=7872&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/views/user-prefs.vm	(original)
+++ trunk/idp-conf/src/main/resources/views/user-prefs.vm	Sat Oct 24 18:52:37 2015
@@ -19,7 +19,7 @@
     	// -->
     	</script>
   	</head>
-  	<body onLoad="load()">
+  	<body onLoad="document.getElementById('content').style.display='block'; load('spnego')">
     <div class="wrapper">
       <div class="container">
         <header>
@@ -30,7 +30,13 @@
           </p>
         </header>
 
-        <div class="content">
+        <noscript>
+          <div id="content" class="content">
+            $springMacroRequestContext.getMessage("idp.userprefs.no-js", "This feature requires Javascript.")
+          </div>
+        </noscript>
+        
+        <div id="content" class="content" style="display:none">
           <div class="form-element-wrapper">
           <h4>#springMessageText("idp.userprefs.options", "The following options are available:")</h4>
           </div>



More information about the commits mailing list