Author: michiel
Date: 2010-02-16 10:35:11 +0100 (Tue, 16 Feb 2010)
New Revision: 41068
Modified:
mmbase/trunk/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
Log:
using js2-mode now, which pointed out a few things
Modified:
mmbase/trunk/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
===================================================================
---
mmbase/trunk/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
2010-02-16 09:11:00 UTC (rev 41067)
+++
mmbase/trunk/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
2010-02-16 09:35:11 UTC (rev 41068)
@@ -1,6 +1,3 @@
-// -*- mode: javascript; -*-
-<%...@taglib uri="http://www.mmbase.org/mmbase-taglib-2.0" prefix="mm"
-%><mm:content type="text/javascript" expires="300">
/**
* See test.jspx for example usage.
@@ -11,9 +8,12 @@
* @author Michiel Meeuwissen
* @version $Id$
*/
+/*
+<%...@taglib uri="http://www.mmbase.org/mmbase-taglib-2.0" prefix="mm"
+%><mm:content type="text/javascript" expires="300">
+*/
-
function MMBaseValidator(root, id) {
this.uniqueId = id == null ? new Date().getTime() : id;
@@ -21,15 +21,15 @@
this.logEnabled = false;
this.traceEnabled = false;
- <mm:cloud jspvar="cloud">
- this.uri = '<%=cloud.getCloudContext().getUri()%>';
- this.cloud = '<%=cloud.getName()%>';
- </mm:cloud>
+ //<mm:cloud jspvar="cloud">
+ this.uri = '<%=cloud.getCloudContext().getUri()%>';
+ this.cloud = '<%=cloud.getName()%>';
+ //</mm:cloud>
this.invalidElements = 0;
//this.changedElements = 0;
this.elements = [];
- this.validateHook; // deprecated
+ this.validateHook = null; // deprecated
this.root = root;
this.setup();
@@ -77,7 +77,6 @@
}
-
MMBaseValidator.prototype.setup = function(el) {
if (el != null) {
this.root = el;
@@ -104,7 +103,6 @@
}
-
MMBaseValidator.prototype.log = function (msg) {
if (this.logEnabled) {
var errorTextArea = document.getElementById(this.logarea);
@@ -134,9 +132,9 @@
}
/**
-* Returns the mmbase node number associated with the given input element. Or
null, if there is
+ * Returns the mmbase node number associated with the given input element. Or
null, if there is
* no such node, or the node is not yet created.
-*/
+ */
MMBaseValidator.prototype.getNode = function(el) {
return this.getDataTypeKey(el).node;
}
@@ -358,7 +356,7 @@
}
}
return true;
-}
+};
// much much, too simple
MMBaseValidator.prototype.javaScriptPattern = function(javaPattern) {
@@ -386,7 +384,7 @@
this.log(ex);
return null;
}
-}
+};
MMBaseValidator.prototype.patternValid = function(el) {
if (this.isString(el)) {
@@ -407,7 +405,7 @@
} else {
return true;
}
-}
+};
MMBaseValidator.prototype.hasJavaClass = function(el, javaClass) {
var key = this.getDataTypeKey(el).string() + ":" + javaClass;
@@ -438,7 +436,7 @@
return MMBaseValidator.hasJavaClassesCache[key];
}
-}
+};
/**
* Whether the form element represents a numeric value. There is made no
difference between float,
@@ -448,46 +446,46 @@
if (el.mm_isnumeric != null) return el.mm_isnumeric;
el.mm_isnumeric = this.hasJavaClass(el,
"org\.mmbase\.datatypes\.NumberDataType");
return el.isnumeric;
-}
+};
MMBaseValidator.prototype.isInteger = function(el) {
if (el.mm_isinteger != null) return el.mm_isinteger;
el.mm_isinteger = this.hasJavaClass(el,
"(org\.mmbase\.datatypes\.IntegerDataType|org\.mmbase\.datatypes\.LongDataType)");
return el.mm_isinteger;
-}
+};
MMBaseValidator.prototype.isFloat = function(el) {
if (el.mm_isfloat != null) return el.mm_isfloat;
el.mm_isfloat = this.hasJavaClass(el,
"(org\.mmbase\.datatypes\.FloatDataType|org\.mmbase\.datatypes\.DoubleDataType)");
return el.mm_isfloat;
-}
+};
MMBaseValidator.prototype.isString = function(el) {
if (el.mm_isstring != null) {
return el.mm_isstring;
}
el.mm_isstring = this.hasJavaClass(el,
"org\.mmbase\.datatypes\.StringDataType");
return el.mm_isstring;
-}
+};
MMBaseValidator.prototype.isDateTime = function(el) {
if (el.mm_isdatetime != null) return el.mm_isdatetime;
el.mm_isdatetime = this.hasJavaClass(el,
"org\.mmbase\.datatypes\.DateTimeDataType");
return el.mm_isdatetime;
-}
+};
MMBaseValidator.prototype.isBinary = function(el) {
if (el.mm_isbinary != null) return el.mm_isbinary;
el.mm_isbinary = this.hasJavaClass(el,
"org\.mmbase\.datatypes\.BinaryDataType");
return el.mm_isbinary;
-}
+};
MMBaseValidator.prototype.isCheckEquality = function(el) {
if (el.mm_ischeckequality != null) return el.mm_ischeckequality;
el.mm_ischeckequality = this.hasJavaClass(el,
"org\.mmbase\.datatypes\.CheckEqualityDataType");
return el.ischeckequality;
-}
+};
MMBaseValidator.prototype.isXml = function(el) {
if (el.mm_isxml != null) return el.mm_isxml;
el.mm_isxml= this.hasJavaClass(el, "org\.mmbase\.datatypes\.XmlDataType");
return el.mm_isxml;
-}
+};
MMBaseValidator.prototype.INTEGER = /^[+-]?\d+$/;
@@ -505,7 +503,7 @@
}
return true;
-}
+};
@@ -524,7 +522,7 @@
} else {
return value;
}
-}
+};
/**
* Whether the value of the given form element satisfies possible restrictions
on minimal and
@@ -594,7 +592,7 @@
}
return true;
-}
+};
/**
@@ -1113,7 +1111,7 @@
server = false;
element.serverValidated = true;
// already validated, so nothing to do.
- return;
+ return true;
}
element.prevValue = "" + curValue;
}
@@ -1270,5 +1268,6 @@
el = null;
}
-
+/*
</mm:content>
+*/
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs