Author: jonathan
Date: Tue Dec  4 11:58:29 2007
New Revision: 10494

Log:

Added dynamic xss warning.

Modified:
   trunk/commons/dynamic-codegen/src/tryit.xslt

Modified: trunk/commons/dynamic-codegen/src/tryit.xslt
==============================================================================
--- trunk/commons/dynamic-codegen/src/tryit.xslt        (original)
+++ trunk/commons/dynamic-codegen/src/tryit.xslt        Tue Dec  4 11:58:29 2007
@@ -426,6 +426,9 @@
         newEndpointAddress = document.getElementById("address").value;
         if (newEndpointAddress != null) {
             <xsl:value-of select="$service-name"/>.setAddress(endpoint, 
newEndpointAddress);
+            var xss = 
newEndpointAddress.substring(0,newEndpointAddress.indexOf("/", 8)) !=
+                      document.URL.substring(0,document.URL.indexOf("/", 8));
+            document.getElementById("xssWarning").style.display = xss ? 
"inline" : "none";
         }
     }
 
@@ -599,7 +602,9 @@
                                     </xsl:for-each>
                                 </select>
                                 </li>
-                                <li>Change the address for the selected 
endpoint: <input type="text" id="address" value="[EMAIL PROTECTED]" 
onchange="addressChange()" style="border: 1px solid #CCCCCC;"/>
+                                <li>Change the address for the selected 
endpoint:
+                                    <input type="text" id="address" 
value="[EMAIL PROTECTED]" onchange="addressChange()" style="border: 1px solid 
#CCCCCC;"/>
+                                    <span id="xssWarning">Warning! Access to a 
service in a different domain may be prohibited by security features in your 
browser.</span>
                                 </li>
                                 <li id="alternate-bullet">Try an alternate <a 
id="alternate-tryit" href="https://";>https</a> endpoint.</li>
                             </ul>
@@ -897,7 +902,12 @@
             div#endpoint-expanded #address {
                 width:28em
             }
-
+            div#endpoint-expanded #xssWarning {
+                color:red;
+                font-weight:bold;
+                font-size: 8pt;
+                display:none;
+            }
             /* middle styles */
             div#middle {
                 margin-left: 35px;

_______________________________________________
Commons-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev

Reply via email to