You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2006/09/23 01:22:51 UTC
svn commit: r449122 [39/40] - in
/tapestry/tapestry4/trunk/tapestry-framework/src: java/org/apache/tapestry/
java/org/apache/tapestry/dojo/ java/org/apache/tapestry/dojo/form/
java/org/apache/tapestry/dojo/html/ java/org/apache/tapestry/form/
java/org/...
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate.js?view=auto&rev=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate.js Fri Sep 22 16:22:30 2006
@@ -0,0 +1,777 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.widget.validate");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.Manager");
+dojo.require("dojo.widget.Parse");
+dojo.require("dojo.xml.Parse");
+dojo.require("dojo.lang.array");
+dojo.require("dojo.lang.common");
+
+dojo.require("dojo.validate.common");
+dojo.require("dojo.validate.datetime");
+dojo.require("dojo.validate.check");
+dojo.require("dojo.validate.web");
+dojo.require("dojo.validate.us");
+
+dojo.require("dojo.i18n.common");
+dojo.requireLocalization("dojo.widget", "validate");
+
+dojo.widget.manager.registerWidgetPackage("dojo.widget.validate");
+
+/*
+ ****** Textbox ******
+
+ This widget is a generic textbox field.
+ Serves as a base class to derive more specialized functionality in subclasses.
+ Has the following properties that can be specified as attributes in the markup.
+
+ @attr id The textbox id attribute.
+ @attr className The textbox class attribute.
+ @attr name The textbox name attribute.
+ @attr value The textbox value attribute.
+ @attr trim Removes leading and trailing whitespace if true. Default is false.
+ @attr uppercase Converts all characters to uppercase if true. Default is false.
+ @attr lowercase Converts all characters to lowercase if true. Default is false.
+ @attr ucFirst Converts the first character of each word to uppercase if true.
+ @attr lowercase Removes all characters that are not digits if true. Default is false.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.Textbox",
+ dojo.widget.HtmlWidget,
+ {
+ // default values for new subclass properties
+ className: "",
+ name: "",
+ value: "",
+ type: "",
+ trim: false,
+ uppercase: false,
+ lowercase: false,
+ ucFirst: false,
+ digit: false,
+ htmlfloat: "none",
+
+ templatePath: dojo.uri.dojoUri("src/widget/templates/Textbox.html"),
+
+ // our DOM nodes
+ textbox: null,
+
+ // Apply various filters to textbox value
+ filter: function() {
+ if (this.trim) {
+ this.textbox.value = this.textbox.value.replace(/(^\s*|\s*$)/g, "");
+ }
+ if (this.uppercase) {
+ this.textbox.value = this.textbox.value.toUpperCase();
+ }
+ if (this.lowercase) {
+ this.textbox.value = this.textbox.value.toLowerCase();
+ }
+ if (this.ucFirst) {
+ this.textbox.value = this.textbox.value.replace(/\b\w+\b/g,
+ function(word) { return word.substring(0,1).toUpperCase() + word.substring(1).toLowerCase(); });
+ }
+ if (this.digit) {
+ this.textbox.value = this.textbox.value.replace(/\D/g, "");
+ }
+ },
+
+ // event handlers, you can over-ride these in your own subclasses
+ onfocus: function() {},
+ onblur: function() { this.filter(); },
+
+ // All functions below are called by create from dojo.widget.Widget
+ mixInProperties: function(localProperties, frag) {
+ dojo.widget.validate.Textbox.superclass.mixInProperties.apply(this, arguments);
+ if ( localProperties["class"] ) {
+ this.className = localProperties["class"];
+ }
+ }
+ }
+);
+
+/*
+ ****** ValidationTextbox ******
+
+ A subclass of Textbox.
+ Over-ride isValid in subclasses to perform specific kinds of validation.
+ Has several new properties that can be specified as attributes in the markup.
+
+ @attr type Basic input tag type declaration.
+ @attr size Basic input tag size declaration.
+ @attr type Basic input tag maxlength declaration.
+ @attr required Can be true or false, default is false.
+ @attr validColor The color textbox is highlighted for valid input. Default is #cfc.
+ @attr invalidColor The color textbox is highlighted for invalid input. Default is #fcc.
+ @attr invalidClass Class used to format displayed text in page if necessary to override default class
+ @attr invalidMessage The message to display if value is invalid.
+ @attr missingMessage The message to display if value is missing.
+ @attr missingClass Override default class used for missing input data
+ @attr listenOnKeyPress Updates messages on each key press. Default is true.
+ @attr promptMessage Will not issue invalid message if field is populated with default user-prompt text
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.ValidationTextbox",
+ dojo.widget.validate.Textbox,
+ function() {
+ // this property isn't a primitive and needs to be created on a per-item basis.
+ this.flags = {};
+ },
+ {
+ // default values for new subclass properties
+ required: false,
+ validColor: "#cfc",
+ invalidColor: "#fcc",
+ rangeClass: "range",
+ invalidClass: "invalid",
+ missingClass: "missing",
+ size: "",
+ maxlength: "",
+ promptMessage: "",
+ invalidMessage: "",
+ missingMessage: "",
+ rangeMessage: "",
+ listenOnKeyPress: true,
+ htmlfloat: "none",
+ lastCheckedValue: null,
+
+ templatePath: dojo.uri.dojoUri("src/widget/templates/ValidationTextbox.html"),
+
+ // new DOM nodes
+ invalidSpan: null,
+ missingSpan: null,
+ rangeSpan: null,
+
+ getValue: function() {
+ return this.textbox.value;
+ },
+
+ setValue: function(value) {
+ this.textbox.value = value;
+ this.update();
+ },
+
+ // Need to over-ride with your own validation code in subclasses
+ isValid: function() { return true; },
+
+ // Need to over-ride with your own validation code in subclasses
+ isInRange: function() { return true; },
+
+ // Returns true if value is all whitespace
+ isEmpty: function() {
+ return ( /^\s*$/.test(this.textbox.value) );
+ },
+
+ // Returns true if value is required and it is all whitespace.
+ isMissing: function() {
+ return ( this.required && this.isEmpty() );
+ },
+
+ // Called oninit, onblur, and onkeypress.
+ // Show missing or invalid messages if appropriate, and highlight textbox field.
+ update: function() {
+ this.lastCheckedValue = this.textbox.value;
+ this.missingSpan.style.display = "none";
+ this.invalidSpan.style.display = "none";
+ this.rangeSpan.style.display = "none";
+
+ var empty = this.isEmpty();
+ var valid = true;
+ if(this.promptMessage != this.textbox.value){
+ valid = this.isValid();
+ }
+ var missing = this.isMissing();
+
+ // Display at most one error message
+ if(missing){
+ this.missingSpan.style.display = "";
+ }else if( !empty && !valid ){
+ this.invalidSpan.style.display = "";
+ }else if( !empty && !this.isInRange() ){
+ this.rangeSpan.style.display = "";
+ }
+ this.highlight();
+ },
+
+ // Called oninit, and onblur.
+ highlight: function() {
+ // highlight textbox background
+ if ( this.isEmpty() ) {
+ this.textbox.style.backgroundColor = "";
+ }else if ( this.isValid() && this.isInRange() ){
+ this.textbox.style.backgroundColor = this.validColor;
+ }else if( this.textbox.value != this.promptMessage){
+ this.textbox.style.backgroundColor = this.invalidColor;
+ }
+ },
+
+ onfocus: function() {
+ if ( !this.listenOnKeyPress) {
+ this.textbox.style.backgroundColor = "";
+ }
+ },
+
+ onblur: function() {
+ this.filter();
+ this.update();
+ },
+
+ onkeyup: function(){
+ if(this.listenOnKeyPress){
+ //this.filter(); trim is problem if you have to type two words
+ this.update();
+ }else if (this.textbox.value != this.lastCheckedValue){
+ this.textbox.style.backgroundColor = "";
+ }
+ },
+
+ postMixInProperties: function(localProperties, frag) {
+ dojo.widget.validate.ValidationTextbox.superclass.postMixInProperties.apply(this, arguments);
+ this.messages = dojo.i18n.getLocalization("dojo.widget", "validate", this.lang);
+ dojo.lang.forEach(["invalidMessage", "missingMessage", "rangeMessage"], function(prop) {
+ if(this[prop]){ this.messages[prop] = this[prop]; }
+ }, this);
+ },
+
+ // FIXME: why are there to fillInTemplate methods defined here?
+ fillInTemplate: function() {
+ dojo.widget.validate.ValidationTextbox.superclass.fillInTemplate.apply(this, arguments);
+
+ // Attach isMissing and isValid methods to the textbox.
+ // We may use them later in connection with a submit button widget.
+ // TODO: this is unorthodox; it seems better to do it another way -- Bill
+ this.textbox.isValid = function() { this.isValid.call(this); };
+ this.textbox.isMissing = function() { this.isMissing.call(this); };
+ this.textbox.isInRange = function() { this.isInRange.call(this); };
+ this.update();
+
+ // apply any filters to initial value
+ this.filter();
+
+ // set table to be inlined (technique varies by browser)
+ if(dojo.render.html.ie){ dojo.html.addClass(this.domNode, "ie"); }
+ if(dojo.render.html.moz){ dojo.html.addClass(this.domNode, "moz"); }
+ if(dojo.render.html.opera){ dojo.html.addClass(this.domNode, "opera"); }
+ if(dojo.render.html.safari){ dojo.html.addClass(this.domNode, "safari"); }
+ }
+ }
+);
+
+
+/*
+ ****** IntegerTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid/isInRange to test for integer input.
+ Has 4 new properties that can be specified as attributes in the markup.
+
+ @attr signed The leading plus-or-minus sign. Can be true or false, default is either.
+ @attr separator The character used as the thousands separator. Default is no separator.
+ @attr min Minimum signed value. Default is -Infinity
+ @attr max Maximum signed value. Default is +Infinity
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.IntegerTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if((localProperties.signed == "true")||
+ (localProperties.signed == "always")){
+ this.flags.signed = true;
+ }else if((localProperties.signed == "false")||
+ (localProperties.signed == "never")){
+ this.flags.signed = false;
+ this.flags.min = 0;
+ }else{
+ this.flags.signed = [ true, false ]; // optional
+ }
+ if(localProperties.separator){
+ this.flags.separator = localProperties.separator;
+ }
+ if(localProperties.min){
+ this.flags.min = parseInt(localProperties.min);
+ }
+ if(localProperties.max){
+ this.flags.max = parseInt(localProperties.max);
+ }
+ },
+
+ // Over-ride for integer validation
+ isValid: function() {
+ return dojo.validate.isInteger(this.textbox.value, this.flags);
+ },
+ isInRange: function() {
+ return dojo.validate.isInRange(this.textbox.value, this.flags);
+ }
+ }
+);
+
+/*
+ ****** RealNumberTextbox ******
+
+ A subclass that extends IntegerTextbox.
+ Over-rides isValid/isInRange to test for real number input.
+ Has 5 new properties that can be specified as attributes in the markup.
+
+ @attr places The exact number of decimal places. If omitted, it's unlimited and optional.
+ @attr exponent Can be true or false. If omitted the exponential part is optional.
+ @attr eSigned Is the exponent signed? Can be true or false, if omitted the sign is optional.
+ @attr min Minimum signed value. Default is -Infinity
+ @attr max Maximum signed value. Default is +Infinity
+*/
+
+dojo.widget.defineWidget(
+ "dojo.widget.validate.RealNumberTextbox",
+ dojo.widget.validate.IntegerTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.RealNumberTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.places ) {
+ this.flags.places = Number( localProperties.places );
+ }
+ if((localProperties.exponent == "true")||
+ (localProperties.exponent == "always")){
+ this.flags.exponent = true;
+ }else if((localProperties.exponent == "false")||(localProperties.exponent == "never")){
+ this.flags.exponent = false;
+ }else{
+ this.flags.exponent = [ true, false ]; // optional
+ }
+ if((localProperties.esigned == "true")||(localProperties.esigned == "always")){
+ this.flags.eSigned = true;
+ }else if((localProperties.esigned == "false")||(localProperties.esigned == "never")){
+ this.flags.eSigned = false;
+ }else{
+ this.flags.eSigned = [ true, false ]; // optional
+ }
+ if(localProperties.min){
+ this.flags.min = parseFloat(localProperties.min);
+ }
+ if(localProperties.max){
+ this.flags.max = parseFloat(localProperties.max);
+ }
+ },
+
+ // Over-ride for real number validation
+ isValid: function() {
+ return dojo.validate.isRealNumber(this.textbox.value, this.flags);
+ },
+ isInRange: function() {
+ return dojo.validate.isInRange(this.textbox.value, this.flags);
+ }
+
+ }
+);
+
+/*
+ ****** CurrencyTextbox ******
+
+ A subclass that extends IntegerTextbox.
+ Over-rides isValid/isInRange to test if input denotes a monetary value .
+ Has 5 new properties that can be specified as attributes in the markup.
+
+ @attr fractional The decimal places (e.g. for cents). Can be true or false, optional if omitted.
+ @attr symbol A currency symbol such as Yen "???", Pound "???", or the Euro "???". Default is "$".
+ @attr separator Default is "," instead of no separator as in IntegerTextbox.
+ @attr min Minimum signed value. Default is -Infinity
+ @attr max Maximum signed value. Default is +Infinity
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.CurrencyTextbox",
+ dojo.widget.validate.IntegerTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.CurrencyTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.fractional ) {
+ this.flags.fractional = ( localProperties.fractional == "true" );
+ } else if ( localProperties.cents ) {
+ dojo.deprecated("dojo.widget.validate.IntegerTextbox", "use fractional attr instead of cents", "0.5");
+ this.flags.fractional = ( localProperties.cents == "true" );
+ }
+ if ( localProperties.symbol ) {
+ this.flags.symbol = localProperties.symbol;
+ }
+ if(localProperties.min){
+ this.flags.min = parseFloat(localProperties.min);
+ }
+ if(localProperties.max){
+ this.flags.max = parseFloat(localProperties.max);
+ }
+ },
+
+ // Over-ride for currency validation
+ isValid: function() {
+ return dojo.validate.isCurrency(this.textbox.value, this.flags);
+ },
+ isInRange: function() {
+ return dojo.validate.isInRange(this.textbox.value, this.flags);
+ }
+
+ }
+);
+
+/*
+ ****** IpAddressTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test for IP addresses.
+ Can specify formats for ipv4 or ipv6 as attributes in the markup.
+
+ @attr allowDottedDecimal true or false, default is true.
+ @attr allowDottedHex true or false, default is true.
+ @attr allowDottedOctal true or false, default is true.
+ @attr allowDecimal true or false, default is true.
+ @attr allowHex true or false, default is true.
+ @attr allowIPv6 true or false, default is true.
+ @attr allowHybrid true or false, default is true.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.IpAddressTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.IpAddressTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.allowdotteddecimal ) {
+ this.flags.allowDottedDecimal = ( localProperties.allowdotteddecimal == "true" );
+ }
+ if ( localProperties.allowdottedhex ) {
+ this.flags.allowDottedHex = ( localProperties.allowdottedhex == "true" );
+ }
+ if ( localProperties.allowdottedoctal ) {
+ this.flags.allowDottedOctal = ( localProperties.allowdottedoctal == "true" );
+ }
+ if ( localProperties.allowdecimal ) {
+ this.flags.allowDecimal = ( localProperties.allowdecimal == "true" );
+ }
+ if ( localProperties.allowhex ) {
+ this.flags.allowHex = ( localProperties.allowhex == "true" );
+ }
+ if ( localProperties.allowipv6 ) {
+ this.flags.allowIPv6 = ( localProperties.allowipv6 == "true" );
+ }
+ if ( localProperties.allowhybrid ) {
+ this.flags.allowHybrid = ( localProperties.allowhybrid == "true" );
+ }
+ },
+
+ // Over-ride for IP address validation
+ isValid: function() {
+ return dojo.validate.isIpAddress(this.textbox.value, this.flags);
+ }
+ }
+);
+
+/*
+ ****** UrlTextbox ******
+
+ A subclass of IpAddressTextbox.
+ Over-rides isValid to test for URL's.
+ Can specify 5 additional attributes in the markup.
+
+ @attr scheme Can be true or false. If omitted the scheme is optional.
+ @attr allowIP Allow an IP address for hostname. Default is true.
+ @attr allowLocal Allow the host to be "localhost". Default is false.
+ @attr allowCC Allow 2 letter country code domains. Default is true.
+ @attr allowGeneric Allow generic domains. Can be true or false, default is true.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.UrlTextbox",
+ dojo.widget.validate.IpAddressTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.UrlTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.scheme ) {
+ this.flags.scheme = ( localProperties.scheme == "true" );
+ }
+ if ( localProperties.allowip ) {
+ this.flags.allowIP = ( localProperties.allowip == "true" );
+ }
+ if ( localProperties.allowlocal ) {
+ this.flags.allowLocal = ( localProperties.allowlocal == "true" );
+ }
+ if ( localProperties.allowcc ) {
+ this.flags.allowCC = ( localProperties.allowcc == "true" );
+ }
+ if ( localProperties.allowgeneric ) {
+ this.flags.allowGeneric = ( localProperties.allowgeneric == "true" );
+ }
+ },
+
+ // Over-ride for URL validation
+ isValid: function() {
+ return dojo.validate.isUrl(this.textbox.value, this.flags);
+ }
+ }
+);
+
+/*
+ ****** EmailTextbox ******
+
+ A subclass of UrlTextbox.
+ Over-rides isValid to test for email addresses.
+ Can use all markup attributes/properties of UrlTextbox except scheme.
+ One new attribute available in the markup.
+
+ @attr allowCruft Allow address like <ma...@yahoo.com>. Default is false.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.EmailTextbox",
+ dojo.widget.validate.UrlTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.EmailTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.allowcruft ) {
+ this.flags.allowCruft = ( localProperties.allowcruft == "true" );
+ }
+ },
+
+ // Over-ride for email address validation
+ isValid: function() {
+ return dojo.validate.isEmailAddress(this.textbox.value, this.flags);
+ }
+ }
+);
+
+/*
+ ****** EmailListTextbox ******
+
+ A subclass of EmailTextbox.
+ Over-rides isValid to test for a list of email addresses.
+ Can use all markup attributes/properties of EmailTextbox and ...
+
+ @attr listSeparator The character used to separate email addresses.
+ Default is ";", ",", "\n" or " ".
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.EmailListTextbox",
+ dojo.widget.validate.EmailTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.EmailListTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.listseparator ) {
+ this.flags.listSeparator = localProperties.listseparator;
+ }
+ },
+
+ // Over-ride for email address list validation
+ isValid: function() {
+ return dojo.validate.isEmailAddressList(this.textbox.value, this.flags);
+ }
+ }
+);
+
+/*
+ ****** DateTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test if input is in a valid date format.
+
+ @attr format Described in dojo.validate.js. Default is "MM/DD/YYYY".
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.DateTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.DateTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.format ) {
+ this.flags.format = localProperties.format;
+ }
+ },
+
+ // Over-ride for date validation
+ isValid: function() {
+ return dojo.validate.isValidDate(this.textbox.value, this.flags.format);
+ }
+ }
+);
+
+/*
+ ****** TimeTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test if input is in a valid time format.
+
+ @attr format Described in dojo.validate.js. Default is "h:mm:ss t".
+ @attr amSymbol The symbol used for AM. Default is "AM" or "am".
+ @attr pmSymbol The symbol used for PM. Default is "PM" or "pm".
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.TimeTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.TimeTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.format ) {
+ this.flags.format = localProperties.format;
+ }
+ if ( localProperties.amsymbol ) {
+ this.flags.amSymbol = localProperties.amsymbol;
+ }
+ if ( localProperties.pmsymbol ) {
+ this.flags.pmSymbol = localProperties.pmsymbol;
+ }
+ },
+
+ // Over-ride for time validation
+ isValid: function() {
+ return dojo.validate.isValidTime(this.textbox.value, this.flags);
+ }
+ }
+);
+
+/*
+ ****** UsStateTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test if input is a US state abbr.
+
+ @attr allowTerritories Allow Guam, Puerto Rico, etc. Default is true.
+ @attr allowMilitary Allow military 'states', e.g. Armed Forces Europe (AE). Default is true.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.UsStateTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // Initialize properties in super-class.
+ dojo.widget.validate.UsStateTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attributes, and assign to flags object.
+ if ( localProperties.allowterritories ) {
+ this.flags.allowTerritories = ( localProperties.allowterritories == "true" );
+ }
+ if ( localProperties.allowmilitary ) {
+ this.flags.allowMilitary = ( localProperties.allowmilitary == "true" );
+ }
+ },
+
+ isValid: function() {
+ return dojo.validate.us.isState(this.textbox.value, this.flags);
+ }
+ }
+);
+
+/*
+ ****** UsZipTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test if input is a US zip code.
+ Validates zip-5 and zip-5 plus 4.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.UsZipTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ isValid: function() {
+ return dojo.validate.us.isZipCode(this.textbox.value);
+ }
+ }
+);
+
+/*
+ ****** UsSocialSecurityNumberTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test if input is a US Social Security Number.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.UsSocialSecurityNumberTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ isValid: function() {
+ return dojo.validate.us.isSocialSecurityNumber(this.textbox.value);
+ }
+ }
+);
+
+/*
+ ****** UsPhoneNumberTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test if input is a 10-digit US phone number, an extension is optional.
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.UsPhoneNumberTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ isValid: function() {
+ return dojo.validate.us.isPhoneNumber(this.textbox.value);
+ }
+ }
+);
+
+
+/*
+ ****** RegexpTextbox ******
+
+ A subclass of ValidationTextbox.
+ Over-rides isValid to test input based on a regular expression.
+ Has a new property that can be specified as attributes in the markup.
+
+ @attr regexp The regular expression string to use
+ @attr flags Flags to pass to the regular expression (e.g. 'i', 'g', etc)
+*/
+dojo.widget.defineWidget(
+ "dojo.widget.validate.RegexpTextbox",
+ dojo.widget.validate.ValidationTextbox,
+ {
+ mixInProperties: function(localProperties, frag) {
+ // First initialize properties in super-class.
+ dojo.widget.validate.RegexpTextbox.superclass.mixInProperties.apply(this, arguments);
+
+ // Get properties from markup attibutes, and assign to flags object.
+ if ( localProperties.regexp ) {
+ this.flags.regexp = localProperties.regexp;
+ }
+ if ( localProperties.flags ) {
+ this.flags.flags = localProperties.flags;
+ }
+ },
+
+ // Over-ride for integer validation
+ isValid: function() {
+ var regexp = new RegExp(this.flags.regexp, this.flags.flags);
+ return regexp.test(this.textbox.value);
+ }
+ }
+);
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/validate.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/vml/Chart.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/vml/Chart.js?view=auto&rev=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/vml/Chart.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/vml/Chart.js Fri Sep 22 16:22:30 2006
@@ -0,0 +1,610 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.widget.vml.Chart");
+
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.widget.Chart");
+dojo.require("dojo.math");
+dojo.require("dojo.html.layout");
+dojo.require("dojo.gfx.color");
+
+dojo.widget.defineWidget(
+ "dojo.widget.vml.Chart",
+ [dojo.widget.HtmlWidget, dojo.widget.Chart],
+ function(){
+ this.templatePath=null;
+ this.templateCssPath=null;
+ this._isInitialize=false;
+ this.hasData=false;
+ this.vectorNode=null;
+ this.plotArea=null;
+ this.dataGroup=null;
+ this.axisGroup=null;
+ this.properties={
+ height:0, // defaults, will resize to the domNode.
+ width:0,
+ defaultWidth:600,
+ defaultHeight:400,
+ plotType:null,
+ padding:{
+ top:10,
+ bottom:2,
+ left:60,
+ right:30
+ },
+ axes:{
+ x:{
+ plotAt:0,
+ label:"",
+ unitLabel:"",
+ unitType:Number,
+ nUnitsToShow:10,
+ range:{
+ min:0,
+ max:200
+ }
+ },
+ y:{
+ plotAt:0,
+ label:"",
+ unitLabel:"",
+ unitType:Number,
+ nUnitsToShow:10,
+ range:{
+ min:0,
+ max:200
+ }
+ }
+ }
+ };
+ },
+{
+ parseProperties:function(/* HTMLElement */node){
+ // summary
+ // Parse the properties off the main tag
+ var bRangeX=false;
+ var bRangeY=false;
+ if (node.getAttribute("width")){
+ this.properties.width=node.getAttribute("width");
+ }
+ if (node.getAttribute("height")){
+ this.properties.height=node.getAttribute("height");
+ }
+ if (node.getAttribute("plotType")){
+ this.properties.plotType=node.getAttribute("plotType");
+ }
+ if (node.getAttribute("padding")){
+ if (node.getAttribute("padding").indexOf(",") > -1)
+ var p=node.getAttribute("padding").split(",");
+ else var p=node.getAttribute("padding").split(" ");
+ if (p.length==1){
+ var pad=parseFloat(p[0]);
+ this.properties.padding.top=pad;
+ this.properties.padding.right=pad;
+ this.properties.padding.bottom=pad;
+ this.properties.padding.left=pad;
+ } else if(p.length==2){
+ var padV=parseFloat(p[0]);
+ var padH=parseFloat(p[1]);
+ this.properties.padding.top=padV;
+ this.properties.padding.right=padH;
+ this.properties.padding.bottom=padV;
+ this.properties.padding.left=padH;
+ } else if(p.length==4){
+ this.properties.padding.top=parseFloat(p[0]);
+ this.properties.padding.right=parseFloat(p[1]);
+ this.properties.padding.bottom=parseFloat(p[2]);
+ this.properties.padding.left=parseFloat(p[3]);
+ }
+ }
+ if (node.getAttribute("rangeX")){
+ var p=node.getAttribute("rangeX");
+ if (p.indexOf(",")>-1) p=p.split(",");
+ else p=p.split(" ");
+ this.properties.axes.x.range.min=parseFloat(p[0]);
+ this.properties.axes.x.range.max=parseFloat(p[1]);
+ bRangeX=true;
+ }
+ if (node.getAttribute("rangeY")){
+ var p=node.getAttribute("rangeY");
+ if (p.indexOf(",")>-1) p=p.split(",");
+ else p=p.split(" ");
+ this.properties.axes.y.range.min=parseFloat(p[0]);
+ this.properties.axes.y.range.max=parseFloat(p[1]);
+ bRangeY=true;
+ }
+ return { rangeX:bRangeX, rangeY:bRangeY };
+ },
+ setAxesPlot:function(/* HTMLElement */table){
+ // where to plot the axes
+ if (table.getAttribute("axisAt")){
+ var p=table.getAttribute("axisAt");
+ if (p.indexOf(",")>-1) p=p.split(",");
+ else p=p.split(" ");
+
+ // x axis
+ if (!isNaN(parseFloat(p[0]))){
+ this.properties.axes.x.plotAt=parseFloat(p[0]);
+ } else if (p[0].toLowerCase()=="ymin"){
+ this.properties.axes.x.plotAt=this.properties.axes.y.range.min;
+ } else if (p[0].toLowerCase()=="ymax"){
+ this.properties.axes.x.plotAt=this.properties.axes.y.range.max;
+ }
+
+ // y axis
+ if (!isNaN(parseFloat(p[1]))){
+ this.properties.axes.y.plotAt=parseFloat(p[1]);
+ } else if (p[1].toLowerCase()=="xmin"){
+ this.properties.axes.y.plotAt=this.properties.axes.x.range.min;
+ } else if (p[1].toLowerCase()=="xmax"){
+ this.properties.axes.y.plotAt=this.properties.axes.x.range.max;
+ }
+ } else {
+ this.properties.axes.x.plotAt=this.properties.axes.y.range.min;
+ this.properties.axes.y.plotAt=this.properties.axes.x.range.min;
+ }
+ },
+ drawVectorNode:function(){
+ // render the body of the chart, not the chart data.
+ if(this.vectorNode){ this.destroy(); }
+ this.vectorNode=document.createElement("div");
+ this.vectorNode.style.width=this.properties.width+"px";
+ this.vectorNode.style.height=this.properties.height+"px";
+ this.vectorNode.style.position="relative";
+ this.domNode.appendChild(this.vectorNode);
+ },
+ drawPlotArea:function(){
+ var plotWidth=this.properties.width-this.properties.padding.left-this.properties.padding.right;
+ var plotHeight=this.properties.height-this.properties.padding.top-this.properties.padding.bottom;
+
+ if(this.plotArea){
+ this.plotArea.parentNode.removeChild(this.plotArea);
+ this.plotArea=null;
+ }
+ this.plotArea=document.createElement("div");
+ this.plotArea.style.position="absolute";
+ this.plotArea.style.backgroundColor="#fff";
+ this.plotArea.style.top=(this.properties.padding.top)-2+"px";
+ this.plotArea.style.left=(this.properties.padding.left-1)+"px";
+ this.plotArea.style.width=plotWidth+"px";
+ this.plotArea.style.height=plotHeight+"px";
+ this.plotArea.style.clip="rect(0 "+plotWidth+" "+plotHeight+" 0)";
+ this.vectorNode.appendChild(this.plotArea);
+ },
+ drawDataGroup:function(){
+ var plotWidth=this.properties.width-this.properties.padding.left-this.properties.padding.right;
+ var plotHeight=this.properties.height-this.properties.padding.top-this.properties.padding.bottom;
+
+ if(this.dataGroup){
+ this.dataGroup.parentNode.removeChild(this.dataGroup);
+ this.dataGroup=null;
+ }
+ this.dataGroup=document.createElement("div");
+ this.dataGroup.style.position="absolute";
+ this.dataGroup.setAttribute("title", "Data Group");
+ this.dataGroup.style.top="0px";
+ this.dataGroup.style.left="0px";
+ this.dataGroup.style.width=plotWidth+"px";
+ this.dataGroup.style.height=plotHeight+"px";
+ this.plotArea.appendChild(this.dataGroup);
+ },
+ drawAxes:function(){
+ var plotWidth=this.properties.width-this.properties.padding.left-this.properties.padding.right;
+ var plotHeight=this.properties.height-this.properties.padding.top-this.properties.padding.bottom;
+
+ if(this.axisGroup){
+ this.axisGroup.parentNode.removeChild(this.axisGroup);
+ this.axisGroup=null;
+ }
+ this.axisGroup=document.createElement("div");
+ this.axisGroup.style.position="absolute";
+ this.axisGroup.setAttribute("title", "Axis Group");
+ this.axisGroup.style.top="0px";
+ this.axisGroup.style.left="0px";
+ this.axisGroup.style.width=plotWidth+"px";
+ this.axisGroup.style.height=plotHeight+"px";
+ this.plotArea.appendChild(this.axisGroup);
+ var stroke=1;
+
+ // x axis
+ var line=document.createElement("v:line");
+ var y=dojo.widget.vml.Chart.Plotter.getY(this.properties.axes.x.plotAt, this);
+ line.setAttribute("from", "0px,"+y+"px");
+ line.setAttribute("to", plotWidth+"px,"+y+"px");
+ line.style.position="absolute";
+ line.style.top="0px";
+ line.style.left="0px";
+ line.style.antialias="false";
+ line.setAttribute("strokecolor", "#666");
+ line.setAttribute("strokeweight", stroke*2+"px");
+ this.axisGroup.appendChild(line);
+
+ // y axis
+ var line=document.createElement("v:line");
+ var x=dojo.widget.vml.Chart.Plotter.getX(this.properties.axes.y.plotAt, this);
+ line.setAttribute("from", x+"px,0px");
+ line.setAttribute("to", x+"px,"+plotHeight+"px");
+ line.style.position="absolute";
+ line.style.top="0px";
+ line.style.left="0px";
+ line.style.antialias="false";
+ line.setAttribute("strokecolor", "#666");
+ line.setAttribute("strokeweight", stroke*2+"px");
+ this.axisGroup.appendChild(line);
+
+ // labels
+ var size=10;
+
+ // x axis labels.
+ var t=document.createElement("div");
+ t.style.position="absolute";
+ t.style.top=(this.properties.height-this.properties.padding.bottom)+"px";
+ t.style.left=this.properties.padding.left+"px";
+ t.style.fontFamily="sans-serif";
+ t.style.fontSize=size+"px";
+ t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.x.range.min),2);
+ this.vectorNode.appendChild(t);
+
+ t=document.createElement("div");
+ t.style.position="absolute";
+ t.style.top=(this.properties.height-this.properties.padding.bottom)+"px";
+ t.style.left=(this.properties.width-this.properties.padding.right-size)+"px";
+ t.style.fontFamily="sans-serif";
+ t.style.fontSize=size+"px";
+ t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.x.range.max),2);
+ this.vectorNode.appendChild(t);
+
+ // y axis labels.
+ t=document.createElement("div");
+ t.style.position="absolute";
+ t.style.top=(size/2)+"px";
+ t.style.left="0px";
+ t.style.width=this.properties.padding.left + "px";
+ t.style.textAlign="right";
+ t.style.paddingRight="4px";
+ t.style.fontFamily="sans-serif";
+ t.style.fontSize=size+"px";
+ t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.y.range.max),2);
+ this.vectorNode.appendChild(t);
+
+ t=document.createElement("div");
+ t.style.position="absolute";
+ t.style.top=(this.properties.height-this.properties.padding.bottom-size)+"px";
+ t.style.left="0px";
+ t.style.width=this.properties.padding.left + "px";
+ t.style.textAlign="right";
+ t.style.paddingRight="4px";
+ t.style.fontFamily="sans-serif";
+ t.style.fontSize=size+"px";
+ t.innerHTML=dojo.math.round(parseFloat(this.properties.axes.y.range.min),2);
+ this.vectorNode.appendChild(t);
+ },
+
+ init:function(){
+ // get the width and the height.
+ if(!this.properties.width || !this.properties.height){
+ var box=dojo.html.getContentBox(this.domNode);
+ if(!this.properties.width){
+ this.properties.width=(box.width<32)?this.properties.defaultWidth:box.width;
+ }
+ if(!this.properties.height){
+ this.properties.height=(box.height<32)?this.properties.defaultHeight:box.height;
+ }
+ }
+
+ // set up the chart; each is a method so that it can be selectively overridden.
+ this.drawVectorNode();
+ this.drawPlotArea();
+ this.drawDataGroup();
+ this.drawAxes();
+
+ // this is last.
+ this.assignColors();
+ this._isInitialized=true;
+ },
+ destroy:function(){
+ while(this.domNode.childNodes.length>0){
+ this.domNode.removeChild(this.domNode.childNodes[0]);
+ }
+ this.vectorNode=this.plotArea=this.dataGroup=this.axisGroup=null;
+ },
+ render:function(){
+ if (this.dataGroup){
+ while(this.dataGroup.childNodes.length>0){
+ this.dataGroup.removeChild(this.dataGroup.childNodes[0]);
+ }
+ } else {
+ this.init();
+ }
+ for(var i=0; i<this.series.length; i++){
+ dojo.widget.vml.Chart.Plotter.plot(this.series[i], this);
+ }
+ },
+ postCreate:function(){
+ // begin by grabbing the table, and reading it in.
+ var table=this.domNode.getElementsByTagName("table")[0];
+ if (table){
+ var ranges=this.parseProperties(table);
+ var bRangeX=false;
+ var bRangeY=false;
+
+ // fix the axes
+ var axisValues = this.parseData(table);
+ if(!bRangeX){
+ this.properties.axes.x.range={min:axisValues.x.min, max:axisValues.x.max};
+ }
+ if(!bRangeY){
+ this.properties.axes.y.range={min:axisValues.y.min, max:axisValues.y.max};
+ }
+ this.setAxesPlot(table);
+
+ // table values should be populated, now pop it off.
+ this.domNode.removeChild(table);
+ }
+ if(this.series.length>0){
+ this.render();
+ }
+ }
+});
+
+dojo.widget.vml.Chart.Plotter=new function(){
+ var self=this;
+ var plotters = {};
+ var types=dojo.widget.Chart.PlotTypes;
+
+ this.getX=function(value, chart){
+ var v=parseFloat(value);
+ var min=chart.properties.axes.x.range.min;
+ var max=chart.properties.axes.x.range.max;
+ var ofst=0-min;
+ min+=ofst; max+=ofst; v+=ofst;
+
+ var xmin = 0;
+ var xmax=chart.properties.width-chart.properties.padding.left-chart.properties.padding.right;
+ var x=(v*((xmax-xmin)/max))+xmin;
+ return x;
+ };
+ this.getY=function(value, chart){
+ var v=parseFloat(value);
+ var max=chart.properties.axes.y.range.max;
+ var min=chart.properties.axes.y.range.min;
+ var ofst=0;
+ if(min<0)ofst+=Math.abs(min);
+ min+=ofst; max+=ofst; v+=ofst;
+
+ var ymin=chart.properties.height-chart.properties.padding.top-chart.properties.padding.bottom;
+ var ymax = 0;
+ var y=(((ymin-ymax)/(max-min))*(max-v))+ymax;
+ return y;
+ };
+
+ this.addPlotter=function(name, func){
+ plotters[name]=func;
+ };
+ this.plot=function(series, chart){
+ if (series.values.length==0) return;
+ if (series.plotType && plotters[series.plotType]){
+ return plotters[series.plotType](series, chart);
+ }
+ else if (chart.plotType && plotters[chart.plotType]){
+ return plotters[chart.plotType](series, chart);
+ }
+ };
+
+ // plotting
+ plotters["bar"]=function(series, chart){
+ var space=1;
+ var lastW = 0;
+ var ys = [];
+ var yAxis=self.getY(chart.properties.axes.x.plotAt, chart);
+ var yA = yAxis;
+ for (var i=0; i<series.values.length; i++){
+ var x=self.getX(series.values[i].x, chart);
+ var w;
+ if (i==series.values.length-1){
+ w=lastW;
+ } else{
+ w=self.getX(series.values[i+1].x, chart)-x-space;
+ lastW=w;
+ }
+ x-=(w/2);
+
+ var y=self.getY(series.values[i].value, chart);
+ var h=Math.abs(yA-y);
+ if (parseFloat(series.values[i].value) < chart.properties.axes.x.plotAt){
+ y=yA;
+ }
+
+ var bar=document.createElement("v:rect");
+ bar.style.position="absolute";
+ bar.style.top=y+"px";
+ bar.style.left=x+"px";
+ bar.style.width=w+"px";
+ bar.style.height=h+"px";
+ bar.setAttribute("supposedToBe", "top/left/width/height: "
+ + Math.round(y) + "/"
+ + Math.round(x) + "/"
+ + Math.round(w) + "/"
+ + Math.round(h)
+ );
+ bar.setAttribute("fillColor", series.color);
+ bar.setAttribute("stroked", "false");
+ bar.style.antialias="false";
+ bar.setAttribute("title", series.label + " (" + i + "): " + series.values[i].value);
+ // bar.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
+ var fill=document.createElement("v:fill");
+ fill.setAttribute("opacity", "0.9");
+ bar.appendChild(fill);
+ chart.dataGroup.appendChild(bar);
+ }
+ };
+ plotters["line"]=function(series, chart){
+ var tension=1.5;
+
+ var line=document.createElement("v:shape");
+ line.setAttribute("strokeweight", "2px");
+ line.setAttribute("strokecolor", series.color);
+ line.setAttribute("fillcolor", "none");
+ line.setAttribute("filled", "false");
+ line.setAttribute("title", series.label);
+ line.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
+ line.style.position="absolute";
+ line.style.top="0px";
+ line.style.left="0px";
+ line.style.width= chart.properties.width+"px";
+ line.style.height=chart.properties.height+"px";
+ var stroke=document.createElement("v:stroke");
+ stroke.setAttribute("opacity", "0.85");
+ line.appendChild(stroke);
+
+ var path = [];
+ for (var i=0; i<series.values.length; i++){
+ var x = Math.round(self.getX(series.values[i].x, chart));
+ var y = Math.round(self.getY(series.values[i].value, chart));
+
+ if (i==0){
+ path.push("m");
+ path.push(x+","+y);
+ }else{
+ var lastx=Math.round(self.getX(series.values[i-1].x, chart));
+ var lasty=Math.round(self.getY(series.values[i-1].value, chart));
+ var dx=x-lastx;
+ var dy=y-lasty;
+
+ path.push("c");
+ var cx=Math.round((x-(tension-1)*(dx/tension)));
+ path.push(cx+","+lasty);
+ cx=Math.round((x-(dx/tension)));
+ path.push(cx+","+y);
+ path.push(x+","+y);
+ }
+ }
+ line.setAttribute("path", path.join(" ")+" e");
+ chart.dataGroup.appendChild(line);
+ };
+ plotters["area"]=function(series, chart){
+ var tension=1.5;
+
+ var line=document.createElement("v:shape");
+ line.setAttribute("strokeweight", "1px");
+ line.setAttribute("strokecolor", series.color);
+ line.setAttribute("fillcolor", series.color);
+ line.setAttribute("title", series.label);
+ line.setAttribute("coordsize", chart.properties.width + "," + chart.properties.height);
+ line.style.position="absolute";
+ line.style.top="0px";
+ line.style.left="0px";
+ line.style.width= chart.properties.width+"px";
+ line.style.height=chart.properties.height+"px";
+ var stroke=document.createElement("v:stroke");
+ stroke.setAttribute("opacity", "0.8");
+ line.appendChild(stroke);
+ var fill=document.createElement("v:fill");
+ fill.setAttribute("opacity", "0.4");
+ line.appendChild(fill);
+
+ var path = [];
+ for (var i=0; i<series.values.length; i++){
+ var x = Math.round(self.getX(series.values[i].x, chart));
+ var y = Math.round(self.getY(series.values[i].value, chart));
+
+ if (i==0){
+ path.push("m");
+ path.push(x+","+y);
+ }else{
+ var lastx=Math.round(self.getX(series.values[i-1].x, chart));
+ var lasty=Math.round(self.getY(series.values[i-1].value, chart));
+ var dx=x-lastx;
+ var dy=y-lasty;
+
+ path.push("c");
+ var cx=Math.round((x-(tension-1)*(dx/tension)));
+ path.push(cx+","+lasty);
+ cx=Math.round((x-(dx/tension)));
+ path.push(cx+","+y);
+ path.push(x+","+y);
+ }
+ }
+ path.push("l");
+ path.push(x + "," + self.getY(0, chart));
+ path.push("l");
+ path.push(self.getX(0, chart) + "," + self.getY(0,chart));
+ line.setAttribute("path", path.join(" ")+" x e");
+ chart.dataGroup.appendChild(line);
+ };
+ plotters["scatter"]=function(series, chart){
+ var r=6;
+ for (var i=0; i<series.values.length; i++){
+ var x=self.getX(series.values[i].x, chart);
+ var y=self.getY(series.values[i].value, chart);
+ var mod=r/2;
+
+ var point=document.createElement("v:rect");
+ point.setAttribute("fillcolor", series.color);
+ point.setAttribute("strokecolor", series.color);
+ point.setAttribute("title", series.label + ": " + series.values[i].value);
+ point.style.position="absolute";
+ point.style.rotation="45";
+ point.style.top=(y-mod)+"px";
+ point.style.left=(x-mod)+"px";
+ point.style.width=r+"px";
+ point.style.height=r+"px";
+ var fill=document.createElement("v:fill");
+ fill.setAttribute("opacity", "0.6");
+ point.appendChild(fill);
+ chart.dataGroup.appendChild(point);
+ }
+ };
+ plotters["bubble"]=function(series, chart){
+ // added param for series[n].value: size
+ var minR=1;
+
+ // do this off the x axis?
+ var min=chart.properties.axes.x.range.min;
+ var max=chart.properties.axes.x.range.max;
+ var ofst=0-min;
+
+ min+=ofst; max+=ofst;
+ var xmin=chart.properties.padding.left;
+ var xmax=chart.properties.width-chart.properties.padding.right;
+ var factor=(max-min)/(xmax-xmin)*25;
+
+ for (var i=0; i<series.values.length; i++){
+ var size = series.values[i].size;
+ if (isNaN(parseFloat(size))) size=minR;
+
+ var radius=(parseFloat(size)*factor)/2;
+ var diameter=radius * 2;
+ var cx=self.getX(series.values[i].x, chart);
+ var cy=self.getY(series.values[i].value, chart);
+
+ var top=cy-radius;
+ var left=cx-radius;
+
+ var point=document.createElement("v:oval");
+ point.setAttribute("fillcolor", series.color);
+ point.setAttribute("title", series.label + ": " + series.values[i].value + " (" + size + ")");
+ point.setAttribute("stroked", "false");
+ point.style.position="absolute";
+
+ point.style.top=top+"px";
+ point.style.left=left+"px";
+ point.style.width=diameter+"px";
+ point.style.height=diameter+"px";
+
+ var fill=document.createElement("v:fill");
+ fill.setAttribute("opacity", "0.8");
+ point.appendChild(fill);
+
+ chart.dataGroup.appendChild(point);
+ }
+ };
+}();
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/widget/vml/Chart.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/Parse.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/Parse.js?view=auto&rev=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/Parse.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/Parse.js Fri Sep 22 16:22:30 2006
@@ -0,0 +1,248 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.xml.Parse");
+dojo.require("dojo.dom");
+
+//TODO: determine dependencies
+// currently has dependency on dojo.xml.DomUtil nodeTypes constants...
+
+/* generic class for taking a node and parsing it into an object
+
+TODO: WARNING: This comment is wrong!
+
+For example, the following xml fragment
+
+<foo bar="bar">
+ <baz xyzzy="xyzzy"/>
+</foo>
+
+can be described as:
+
+dojo.???.foo = {}
+dojo.???.foo.bar = {}
+dojo.???.foo.bar.value = "bar";
+dojo.???.foo.baz = {}
+dojo.???.foo.baz.xyzzy = {}
+dojo.???.foo.baz.xyzzy.value = "xyzzy"
+
+*/
+// using documentFragment nomenclature to generalize in case we don't want to require passing a collection of nodes with a single parent
+dojo.xml.Parse = function(){
+
+ // supported dojoTagName's:
+ //
+ // <prefix:tag> => prefix:tag
+ // <dojo:tag> => dojo:tag
+ // <dojoTag> => dojo:tag
+ // <tag dojoType="type"> => dojo:type
+ // <tag dojoType="prefix:type"> => prefix:type
+ // <tag dojo:type="type"> => dojo:type
+ // <tag class="classa dojo-type classb"> => dojo:type
+
+ // get normalized (lowercase) tagName
+ // some browsers report tagNames in lowercase no matter what
+ function getTagName(node){
+ return ((node)&&(node.tagName) ? node.tagName.toLowerCase() : '');
+ }
+
+ // locate dojo qualified tag name
+ // FIXME: add rejection test against namespace filters declared in djConfig
+ function getDojoTagName(node){
+ var tagName = getTagName(node);
+ if (!tagName){
+ return '';
+ }
+ // any registered tag
+ if((dojo.widget)&&(dojo.widget.tags[tagName])){
+ return tagName;
+ }
+ // <prefix:tag> => prefix:tag
+ var p = tagName.indexOf(":");
+ if(p>=0){
+ return tagName;
+ }
+ // <dojo:tag> => dojo:tag
+ if(tagName.substr(0,5) == "dojo:"){
+ return tagName;
+ }
+ if(dojo.render.html.capable && dojo.render.html.ie && node.scopeName != 'HTML'){
+ return node.scopeName.toLowerCase() + ':' + tagName;
+ }
+ // <dojoTag> => dojo:tag
+ if(tagName.substr(0,4) == "dojo"){
+ // FIXME: this assumes tag names are always lower case
+ return "dojo:" + tagName.substring(4);
+ }
+ // <tag dojoType="prefix:type"> => prefix:type
+ // <tag dojoType="type"> => dojo:type
+ var djt = node.getAttribute("dojoType") || node.getAttribute("dojotype");
+ if(djt){
+ if (djt.indexOf(":")<0){
+ djt = "dojo:"+djt;
+ }
+ return djt.toLowerCase();
+ }
+ // <tag dojo:type="type"> => dojo:type
+ djt = node.getAttributeNS && node.getAttributeNS(dojo.dom.dojoml,"type");
+ if(djt){
+ return "dojo:" + djt.toLowerCase();
+ }
+ // <tag dojo:type="type"> => dojo:type
+ try{
+ // FIXME: IE really really doesn't like this, so we squelch errors for it
+ djt = node.getAttribute("dojo:type");
+ }catch(e){
+ // FIXME: log?
+ }
+ if(djt){ return "dojo:"+djt.toLowerCase(); }
+ // <tag class="classa dojo-type classb"> => dojo:type
+ if(!dj_global["djConfig"] || !djConfig["ignoreClassNames"]){
+ // FIXME: should we make this optionally enabled via djConfig?
+ var classes = node.className||node.getAttribute("class");
+ // FIXME: following line, without check for existence of classes.indexOf
+ // breaks firefox 1.5's svg widgets
+ if(classes && classes.indexOf && classes.indexOf("dojo-") != -1){
+ var aclasses = classes.split(" ");
+ for(var x=0, c=aclasses.length; x<c; x++){
+ if(aclasses[x].slice(0, 5) == "dojo-"){
+ return "dojo:"+aclasses[x].substr(5).toLowerCase();
+ }
+ }
+ }
+ }
+ // no dojo-qualified name
+ return '';
+ }
+
+ this.parseElement = function(node, hasParentNodeSet, optimizeForDojoML, thisIdx){
+
+ var parsedNodeSet = {};
+
+ var tagName = getTagName(node);
+ //There's a weird bug in IE where it counts end tags, e.g. </dojo:button> as nodes that should be parsed. Ignore these
+ if((tagName)&&(tagName.indexOf("/")==0)){
+ return null;
+ }
+
+ // look for a dojoml qualified name
+ // process dojoml only when optimizeForDojoML is true
+ var process = true;
+ if(optimizeForDojoML){
+ var dojoTagName = getDojoTagName(node);
+ tagName = dojoTagName || tagName;
+ process = Boolean(dojoTagName);
+ }
+
+ parsedNodeSet[tagName] = [];
+ var pos = tagName.indexOf(":");
+ if(pos>0){
+ var ns = tagName.substring(0,pos);
+ parsedNodeSet["namespace"] = ns;
+ // honor user namespace filters
+ if((dojo["namespace"])&&(!dojo["namespace"].allow(ns))){process=false;}
+ }
+
+ if(process){
+ var attributeSet = this.parseAttributes(node);
+ for(var attr in attributeSet){
+ if((!parsedNodeSet[tagName][attr])||(typeof parsedNodeSet[tagName][attr] != "array")){
+ parsedNodeSet[tagName][attr] = [];
+ }
+ parsedNodeSet[tagName][attr].push(attributeSet[attr]);
+ }
+ // FIXME: we might want to make this optional or provide cloning instead of
+ // referencing, but for now, we include a node reference to allow
+ // instantiated components to figure out their "roots"
+ parsedNodeSet[tagName].nodeRef = node;
+ parsedNodeSet.tagName = tagName;
+ parsedNodeSet.index = thisIdx||0;
+ //dojo.debug("parseElement: set the element tagName = "+parsedNodeSet.tagName+" and namespace to "+parsedNodeSet["namespace"]);
+ }
+
+ var count = 0;
+ for(var i = 0; i < node.childNodes.length; i++){
+ var tcn = node.childNodes.item(i);
+ switch(tcn.nodeType){
+ case dojo.dom.ELEMENT_NODE: // element nodes, call this function recursively
+ count++;
+ var ctn = getDojoTagName(tcn) || getTagName(tcn);
+ if(!parsedNodeSet[ctn]){
+ parsedNodeSet[ctn] = [];
+ }
+ parsedNodeSet[ctn].push(this.parseElement(tcn, true, optimizeForDojoML, count));
+ if( (tcn.childNodes.length == 1)&&
+ (tcn.childNodes.item(0).nodeType == dojo.dom.TEXT_NODE)){
+ parsedNodeSet[ctn][parsedNodeSet[ctn].length-1].value = tcn.childNodes.item(0).nodeValue;
+ }
+ break;
+ case dojo.dom.TEXT_NODE: // if a single text node is the child, treat it as an attribute
+ if(node.childNodes.length == 1){
+ parsedNodeSet[tagName].push({ value: node.childNodes.item(0).nodeValue });
+ }
+ break;
+ default: break;
+ /*
+ case dojo.dom.ATTRIBUTE_NODE: // attribute node... not meaningful here
+ break;
+ case dojo.dom.CDATA_SECTION_NODE: // cdata section... not sure if this would ever be meaningful... might be...
+ break;
+ case dojo.dom.ENTITY_REFERENCE_NODE: // entity reference node... not meaningful here
+ break;
+ case dojo.dom.ENTITY_NODE: // entity node... not sure if this would ever be meaningful
+ break;
+ case dojo.dom.PROCESSING_INSTRUCTION_NODE: // processing instruction node... not meaningful here
+ break;
+ case dojo.dom.COMMENT_NODE: // comment node... not not sure if this would ever be meaningful
+ break;
+ case dojo.dom.DOCUMENT_NODE: // document node... not sure if this would ever be meaningful
+ break;
+ case dojo.dom.DOCUMENT_TYPE_NODE: // document type node... not meaningful here
+ break;
+ case dojo.dom.DOCUMENT_FRAGMENT_NODE: // document fragment node... not meaningful here
+ break;
+ case dojo.dom.NOTATION_NODE:// notation node... not meaningful here
+ break;
+ */
+ }
+ }
+ //return (hasParentNodeSet) ? parsedNodeSet[node.tagName] : parsedNodeSet;
+ //if(parsedNodeSet.tagName)dojo.debug("parseElement: RETURNING NODE WITH TAGNAME "+parsedNodeSet.tagName);
+ return parsedNodeSet;
+ };
+
+ /* parses a set of attributes on a node into an object tree */
+ this.parseAttributes = function(node){
+ var parsedAttributeSet = {};
+ var atts = node.attributes;
+ // TODO: should we allow for duplicate attributes at this point...
+ // would any of the relevant dom implementations even allow this?
+ var attnode, i=0;
+ while((attnode=atts[i++])){
+ if((dojo.render.html.capable)&&(dojo.render.html.ie)){
+ if(!attnode){ continue; }
+ if( (typeof attnode == "object")&&
+ (typeof attnode.nodeValue == 'undefined')||
+ (attnode.nodeValue == null)||
+ (attnode.nodeValue == '')){
+ continue;
+ }
+ }
+
+ var nn = attnode.nodeName.split(":");
+ nn = (nn.length == 2) ? nn[1] : attnode.nodeName;
+
+ parsedAttributeSet[nn] = {
+ value: attnode.nodeValue
+ };
+ }
+ return parsedAttributeSet;
+ };
+};
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/Parse.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/XslTransform.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/XslTransform.js?view=auto&rev=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/XslTransform.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/XslTransform.js Fri Sep 22 16:22:30 2006
@@ -0,0 +1,186 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.xml.XslTransform");
+
+dojo.xml.XslTransform = function(/*String*/ xsltUri) {
+ // summary:
+ // dojo.xml.XslTransform is a convenience object that takes the URI String
+ // of an XSL file as a constructor argument.
+ // After each transformation all parameters will be cleared.
+
+ // Note this is supported by IE and Mozilla ONLY.
+
+ dojo.debug("XslTransform is supported by Internet Explorer and Mozilla, with limited support in Opera 9.");
+ var IS_IE = window.ActiveXObject ? true : false;
+ var ACTIVEX_DOMS = [
+ "Msxml2.DOMDocument.5.0",
+ "Msxml2.DOMDocument.4.0",
+ "Msxml2.DOMDocument.3.0",
+ "MSXML2.DOMDocument",
+ "MSXML.DOMDocument",
+ "Microsoft.XMLDOM"
+ ];
+ var ACTIVEX_FT_DOMS = [
+ "Msxml2.FreeThreadedDOMDocument.5.0",
+ "MSXML2.FreeThreadedDOMDocument.4.0",
+ "MSXML2.FreeThreadedDOMDocument.3.0"
+ ];
+ var ACTIVEX_TEMPLATES = [
+ "Msxml2.XSLTemplate.5.0",
+ "Msxml2.XSLTemplate.4.0",
+ "MSXML2.XSLTemplate.3.0"
+ ];
+
+ function getActiveXImpl(activeXArray) {
+ for (var i=0; i < activeXArray.length; i++) {
+ try {
+ var testObj = new ActiveXObject(activeXArray[i]);
+ if (testObj) {
+ return activeXArray[i];
+ }
+ } catch (e) {}
+ }
+ dojo.raise("Could not find an ActiveX implementation in:\n\n " + activeXArray);
+ }
+
+ if (xsltUri == null || xsltUri == undefined) {
+ dojo.raise("You must pass the URI String for the XSL file to be used!");
+ return false;
+ }
+
+ var xsltDocument = null;
+ var xsltProcessor = null;
+ if (IS_IE) {
+ xsltDocument = new ActiveXObject(getActiveXImpl(ACTIVEX_FT_DOMS));
+ xsltDocument.async = false;
+ } else {
+ xsltProcessor = new XSLTProcessor();
+ xsltDocument = document.implementation.createDocument("", "", null);
+ xsltDocument.addEventListener("load", onXslLoad, false);
+ }
+ xsltDocument.load(xsltUri);
+
+ if (IS_IE) {
+ var xslt = new ActiveXObject(getActiveXImpl(ACTIVEX_TEMPLATES));
+ xslt.stylesheet = xsltDocument;
+ xsltProcessor = xslt.createProcessor();
+ }
+
+ function onXslLoad() {
+ xsltProcessor.importStylesheet(xsltDocument);
+ }
+
+ function getResultDom(xmlDoc, params) {
+ if (IS_IE) {
+ addIeParams(params);
+ var result = getIeResultDom(xmlDoc);
+ removeIeParams(params);
+ return result;
+ } else {
+ return getMozillaResultDom(xmlDoc, params);
+ }
+ }
+
+ function addIeParams(params) {
+ if (params != null) {
+ for (var i=0; i<params.length; i++)
+ xsltProcessor.addParameter(params[i][0], params[i][1]);
+ }
+ }
+
+ function removeIeParams(params) {
+ if (params != null) {
+ for (var i=0; i<params.length; i++)
+ xsltProcessor.addParameter(params[i][0], "");
+ }
+ }
+
+ function getIeResultDom(xmlDoc) {
+ xsltProcessor.input = xmlDoc;
+ var outDoc = new ActiveXObject(getActiveXImpl(ACTIVEX_DOMS));
+ outDoc.async = false;
+ outDoc.validateOnParse = false;
+ xsltProcessor.output = outDoc;
+ xsltProcessor.transform();
+ if (outDoc.parseError.errorCode != 0) {
+ var err = outDoc.parseError;
+ dojo.raise("err.errorCode: " + err.errorCode + "\n\nerr.reason: " + err.reason + "\n\nerr.url: " + err.url + "\n\nerr.srcText: " + err.srcText);
+ }
+ return outDoc;
+ }
+
+ function getIeResultStr(xmlDoc, params) {
+ xsltProcessor.input = xmlDoc;
+ xsltProcessor.transform();
+ return xsltProcessor.output;
+ }
+
+ function addMozillaParams(params) {
+ if (params != null) {
+ for (var i=0; i<params.length; i++)
+ xsltProcessor.setParameter(null, params[i][0], params[i][1]);
+ }
+ }
+
+ function getMozillaResultDom(xmlDoc, params) {
+ addMozillaParams(params);
+ var resultDoc = xsltProcessor.transformToDocument(xmlDoc);
+ xsltProcessor.clearParameters();
+ return resultDoc;
+ }
+
+ function getMozillaResultStr(xmlDoc, params, parentDoc) {
+ addMozillaParams(params);
+ var resultDoc = xsltProcessor.transformToFragment(xmlDoc, parentDoc);
+ var serializer = new XMLSerializer();
+ xsltProcessor.clearParameters();
+ return serializer.serializeToString(resultDoc);
+ }
+
+ this.getResultString = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*HTMLDocument*/parentDoc) {
+ if (IS_IE) {
+ addIeParams(params);
+ var result = getIeResultStr(xmlDoc, params);
+ removeIeParams(params);
+ return result;
+ } else {
+ return getMozillaResultStr(xmlDoc, params, parentDoc);
+ }
+ };
+
+ this.transformToContentPane = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*ContentPane*/contentPane, /*HTMLDocument*/parentDoc) {
+ var content = this.getResultString(xmlDoc, params, parentDoc);
+ contentPane.setContent(content);
+ };
+
+ this.transformToRegion = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*HTMLElement*/region, /*HTMLDocument*/parentDoc) {
+ try {
+ var content = this.getResultString(xmlDoc, params, parentDoc);
+ region.innerHTML = content;
+ } catch (e) {
+ dojo.raise(e.message + "\n\n xsltUri: " + xsltUri)
+ }
+ };
+
+ this.transformToDocument = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params) {
+ return getResultDom(xmlDoc, params);
+ }
+
+ this.transformToWindow = function(/*XMLDOcument*/ xmlDoc, /*2 Dimensional Array*/params, /*HTMLDocument*/windowDoc, /*HTMLDocument*/parentDoc) {
+ try {
+ windowDoc.open();
+ windowDoc.write(this.getResultString(xmlDoc, params, parentDoc));
+ windowDoc.close();
+ } catch (e) {
+ dojo.raise(e.message + "\n\n xsltUri: " + xsltUri)
+ }
+ };
+};
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/__package__.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/__package__.js?view=auto&rev=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/__package__.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/__package__.js Fri Sep 22 16:22:30 2006
@@ -0,0 +1,18 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.require("dojo.xml.Parse");
+dojo.kwCompoundRequire({
+ common: ["dojo.dom"],
+ browser: ["dojo.html.*"],
+ dashboard: ["dojo.html.*"],
+ svg: ["dojo.xml.svgUtil"]
+});
+dojo.provide("dojo.xml.*");
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/__package__.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/svgUtil.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/svgUtil.js?view=auto&rev=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/svgUtil.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/svgUtil.js Fri Sep 22 16:22:30 2006
@@ -0,0 +1,32 @@
+/*
+ Copyright (c) 2004-2006, The Dojo Foundation
+ All Rights Reserved.
+
+ Licensed under the Academic Free License version 2.1 or above OR the
+ modified BSD license. For more information on Dojo licensing, see:
+
+ http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.xml.svgUtil");
+// FIXME: add imports for deps!
+
+dojo.xml.svgUtil = new function(){
+
+ this.getInnerWidth = function(node){
+ // FIXME: need to find out from dylan how to
+ }
+
+ this.getOuterWidth = function(node){
+
+ }
+
+ this.getInnerHeight = function(node){
+
+ }
+
+ this.getOuterHeight = function(node){
+
+ }
+
+}
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/src/xml/svgUtil.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/storage_dialog.swf
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/storage_dialog.swf?view=auto&rev=449122
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/dojo/storage_dialog.swf
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/lib/ant-dojotest.jar
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/lib/ant-dojotest.jar?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
Binary files - no diff available.
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js Fri Sep 22 16:22:30 2006
@@ -1,13 +1,11 @@
-dojo.provide("tapestry");
dojo.provide("tapestry.core");
-dojo.setModulePrefix("tapestry", "../tapestry");
dojo.require("dojo.logging.Logger");
-dojo.require("dojo.io");
-dojo.require("dojo.event");
+dojo.require("dojo.io.*");
+dojo.require("dojo.event.browser");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Dialog");
-dojo.require("dojo.html");
+dojo.require("dojo.html.style");
tapestry={
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/event.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/event.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/event.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/event.js Fri Sep 22 16:22:30 2006
@@ -1,9 +1,10 @@
dojo.provide("tapestry.event");
+dojo.require("tapestry.lang");
dojo.require("dojo.event.browser");
dojo.require("dojo.dom");
-tapestry.event = {
+tapestry.event={
/**
* Takes an incoming browser generated event (like key/mouse events) and
@@ -22,7 +23,7 @@
if(event["type"]) props.beventtype=event.type;
if(event["keys"]) props.beventkeys=event.keys;
- if (event["charCode"]) props.beventcharCode=event.charCode;
+ if(event["charCode"]) props.beventcharCode=event.charCode;
if(event["pageX"]) props.beventpageX=event.pageX;
if(event["pageY"]) props.beventpageY=event.pageY;
if(event["layerX"]) props.beventlayerX=event.layerX;
@@ -38,19 +39,21 @@
* relevent target data.
*/
buildTargetProperties:function(props, target){
- if(!target) return;
+ if(!target) { return; }
- if (dojo.dom.isNode(target))
+ if (dojo.dom.isNode(target)) {
return this.buildNodeProperties(props, target);
- else
+ } else {
dojo.raise("buildTargetProperties() Unknown target type:" + target);
+ }
},
/**
* Builds needed target node properties, like the nodes id.
*/
buildNodeProperties:function(props, node) {
- if (node.getAttribute("id"))
+ if (node.getAttribute("id")) {
props["beventtarget.id"]=node.getAttribute("id");
+ }
}
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form.js Fri Sep 22 16:22:30 2006
@@ -1,8 +1,8 @@
dojo.provide("tapestry.form");
-dojo.require("dojo.event");
dojo.require("dojo.event.browser");
dojo.require("dojo.dom");
+dojo.require("dojo.html.selection");
dojo.require("tapestry.core");
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/datetime.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/datetime.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/datetime.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/datetime.js Fri Sep 22 16:22:30 2006
@@ -1,7 +1,8 @@
dojo.provide("tapestry.form.datetime");
+dojo.require("dojo.date.format");
dojo.require("dojo.validate.datetime");
-dojo.require("dojo.date");
+dojo.require("dojo.logging.Logger");
tapestry.form.datetime={
@@ -18,39 +19,46 @@
* @return Boolean. True if valid, false otherwise.
*/
isValidDate:function(value, flags){
- // default generic validation if no flags specified
- if (!flags || typeof flags.format != "string")
- return dojo.validate.isValidDate(value);
+ if (!value || !flags){
+ dojo.raise("isValidDate: value and flags must be specified");
+ return;
+ }
// parse date value
var dateValue=null;
try {
- dateValue = new Date(value);
+ dateValue = dojo.date.parse(value, flags);
} catch (e) {
dojo.log.exception("Error parsing input date.", e, true);
return false;
}
+ if(dateValue == null) { return false; }
+
// convert to format that is validatable
- value = dojo.date.format(dateValue, flags.format);
+ value=dojo.date.format(dateValue, flags);
// TODO: This is totally useless right now, doesn't even accept formats with string equivs
// See a better method http://www.mattkruse.com/javascript/date/source.html
// basic format validation
// if (!dojo.validate.isValidDate(value, flags.format))
- //return false;
+ // return false;
// max date
- if (typeof flags.max == "string") {
- var max = new Date(flags.max);
- if (dojo.date.compare(dateValue, max, dojo.date.compareTypes.DATE) > 0)
+ if (!dj_undef("max", flags)){
+ if (typeof flags.max == "string"){
+ flags.max=dojo.date.parse(flags.max, flags);
+ }
+ if (dojo.date.compare(dateValue, flags.max, dojo.date.compareTypes.DATE) > 0)
return false;
}
// min date
- if (typeof flags.min == "string") {
- var min = new Date(flags.min);
- if (dojo.date.compare(dateValue, min, dojo.date.compareTypes.DATE) < 0)
+ if (!dj_undef("min", flags)){
+ if (typeof flags.min == "string"){
+ flags.min=dojo.date.parse(flags.min, flags);
+ }
+ if (dojo.date.compare(dateValue, flags.min, dojo.date.compareTypes.DATE) < 0)
return false;
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/validation.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/validation.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/validation.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/form/validation.js Fri Sep 22 16:22:30 2006
@@ -1,9 +1,8 @@
dojo.provide("tapestry.form.validation");
dojo.require("dojo.validate.check");
-dojo.require("dojo.html");
+dojo.require("dojo.html.style");
dojo.require("dojo.widget.*");
-
dojo.require("tapestry.widget.AlertDialog");
tapestry.form.validation={
@@ -114,6 +113,7 @@
* @param profile The form validation profile.
*/
handleMissingField:function(field, profile){
+ if (dj_undef("type", field)) {return;}
dojo.html.removeClass(field, this.invalidClass);
if (!dojo.html.hasClass(field, this.missingClass)){
@@ -128,6 +128,7 @@
* @param profile The form validation profile.
*/
handleInvalidField:function(field, profile){
+ if (dj_undef("type", field)) {return;}
dojo.html.removeClass(field, this.missingClass);
if (!dojo.html.hasClass(field, this.invalidClass)){
@@ -212,7 +213,7 @@
var node=document.createElement("span");
document.body.appendChild(node);
- var dialog=dojo.widget.createWidget("AlertDialog",
+ var dialog=dojo.widget.createWidget("tapestry:AlertDialog",
{
widgetId:"validationDialog",
message:msg
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/html.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/html.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/html.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/html.js Fri Sep 22 16:22:30 2006
@@ -68,4 +68,4 @@
s += '</' + node.nodeName + '>';
return s;
}
-}
\ No newline at end of file
+}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/lang.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/lang.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/lang.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/lang.js Fri Sep 22 16:22:30 2006
@@ -1,6 +1,6 @@
dojo.provide("tapestry.lang");
-dojo.require("dojo.lang");
+dojo.require("dojo.lang.common");
tapestry.lang = {
Added: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/namespace.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/namespace.js?view=auto&rev=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/namespace.js (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/namespace.js Fri Sep 22 16:22:30 2006
@@ -0,0 +1,24 @@
+dojo.provide("tapestry.namespace");
+
+dojo.require("dojo.namespace");
+
+(function(){
+
+ var map = {
+ html: {
+ "alertdialog": "tapestry.widget.AlertDialog",
+ "dropdowndatetimepicker" : "tapestry.widget.DropdownDateTimePicker",
+ "dropdowntimepicker" : "tapestry.widget.DropdownTimePicker",
+ "timepicker" : "tapestry.widget.TimePicker"
+ }
+ };
+
+ function resolveNamespace(name, domain){
+ if(!domain){ domain="html"; }
+ if(!map[domain]){ return null; }
+ return map[domain][name];
+ }
+
+ dojo.registerNamespaceManifest("tapestry","../tapestry", "tapestry", "tapestry.widget");
+ dojo.registerNamespaceResolver("tapestry", resolveNamespace);
+})();
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/namespace.js
------------------------------------------------------------------------------
svn:eol-style = native
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/test.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/test.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/test.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/test.js Fri Sep 22 16:22:30 2006
@@ -1,44 +1,11 @@
dojo.provide("tapestry.test");
+
dojo.require("dojo.logging.Logger");
-dojo.require("dojo.io");
-dojo.require("dojo.io.*");
+dojo.require("dojo.event.browser");
// override to make sure our fake events pass
dojo.event.browser.isEvent=function() { return true; }
-if (dj_undef("byId", dj_global)) {
-dojo.byId = function(id, doc){
- if(id && (typeof id == "string" || id instanceof String)){
- if(!doc){ doc = document; }
- return doc.getElementById(id);
- }
- return id; // assume it's a node
-}
-}
-
-dojo.debug=function(message){
- dojo.log.debug(message);
-}
-
-dojo.debugShallow = function(obj){
- if (!djConfig.isDebug) { return; }
- dojo.debug('------------------------------------------------------------');
- dojo.debug('Object: '+obj);
- var props = [];
- for(var prop in obj){
- try {
- props.push(prop + ': ' + obj[prop]);
- } catch(E) {
- props.push(prop + ': ERROR - ' + E.message);
- }
- }
- props.sort();
- for(var i = 0; i < props.length; i++) {
- dojo.debug(props[i]);
- }
- dojo.debug('------------------------------------------------------------');
-}
-
function lastMsgContains(str){
if (arguments.length < 1) return false;
@@ -63,7 +30,3 @@
}
}
-dojo.io.queueBind=function(kwArgs){
- dojo.log.info("dojo.io.RhinoIO.bind():");
- dojo.debugShallow(kwArgs);
-}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/AlertDialog.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/AlertDialog.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/AlertDialog.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/AlertDialog.js Fri Sep 22 16:22:30 2006
@@ -3,12 +3,12 @@
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.widget.Button");
-dojo.require("dojo.event.*");
-dojo.require("dojo.html");
+dojo.require("dojo.event.common");
+dojo.require("dojo.html.common");
dojo.widget.defineWidget(
"tapestry.widget.AlertDialog",
- dojo.widget.html.Dialog,
+ dojo.widget.Dialog,
{
bgColor: "white",
bgOpacity: 0.5,
@@ -17,7 +17,7 @@
message:"",
postCreate: function(args, frag, parentComp) {
- tapestry.widget.AlertDialog.superclass.postCreate.call(this, args, frag, parentComp);
+ dojo.widget.Dialog.prototype.postCreate.call(this, args, frag, parentComp);
var content=document.createElement("div");
this.containerNode.appendChild(content);
@@ -30,6 +30,7 @@
var buttNode=document.createElement("div");
buttNode.appendChild(document.createTextNode("ok"));
content.appendChild(buttNode);
+
this.show(); // to fix bug in button
this.okButton=dojo.widget.createWidget("Button",{}, buttNode);
dojo.event.connect(this.okButton, "onClick", this, "hide");
@@ -42,11 +43,9 @@
hideDialog:function(e){
this.hide();
this.okButton.destroy();
- tapestry.widget.AlertDialog.superclass.destroy.call(this);
+ tapestry.widget.AlertDialog.prototype.destroy.call(this);
dojo.dom.removeNode(this.bg);
}
},
"html"
);
-
-dojo.widget.tags.addParseTreeHandler("dojo:alertdialog");
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownDateTimePicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownDateTimePicker.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownDateTimePicker.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownDateTimePicker.js Fri Sep 22 16:22:30 2006
@@ -2,8 +2,8 @@
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
-dojo.require("dojo.event.*");
-dojo.require("dojo.html");
+dojo.require("dojo.event.common");
+dojo.require("dojo.html.style");
dojo.require("tapestry.widget.TimePicker");
@@ -56,5 +56,3 @@
},
"html"
);
-
-dojo.widget.tags.addParseTreeHandler("dojo:dropdowndatetimepicker");
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownTimePicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownTimePicker.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownTimePicker.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/DropdownTimePicker.js Fri Sep 22 16:22:30 2006
@@ -3,8 +3,8 @@
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.TimePicker");
-dojo.require("dojo.event.*");
-dojo.require("dojo.html");
+dojo.require("dojo.event.common");
+dojo.require("dojo.html.style");
dojo.widget.defineWidget(
"tapestry.widget.DropdownTimePicker",
@@ -19,7 +19,7 @@
date: null,
fillInTemplate: function(args, frag){
- tapestry.widget.DropdownTimePicker.superclass.fillInTemplate.call(this, args, frag);
+ tapestry.widget.DropdownTimePicker.prototype.fillInTemplate.call(this, args, frag);
var source = this.getFragNodeRef(frag);
if(args.date){ this.date = new Date(args.date); }
@@ -56,4 +56,3 @@
"html"
);
-dojo.widget.tags.addParseTreeHandler("dojo:dropdowntimepicker");
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/TimePicker.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/TimePicker.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/TimePicker.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/TimePicker.js Fri Sep 22 16:22:30 2006
@@ -1,8 +1,18 @@
dojo.provide("tapestry.widget.TimePicker");
+
dojo.require("dojo.widget.HtmlWidget");
-dojo.require("dojo.date");
+dojo.require("dojo.date.common");
+dojo.require("dojo.date.format");
dojo.require("dojo.lang.common");
+dojo.widget.defineWidget(
+ "tapestry.widget.TimePicker",
+ dojo.widget.HtmlWidget,
+ {
+
+ }
+);
+
tapestry.widget.TimePicker=function(){
dojo.widget.HtmlWidget.call(this);
@@ -325,5 +335,3 @@
this.domNode.appendChild(container);
}
});
-
-dojo.widget.tags.addParseTreeHandler("dojo:timepicker");
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/Widget.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/Widget.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/Widget.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/widget/Widget.js Fri Sep 22 16:22:30 2006
@@ -15,9 +15,6 @@
dojo.provide("tapestry.widget.Widget");
dojo.require("dojo.widget.*");
-dojo.require("dojo.dom");
-dojo.require("dojo.event");
-dojo.require("dojo.lang.common");
// Define core widget management methods
tapestry.widget = {
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/form/test_datetime.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/form/test_datetime.js?view=diff&rev=449122&r1=449121&r2=449122
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/form/test_datetime.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/form/test_datetime.js Fri Sep 22 16:22:30 2006
@@ -1,36 +1,39 @@
-dojo.setModulePrefix("tapestry", "../tapestry");
+dojo.registerModulePath("tapestry", "../tapestry");
-dojo.require("dojo.date");
-
-dojo.require("tapestry.*");
+dojo.require("dojo.widget.*");
dojo.require("tapestry.test");
+dojo.require("tapestry.core");
+dojo.require("tapestry.form");
dojo.require("tapestry.form.datetime");
function test_datetime_validDate(){
var value = "08/15/1999";
- jum.assertTrue(value, tapestry.form.datetime.isValidDate(value));
+ // jum.assertFalse(value, tapestry.form.datetime.isValidDate(value, {}));
+ jum.assertTrue(value, tapestry.form.datetime.isValidDate(value,
+ {datePattern:"MM/dd/yyyy",selector:"dateOnly"}));
- value = "12112/12/23434";
- jum.assertFalse(value, tapestry.form.datetime.isValidDate(value));
- jum.assertFalse("null value", tapestry.form.datetime.isValidDate());
+ // value = "12112/12/23434";
+ // jum.assertFalse(value, tapestry.form.datetime.isValidDate(value));
+ // jum.assertFalse("null value", tapestry.form.datetime.isValidDate());
}
function test_datetime_maxDate(){
var maxValue = "09/28/2020";
var value = "08/15/2021";
- jum.assertTrue(value, tapestry.form.datetime.isValidDate(value, {max:maxValue}));
-
jum.assertFalse(value, tapestry.form.datetime.isValidDate(value,
- {max:maxValue, format:"MM/DD/YYYY"}));
+ {strict:true,max:maxValue,datePattern:"MM/dd/yyyy",selector:"dateOnly"}));
+
+ jum.assertTrue("08/15/2020", tapestry.form.datetime.isValidDate("08/15/2020",
+ {strict:true, max:maxValue, datePattern:"MM/dd/yyyy",selector:"dateOnly"}));
value = "08/15/2020";
jum.assertTrue(value, tapestry.form.datetime.isValidDate(value,
- {max:maxValue, format:"MM/DD/YYYY"}));
-
+ {strict:true, max:maxValue, datePattern:"MM/dd/yyyy",selector:"dateOnly"}));
+
jum.assertTrue("09/28/2020", tapestry.form.datetime.isValidDate(
"09/28/2020",
- {max:maxValue, format:"MM/DD/YYYY"})
+ {strict:true, max:maxValue, datePattern:"MM/dd/yyyy",selector:"dateOnly"})
);
}
@@ -38,19 +41,24 @@
var minValue = "09/28/2000";
var value = "09/27/2000";
- jum.assertTrue(value, tapestry.form.datetime.isValidDate(value, {min:minValue}));
-
jum.assertFalse(value, tapestry.form.datetime.isValidDate(value,
- {min:minValue, format:"MM/DD/YYYY"}));
+ {strict:true, min:minValue,selector:"dateOnly",datePattern:"MM/dd/yyyy"}));
+
+ jum.assertTrue("11/27/2000", tapestry.form.datetime.isValidDate("11/27/2000",
+ {strict:true,min:minValue, datePattern:"MM/dd/yyyy",selector:"dateOnly"}));
value = "09/28/2000";
jum.assertTrue(value, tapestry.form.datetime.isValidDate(value,
- {min:minValue, format:"MM/DD/YYYY"}));
+ {strict:true,min:minValue, datePattern:"MM/dd/yyyy",selector:"dateOnly"}));
}
-function test_datetime_posixFormat(){
+/*
+function test_datetime_LongFormat(){
var value = "18 Aug 2006";
- jum.assertFalse(value, tapestry.form.datetime.isValidDate(value, {max:"06 Aug 2006",format:"%d %h %Y"}));
- jum.assertTrue(value, tapestry.form.datetime.isValidDate(value, {max:"19 Aug 2006",format:"%d %h %Y"}));
+ jum.assertFalse(value, tapestry.form.datetime.isValidDate(value,
+ {strict:true,max:"06 Aug 2006",datePattern:"dd MMM yyyy",selector:"dateOnly"}));
+ jum.assertTrue(value, tapestry.form.datetime.isValidDate(value,
+ {strict:true,max:"19 Aug 2006",datePattern:"dd MMM yyyy",selector:"dateOnly"}));
}
+*/
\ No newline at end of file