svn commit: r1079950 - in /struts/struts2/trunk/core/src/main/resources: org/apache/struts2/static/utils.js template/css_xhtml/validation.js template/xhtml/validation.js

2011-03-09 Thread jogep
Author: jogep
Date: Wed Mar  9 19:19:33 2011
New Revision: 1079950

URL: http://svn.apache.org/viewvc?rev=1079950&view=rev
Log:
WW-3437: JavaScript should following the JSLint recommendations

Modified:

struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js

struts/struts2/trunk/core/src/main/resources/template/css_xhtml/validation.js
struts/struts2/trunk/core/src/main/resources/template/xhtml/validation.js

Modified: 
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js?rev=1079950&r1=1079949&r2=1079950&view=diff
==
--- 
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js 
(original)
+++ 
struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/utils.js 
Wed Mar  9 19:19:33 2011
@@ -24,7 +24,7 @@ var StrutsUtils = {};
 // gets an object with validation errors from string returned by 
 // the ajaxValidation interceptor
 StrutsUtils.getValidationErrors = function(data) {
-  if(data.indexOf("/* {") == 0) {
+  if(data.indexOf("/* {") === 0) {
 return eval("( " + data.substring(2, data.length - 2) + " )");
   } else {
 return null;
@@ -33,7 +33,7 @@ StrutsUtils.getValidationErrors = functi
 
 StrutsUtils.clearValidationErrors = function(form) {
 var firstNode = StrutsUtils.firstElement(form);
-var xhtml = firstNode.tagName.toLowerCase() == "table";
+var xhtml = firstNode.tagName.toLowerCase() === "table";
 
 if(xhtml) {
 clearErrorMessagesXHTML(form);
@@ -59,11 +59,12 @@ StrutsUtils.showValidationErrors = funct
 StrutsUtils.clearValidationErrors(form, errors);
 
if (errors.errors) {
-   var errorList = document.createElement("ul");
+   var l, errorList = document.createElement("ul");
+
errorList.setAttribute("class", "errorMessage");
errorList.setAttribute("className", "errorMessage"); // ie hack 
cause ie does not support setAttribute
 
-   for ( var l = 0; l < errors.errors.length; l++) {
+   for ( l = 0; l < errors.errors.length; l++) {
var item = document.createElement("li");
var itemText = 
document.createTextNode(errors.errors[l]);
item.appendChild(itemText);
@@ -75,16 +76,18 @@ StrutsUtils.showValidationErrors = funct
StrutsUtils.errorLists[form] = errorList;
}
 
-   var firstNode = StrutsUtils.firstElement(form);
-  var xhtml = firstNode.tagName.toLowerCase() == "table";  
+  var i, fieldName, firstNode = StrutsUtils.firstElement(form);
+  var xhtml = firstNode.tagName.toLowerCase() === "table";
   if(errors.fieldErrors) {
-for(var fieldName in errors.fieldErrors) {
-  for(var i = 0; i < errors.fieldErrors[fieldName].length; i++) {
-if(xhtml) {
-  addErrorXHTML(form.elements[fieldName], 
errors.fieldErrors[fieldName][i]);
-} else {
-  addErrorCSS(form.elements[fieldName], 
errors.fieldErrors[fieldName][i]);
-}  
+for(fieldName in errors.fieldErrors) {
+  if(errors.fieldErrors.hasOwnProperty(fieldName)) {
+for(i = 0; i < errors.fieldErrors[fieldName].length; i++) {
+  if(xhtml) {
+addErrorXHTML(form.elements[fieldName], 
errors.fieldErrors[fieldName][i]);
+  } else {
+addErrorCSS(form.elements[fieldName], 
errors.fieldErrors[fieldName][i]);
+  }
+}
   }
 }
   }
@@ -92,10 +95,10 @@ StrutsUtils.showValidationErrors = funct
 
 StrutsUtils.firstElement  = function(parentNode, tagName) {
   var node = parentNode.firstChild;
-  while(node && node.nodeType != 1){
+  while(node && node.nodeType !== 1){
 node = node.nextSibling;
   }
-  if(tagName && node && node.tagName && node.tagName.toLowerCase() != 
tagName.toLowerCase()) {
+  if(tagName && node && node.tagName && node.tagName.toLowerCase() !== 
tagName.toLowerCase()) {
 node = StrutsUtils.nextElement(node, tagName);
   }
   return node;  
@@ -105,9 +108,9 @@ StrutsUtils.nextElement = function(node,
   if(!node) { return null; }
   do {
 node = node.nextSibling;
-  } while(node && node.nodeType != 1);
+  } while(node && node.nodeType !== 1);
 
-  if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
+  if(node && tagName && tagName.toLowerCase() !== node.tagName.toLowerCase()) {
 return StrutsUtils.nextElement(node, tagName);
   }
   return node;  
@@ -118,9 +121,9 @@ StrutsUtils.previousElement = function(n
   if(tagName) { tagName = tagName.toLowerCase(); }
   do {
 node = node.previousSibling;
-  } while(node && node.nodeType != 1);
+  } while(node && node.nodeType !== 1);
   
-  if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
+  if(node && tagNa

[CONF] Confluence Changes in the last 24 hours

2011-03-09 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


Apache Camel (https://cwiki.apache.org/confluence/display/CAMEL)

Pages
-
Book Front Cover edited by  hadr...@apache.org  (10:33 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Book+Front+Cover

Camel 2.7.0 Release edited by  davsclaus  (06:15 AM)
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.7.0+Release



Apache Cayenne (https://cwiki.apache.org/confluence/display/CAY)

Pages
-
Board Report March 2011 edited by  blacknext  (09:51 AM)
https://cwiki.apache.org/confluence/display/CAY/Board+Report+March+2011



Apache Connectors Framework 
(https://cwiki.apache.org/confluence/display/CONNECTORS)

Pages
-
Installation created by f...@efendi.ca (07:20 PM)
https://cwiki.apache.org/confluence/display/CONNECTORS/Installation


Comments
https://cwiki.apache.org/confluence/display/CONNECTORS/Installation (2)

Apache CXF Documentation (https://cwiki.apache.org/confluence/display/CXF20DOC)

Pages
-
2.4 Migration Guide edited by  dkulp  (09:44 PM)
https://cwiki.apache.org/confluence/display/CXF20DOC/2.4+Migration+Guide



Apache Directory Studio (https://cwiki.apache.org/confluence/display/DIRxSTUDIO)

Pages
-
Source repository edited by  pamarcelot  (03:47 AM)
https://cwiki.apache.org/confluence/display/DIRxSTUDIO/Source+repository



Apache Geronimo v3.0 (https://cwiki.apache.org/confluence/display/GMOxDOC30)

Pages
-
Apache Geronimo v3.0 documentation development status edited by  
chirun...@gmail.com  (01:32 AM)
https://cwiki.apache.org/confluence/display/GMOxDOC30/Apache+Geronimo+v3.0+documentation+development+status



OFBiz (Open For Business) Project Open Wiki 
(https://cwiki.apache.org/confluence/display/OFBIZ)

Pages
-
Jackrabbit Branch Development created by sascha (02:36 AM)
https://cwiki.apache.org/confluence/display/OFBIZ/Jackrabbit+Branch+Development

Online Developers Section edited by  sascha  (02:09 AM)
https://cwiki.apache.org/confluence/display/OFBIZ/Online+Developers+Section



OFBiz Technical Documentation 
(https://cwiki.apache.org/confluence/display/OFBTECH)

Pages
-
Revisions Requiring Data Migration edited by  hansbak  (07:55 AM)
https://cwiki.apache.org/confluence/display/OFBTECH/Revisions+Requiring+Data+Migration



Apache Qpid (https://cwiki.apache.org/confluence/display/qpid)

Pages
-
Qpid Java Broker Transaction Timeouts created by andrew.kennedy (12:37 PM)
https://cwiki.apache.org/confluence/display/qpid/Qpid+Java+Broker+Transaction+Timeouts

Qpid Java Broker Statistics created by andrew.kennedy (12:35 PM)
https://cwiki.apache.org/confluence/display/qpid/Qpid+Java+Broker+Statistics



Apache Sling (https://cwiki.apache.org/confluence/display/SLING)

Pages
-
Status Report (March 2011) edited by  fmeschbe  (05:21 PM)
https://cwiki.apache.org/confluence/display/SLING/Status+Report+%28March+2011%29

Status Report (June 2011) created by fmeschbe (05:20 PM)
https://cwiki.apache.org/confluence/display/SLING/Status+Report+%28June+2011%29



Apache VCL (https://cwiki.apache.org/confluence/display/VCL)

Pages
-
VCL 2.2.1 Web Code Installation edited by  arkurth  (07:04 PM)
https://cwiki.apache.org/confluence/display/VCL/VCL+2.2.1+Web+Code+Installation

VCL 2.2.1 Database Installation edited by  arkurth  (06:58 PM)
https://cwiki.apache.org/confluence/display/VCL/VCL+2.2.1+Database+Installation

Download Apache VCL created by arkurth (02:18 PM)
https://cwiki.apache.org/confluence/display/VCL/Download+Apache+VCL

VCL 2.2.1 Management Node Installation edited by  arkurth  (02:49 PM)
https://cwiki.apache.org/confluence/display/VCL/VCL+2.2.1+Management+Node+Installation

2.2 Database Configuration edited by  arkurth  (12:06 PM)
https://cwiki.apache.org/confluence/display/VCL/2.2+Database+Configuration

Apache VCL edited by  arkurth  (12:06 PM)
https://cwiki.apache.org/confluence/display/VCL/Apache+VCL

New Install edited by  arkurth  (12:05 PM)
https://cwiki.apache.org/confluence/display/VCL/New+Install

2.2.1 VCL Release Procedures ToDo edited by  jfthomps  (09:20 AM)
https://cwiki.apache.org/confluence/display/VCL/2.2.1+VCL+Release+P