You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2007/10/21 18:23:59 UTC
svn commit: r586916 [1/6] - in /tapestry/tapestry5/trunk: tapestry-core/
tapestry-core/src/main/java/org/apache/tapestry/corelib/base/
tapestry-core/src/main/java/org/apache/tapestry/corelib/components/
tapestry-core/src/main/java/org/apache/tapestry/c...
Author: hlship
Date: Sun Oct 21 09:23:51 2007
New Revision: 586916
URL: http://svn.apache.org/viewvc?rev=586916&view=rev
Log:
TAPESTRY-1634: Create a DateField component that uses client-side JavaScript
Added:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.properties
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue2.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-brown.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-green.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup_stripped.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-system.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-tas.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-win2k-1.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-win2k-2.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-win2k-cold-1.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-win2k-cold-2.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar_stripped.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/img.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-af.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-al.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-bg.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-big5-utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-big5.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-br.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-ca.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-cs-utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-cs-win.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-da.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-de.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-du.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-el.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-en.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-es.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-fi.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-fr.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-he-utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-hr-utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-hr.js (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-hu.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-it.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-jp.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-ko-utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-ko.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-lt-utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-lt.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-lv.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-nl.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-no.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-pl-utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-pl.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-pt.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-ro.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-ru.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-ru_win_.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-si.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-sk.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-sp.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-sv.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-tr.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/calendar-zh.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/lang/cn_utf8.js
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/menuarrow.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/menuarrow2.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/active-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/dark-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/hover-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/menuarrow.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/normal-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/rowhover-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/status-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/theme.css
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/title-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/today-bg.gif (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanEditDateDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ShowBirthdayReminder.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/DateFieldTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/BirthdayReminder.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/BeanEditDateDemo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DateFieldDemo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ShowBirthdayReminder.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/LICENSE.txt
tapestry/tapestry5/trunk/tapestry-core/NOTICE.txt
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridDataSource.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/InternalModule.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css
tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry/test/AbstractIntegrationTestSuite.java
tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/components/Upload.java
Modified: tapestry/tapestry5/trunk/tapestry-core/LICENSE.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/LICENSE.txt?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/LICENSE.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/LICENSE.txt Sun Oct 21 09:23:51 2007
@@ -421,4 +421,18 @@
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+DYNARCH.COM DHTML/JAVASCRIPT CALENDAR
+The DHTML Calendar
+-------------------
+
+ Author: Mihai Bazon, <mi...@yahoo.com>
+ http://dynarch.com/mishoo/
+
+ This program is free software published under the
+ terms of the GNU Lesser General Public License.
+
+ For the entire license text please refer to
+ http://www.gnu.org/licenses/lgpl.html
+
+
Modified: tapestry/tapestry5/trunk/tapestry-core/NOTICE.txt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/NOTICE.txt?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/NOTICE.txt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/NOTICE.txt Sun Oct 21 09:23:51 2007
@@ -13,6 +13,9 @@
This product includes modified versions of Java classes from the JSON library.
http://json.org/
+This product includes the DHTML/JavaScript Calendar, distributed under the terms of the Lesser GNU Public License.
+
+
This product includes images from the Silk icon set, distributed under the terms of the Creative Commons Attribution 2.5 License.
http://www.famfamfam.com/lab/icons/silk/
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractField.java Sun Oct 21 09:23:51 2007
@@ -25,6 +25,7 @@
import org.apache.tapestry.PageRenderSupport;
import org.apache.tapestry.ValidationDecorator;
import org.apache.tapestry.ValidationException;
+import org.apache.tapestry.Validator;
import org.apache.tapestry.annotations.AfterRender;
import org.apache.tapestry.annotations.BeginRender;
import org.apache.tapestry.annotations.Environmental;
@@ -224,21 +225,31 @@
*/
protected abstract void processSubmission(FormSupport formSupport, String elementName);
+ /** Allows the validation decorator to write markup before the field itself writes markup. */
@BeginRender
final void beforeDecorator(MarkupWriter writer)
{
_decorator.beforeField(this);
}
+ /**
+ * Allows the validation decorator to write markup after the field has written all of its
+ * markup.
+ */
@AfterRender
final void afterDecorator(MarkupWriter writer)
{
_decorator.afterField(this);
}
- protected final ValidationDecorator getValidationDecorator()
+ /**
+ * Invoked from subclasses after they have written their tag and (where appropriate) their
+ * informal parameters <em>and</em> have allowed their {@link Validator} to write markup as
+ * well.
+ */
+ protected final void decorateInsideField()
{
- return _decorator;
+ _decorator.insideField(this);
}
protected final void setDecorator(ValidationDecorator decorator)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/base/AbstractTextField.java Sun Oct 21 09:23:51 2007
@@ -42,7 +42,7 @@
public abstract class AbstractTextField extends AbstractField
{
/**
- * The value to be read and updated. This is not necessarilly a string, a translator may be
+ * The value to be read and updated. This is not necessarily a string, a translator may be
* provided to convert between client side and server side representations. If not bound, a
* default binding is made to a property of the container matching the component's id. If no
* such property exists, then you will see a runtime exception due to the unbound value
@@ -60,8 +60,8 @@
private Translator<Object> _translate;
/**
- * The object that will peform input validation (which occurs after translation). The translate
- * binding prefix is genereally used to provide this object in a declarative fashion.
+ * The object that will perform input validation (which occurs after translation). The translate
+ * binding prefix is generally used to provide this object in a declarative fashion.
*/
@Parameter(defaultPrefix = "validate")
@SuppressWarnings("unchecked")
@@ -141,10 +141,10 @@
writeFieldTag(writer, value);
_validate.render(writer);
-
+
_resources.renderInformalParameters(writer);
- getValidationDecorator().insideField(this);
+ decorateInsideField();
}
/**
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Checkbox.java Sun Oct 21 09:23:51 2007
@@ -49,20 +49,17 @@
@BeginRender
void begin(MarkupWriter writer)
{
- writer.element(
- "input",
- "type",
- "checkbox",
- "name",
- getElementName(),
- "id",
- getClientId(),
- "checked",
- _value ? "checked" : null);
+ writer.element("input", "type", "checkbox",
+
+ "name", getElementName(),
+
+ "id", getClientId(),
+
+ "checked", _value ? "checked" : null);
_resources.renderInformalParameters(writer);
- getValidationDecorator().insideField(this);
+ decorateInsideField();
}
@AfterRender
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/DateField.java Sun Oct 21 09:23:51 2007
@@ -0,0 +1,304 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.corelib.components;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import org.apache.tapestry.Asset;
+import org.apache.tapestry.Binding;
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.FieldValidator;
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.PageRenderSupport;
+import org.apache.tapestry.ValidationTracker;
+import org.apache.tapestry.annotations.Environmental;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.Path;
+import org.apache.tapestry.corelib.base.AbstractField;
+import org.apache.tapestry.ioc.Messages;
+import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
+import org.apache.tapestry.ioc.internal.util.TapestryException;
+import org.apache.tapestry.json.JSONObject;
+import org.apache.tapestry.services.FieldValidatorDefaultSource;
+import org.apache.tapestry.services.FormSupport;
+import org.apache.tapestry.services.Request;
+
+/**
+ * A component used to collect a provided date from the user. This is a wrapper around the LGPL <a
+ * href="http://www.dynarch.com/projects/calendar/">dynarch.com DHTML/JavaScript Calendar</a>.
+ */
+// TODO: More testing; see https://issues.apache.org/jira/browse/TAPESTRY-1844
+public class DateField extends AbstractField
+{
+ /**
+ * The value parameter of a DateField must be a {@link Date}.
+ */
+ @Parameter(required = true, principal = true)
+ private Date _value;
+
+ @Parameter(defaultPrefix = "literal")
+ private String _format = "%m/%d/%y";
+
+ /**
+ * The object that will perform input validation (which occurs after translation). The translate
+ * binding prefix is generally used to provide this object in a declarative fashion.
+ */
+ @Parameter(defaultPrefix = "validate")
+ @SuppressWarnings("unchecked")
+ private FieldValidator<Object> _validate = NOOP_VALIDATOR;
+
+ // We will eventually make the skins & themes more configurable.
+
+ @Inject
+ @Path("${tapestry.jscalendar}/skins/aqua/theme.css")
+ private Asset _themeStylesheet;
+
+ // Would be nice to use the stripped version when in production mode. Have to define "production
+ // mode" first.
+ @Inject
+ @Path("${tapestry.jscalendar}/calendar.js")
+ private Asset _mainScript;
+
+ // Their naming convention isn't our naming convention, so we're locked to the english
+ // version regardless of the application's current locale.
+
+ @Inject
+ @Path("${tapestry.jscalendar}/lang/calendar-en.js")
+ private Asset _localizationScript;
+
+ @Inject
+ @Path("${tapestry.jscalendar}/calendar-setup.js")
+ private Asset _setupScript;
+
+ // TODO: Make this more configurable
+ @Inject
+ @Path("${tapestry.jscalendar}/img.gif")
+ private Asset _defaultIcon;
+
+ @Environmental
+ private PageRenderSupport _support;
+
+ @Environmental
+ private ValidationTracker _tracker;
+
+ @Inject
+ private ComponentResources _resources;
+
+ @Inject
+ private Messages _messages;
+
+ @Inject
+ private Request _request;
+
+ @Inject
+ private Locale _locale;
+
+ @Inject
+ private FieldValidatorDefaultSource _fieldValidatorDefaultSource;
+
+ /**
+ * The default value is a property of the container whose name matches the component's id. May
+ * return null if the container does not have a matching property.
+ */
+ final Binding defaultValue()
+ {
+ return createDefaultParameterBinding("value");
+ }
+
+ /**
+ * Computes a default value for the "validate" parameter using
+ * {@link FieldValidatorDefaultSource}.
+ */
+ final FieldValidator defaultValidate()
+ {
+
+ return _fieldValidatorDefaultSource.createDefaultValidator(
+ this,
+ _resources.getId(),
+ _resources.getContainerMessages(),
+ _locale,
+ Date.class,
+ _resources.getAnnotationProvider("value"));
+ }
+
+ void beginRender(MarkupWriter writer)
+ {
+ _support.addStylesheetLink(_themeStylesheet, null);
+ _support.addScriptLink(_mainScript, _localizationScript, _setupScript);
+
+ String value = _tracker.getInput(this);
+
+ if (value == null) value = formatCurrentValue();
+
+ String clientId = getClientId();
+ String triggerId = clientId + ":trigger";
+
+ // TODO: Support a disabled parameter
+
+ writer.element("input", "type", "text",
+
+ "name", getElementName(),
+
+ "id", clientId,
+
+ "value", value);
+
+ _validate.render(writer);
+
+ _resources.renderInformalParameters(writer);
+
+ decorateInsideField();
+
+ writer.end();
+
+ // Now the trigger icon.
+
+ writer.element("button",
+
+ "class", "t-calendar-trigger",
+
+ "id", triggerId);
+
+ writer.element("img",
+
+ "src", _defaultIcon.toClientURL(),
+
+ "alt", "[Show]");
+ writer.end(); // img
+ writer.end(); // button
+
+ // The setup parameters passed to Calendar.setup():
+
+ JSONObject setup = new JSONObject();
+
+ setup.put("inputField", clientId);
+ setup.put("ifFormat", _format);
+ setup.put("button", triggerId);
+
+ // Let subclasses do more.
+
+ configure(setup);
+
+ // TODO: protected method to let subclasses provide more setup.
+
+ _support.addScript("Calendar.setup(%s);", setup);
+ }
+
+ /**
+ * Invoked to allow subclasses to further configure the parameters passed to the JavaScript
+ * Calendar.setup() function. The values inputField, ifFormat and button are pre-configured.
+ * Subclasses may override this method to configure additional features of the client-side
+ * Calendar. This implementation does nothing.
+ *
+ * @param setup
+ * parameters object
+ */
+ protected void configure(JSONObject setup)
+ {
+
+ }
+
+ String formatCurrentValue()
+ {
+ if (_value == null) return "";
+
+ return toJavaDateFormat().format(_value);
+ }
+
+ @Override
+ protected void processSubmission(FormSupport formSupport, String elementName)
+ {
+ // TODO: Validation
+
+ String value = _request.getParameter(elementName);
+
+ if (InternalUtils.isBlank(value))
+ {
+ _value = null;
+ return;
+ }
+
+ try
+ {
+ _value = toJavaDateFormat().parse(value);
+
+ }
+ catch (ParseException ex)
+ {
+ _tracker.recordError(this, "Date value is not parseable.");
+ }
+
+ }
+
+ SimpleDateFormat toJavaDateFormat()
+ {
+ String format = _format;
+
+ StringBuilder builder = new StringBuilder();
+
+ int startx = 0;
+
+ while (true)
+ {
+ int nextx = format.indexOf('%', startx);
+
+ if (nextx < 0)
+ {
+ builder.append(format.substring(startx));
+ break;
+ }
+
+ builder.append(format.subSequence(startx, nextx));
+
+ char ch = format.charAt(nextx + 1);
+
+ String prefix = Character.isUpperCase(ch) ? "sym-up" : "sym-";
+
+ String key = prefix + ch;
+
+ if (!_messages.contains(key))
+ {
+ String message = _messages.format("unknown-symbol", ch, format);
+
+ throw new TapestryException(message, _resources.getLocation(), null);
+ }
+
+ builder.append(_messages.get(key));
+
+ startx = nextx + 2;
+ }
+
+ return new SimpleDateFormat(builder.toString());
+ }
+
+ void injectResources(ComponentResources resources)
+ {
+ _resources = resources;
+ }
+
+ void injectMessages(Messages messages)
+ {
+ _messages = messages;
+ }
+
+ void injectFormat(String format)
+ {
+ _format = format;
+ }
+}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.java Sun Oct 21 09:23:51 2007
@@ -14,8 +14,12 @@
package org.apache.tapestry.corelib.pages;
+import java.text.DateFormat;
+import java.util.Locale;
+
import org.apache.tapestry.annotations.Environmental;
import org.apache.tapestry.internal.TapestryInternalUtils;
+import org.apache.tapestry.ioc.annotations.Inject;
import org.apache.tapestry.services.PropertyOutputContext;
public class PropertyDisplayBlocks
@@ -23,6 +27,11 @@
@Environmental
private PropertyOutputContext _context;
+ @Inject
+ private Locale _locale;
+
+ private final DateFormat _dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, _locale);
+
public String getConvertedEnumValue()
{
Enum value = (Enum) _context.getPropertyValue();
@@ -30,5 +39,15 @@
if (value == null) return null;
return TapestryInternalUtils.getLabelForEnum(_context.getMessages(), value);
+ }
+
+ public DateFormat getDateFormat()
+ {
+ return _dateFormat;
+ }
+
+ public PropertyOutputContext getContext()
+ {
+ return _context;
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/pages/PropertyEditBlocks.java Sun Oct 21 09:23:51 2007
@@ -21,6 +21,7 @@
import org.apache.tapestry.annotations.Environmental;
import org.apache.tapestry.corelib.components.BeanEditForm;
import org.apache.tapestry.corelib.components.Checkbox;
+import org.apache.tapestry.corelib.components.DateField;
import org.apache.tapestry.corelib.components.Select;
import org.apache.tapestry.corelib.components.TextField;
import org.apache.tapestry.services.BeanBlockContribution;
@@ -58,6 +59,12 @@
{ "value=context.propertyValue", "label=prop:context.label", "clientId=prop:context.propertyId" })
private Checkbox _checkboxField;
+ @SuppressWarnings("unused")
+ @Component(parameters =
+ { "value=context.propertyValue", "label=prop:context.label",
+ "clientId=prop:context.propertyid", "validate=prop:dateFieldValidator" })
+ private DateField _dateField;
+
public PropertyEditContext getContext()
{
return _context;
@@ -66,6 +73,11 @@
public FieldValidator getTextFieldValidator()
{
return _context.getValidator(_textField);
+ }
+
+ public FieldValidator getDateFieldValidator()
+ {
+ return _context.getValidator(_dateField);
}
public FieldValidator getSelectValidator()
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridDataSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridDataSource.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridDataSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/grid/GridDataSource.java Sun Oct 21 09:23:51 2007
@@ -14,6 +14,7 @@
package org.apache.tapestry.grid;
+import org.apache.tapestry.beaneditor.BeanModel;
import org.apache.tapestry.beaneditor.PropertyModel;
import org.apache.tapestry.corelib.components.Form;
import org.apache.tapestry.corelib.components.Grid;
@@ -53,7 +54,7 @@
/**
* Returns the type of value in the rows, or null if not known. This value is used to create a
- * default {@link GridDataModel} when no such model is provided.
+ * default {@link BeanModel} when no such model is explicitly provided.
*
* @return the row type, or null
*/
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ClasspathAssetAliasManagerImpl.java Sun Oct 21 09:23:51 2007
@@ -31,7 +31,7 @@
private final Request _request;
/** Map from alias to path. */
- private final Map<String, String> _aliasToPathPrefix;
+ private final Map<String, String> _aliasToPathPrefix = newMap();
/** Map from path to alias. */
private final Map<String, String> _pathPrefixToAlias = newMap();
@@ -41,20 +41,23 @@
private final List<String> _sortedPathPrefixes;
/**
- * Configuration is a map of aliases (short names) to complete names. Keys and values should not
- * start with a slash, but should end with one. Example: "tapestry/" --> "org/apache/tapestry/".
+ * Configuration is a map of aliases (short names) to complete names. Keys and values should end
+ * with a slash, but one will be provided as necessary, so don't both.
*/
public ClasspathAssetAliasManagerImpl(Request request,
- final Map<String, String> configuration)
+ Map<String, String> configuration)
{
_request = request;
- _aliasToPathPrefix = configuration;
-
- for (Map.Entry<String, String> e : _aliasToPathPrefix.entrySet())
+ for (Map.Entry<String, String> e : configuration.entrySet())
{
- _pathPrefixToAlias.put(e.getValue(), e.getKey());
+ String alias = withSlash(e.getKey());
+ String path = withSlash(e.getValue());
+
+ _aliasToPathPrefix.put(alias, path);
+ _pathPrefixToAlias.put(path, alias);
+
}
Comparator<String> sortDescendingByLength = new Comparator<String>()
@@ -70,6 +73,13 @@
_sortedPathPrefixes = newList(_aliasToPathPrefix.values());
Collections.sort(_sortedPathPrefixes, sortDescendingByLength);
+ }
+
+ private String withSlash(String input)
+ {
+ if (input.endsWith("/")) return input;
+
+ return input + "/";
}
public String toClientURL(String resourcePath)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/InternalModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/InternalModule.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/InternalModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/InternalModule.java Sun Oct 21 09:23:51 2007
@@ -66,6 +66,7 @@
import org.apache.tapestry.services.RequestFilter;
import org.apache.tapestry.services.RequestGlobals;
import org.apache.tapestry.services.ResourceDigestGenerator;
+import org.apache.tapestry.services.TapestryModule;
import org.slf4j.Logger;
public final class InternalModule
@@ -93,10 +94,12 @@
{
Class c = InternalModule.class;
config.add("-//W3C//DTD XHTML 1.0 Strict//EN", c.getResource("xhtml1-strict.dtd"));
- config.add("-//W3C//DTD XHTML 1.0 Transitional//EN", c.getResource("xhtml1-transitional.dtd"));
+ config.add("-//W3C//DTD XHTML 1.0 Transitional//EN", c
+ .getResource("xhtml1-transitional.dtd"));
config.add("-//W3C//DTD XHTML 1.0 Frameset//EN", c.getResource("xhtml1-frameset.dtd"));
config.add("-//W3C//DTD HTML 4.01//EN", c.getResource("xhtml1-strict.dtd"));
- config.add("-//W3C//DTD HTML 4.01 Transitional//EN", c.getResource("xhtml1-transitional.dtd"));
+ config.add("-//W3C//DTD HTML 4.01 Transitional//EN", c
+ .getResource("xhtml1-transitional.dtd"));
config.add("-//W3C//DTD HTML 4.01 Frameset//EN", c.getResource("xhtml1-frameset.dtd"));
config.add("-//W3C//ENTITIES Latin 1 for XHTML//EN", c.getResource("xhtml-lat1.ent"));
config.add("-//W3C//ENTITIES Symbols for XHTML//EN", c.getResource("xhtml-symbol.ent"));
@@ -105,6 +108,8 @@
/**
* Contributes factory defaults that map be overridden.
+ *
+ * @see TapestryModule#contributeClasspathAssetAliasManager(MappedConfiguration, String, String)
*/
public static void contributeFactoryDefaults(MappedConfiguration<String, String> configuration)
{
@@ -113,7 +118,10 @@
configuration.add("tapestry.file-check-interval", "1000"); // 1 second
configuration.add("tapestry.file-check-update-timeout", "50"); // 50 milliseconds
+
+ // This should be overridden for particular applications.
configuration.add("tapestry.supported-locales", "en");
+
configuration.add("tapestry.default-cookie-max-age", "604800"); // One week
configuration.add("tapestry.start-page-name", "start");
@@ -128,6 +136,11 @@
configuration.add(
"tapestry.scriptaculous.path",
"org/apache/tapestry/scriptaculous_1_7_1_beta_3");
+
+ // Likewise for jscalendar, currently version 1.0
+
+ configuration.add("tapestry.jscalendar.path", "org/apache/tapestry/jscalendar-1.0");
+ configuration.add("tapestry.jscalendar", "classpath:${tapestry.jscalendar.path}");
}
private final ComponentInstantiatorSource _componentInstantiatorSource;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java Sun Oct 21 09:23:51 2007
@@ -17,6 +17,7 @@
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.util.Collection;
+import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -343,11 +344,16 @@
// @Inject not needed, because this isn't a service builder method
@Symbol("tapestry.scriptaculous.path")
- String scriptaculousPath)
+ String scriptaculousPath,
+
+ @Symbol("tapestry.jscalendar.path")
+ String jscalendarPath)
{
- configuration.add("tapestry/", "org/apache/tapestry/");
+ configuration.add("tapestry", "org/apache/tapestry");
+
+ configuration.add("scriptaculous", scriptaculousPath);
- configuration.add("scriptaculous/", scriptaculousPath + "/");
+ configuration.add("jscalendar", jscalendarPath);
}
public static void contributeComponentClassResolver(Configuration<LibraryMapping> configuration)
@@ -506,6 +512,7 @@
* <li>Number --> text
* <li>Enum --> enum
* <li>Boolean --> checkbox
+ * <li>Date --> date
* </ul>
*/
public static void contributeDefaultDataTypeAnalyzer(
@@ -524,6 +531,7 @@
configuration.add(Number.class, "text");
configuration.add(Enum.class, "enum");
configuration.add(Boolean.class, "checkbox");
+ configuration.add(Date.class, "date");
}
public static void contributeBeanBlockSource(Configuration<BeanBlockContribution> configuration)
@@ -531,8 +539,10 @@
addEditBlock(configuration, "text", "text");
addEditBlock(configuration, "enum", "enum");
addEditBlock(configuration, "checkbox", "checkbox");
+ addEditBlock(configuration, "date", "date");
addDisplayBlock(configuration, "enum", "enum");
+ addDisplayBlock(configuration, "date", "date");
}
private static void addEditBlock(Configuration<BeanBlockContribution> configuration,
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.properties?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.properties (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/DateField.properties Sun Oct 21 09:23:51 2007
@@ -0,0 +1,34 @@
+# Copyright 2007 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+sym-a=EEE
+sym-upa=EEEE
+sym-b=MMM
+sym-upb=MMMM
+sym-d=dd
+sym-e=d
+sym-uph=HH
+symp-upi=KK
+sym-j=DDD
+sym-k=HH
+sym-l-hh
+sym-m=MM
+sym-upm=mm
+sym-p=aa
+sym-ups=ss
+sym-y=yy
+sym-upy=yyyy
+
+unknown-symbol=Unknown or unsupported symbol '%%%s' (in format '%s').
+
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyDisplayBlocks.tml Sun Oct 21 09:23:51 2007
@@ -4,4 +4,8 @@
${convertedEnumValue}
</t:block>
+ <t:block id="date">
+ <t:output value="context.propertyValue" format="dateFormat"/>
+ </t:block>
+
</div>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/pages/PropertyEditBlocks.tml Sun Oct 21 09:23:51 2007
@@ -15,4 +15,9 @@
<input t:id="checkboxField"/>
</t:block>
+ <t:block id="date">
+ <t:label for="dateField"/>
+ <input t:id="dateField"/>
+ </t:block>
+
</div>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/default.css Sun Oct 21 09:23:51 2007
@@ -96,13 +96,15 @@
DIV.t-beaneditor, DIV.t-beandisplay {
display: block;
background: #ffc;
- border: 2px solid silver;
+ border: 2px outset brown;
padding: 2px;
font-family: "Trebuchet MS", Arial, sans-serif;
}
DIV.t-beandisplay {
- background: #c0c0c0;
+ background: #CCBE99;
+ border: 2px outset black;
+ width: auto;
}
FORM.t-beaneditor LABEL:after {
@@ -254,3 +256,9 @@
DIV.t-palette-spacer {
clear: left;
}
+
+BUTTON.t-calendar-trigger {
+ margin-left: 3px;
+ padding: none;
+}
+
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue.css?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue.css Sun Oct 21 09:23:51 2007
@@ -0,0 +1,232 @@
+/* The main calendar widget. DIV containing a table. */
+
+div.calendar { position: relative; }
+
+.calendar, .calendar table {
+ border: 1px solid #556;
+ font-size: 11px;
+ color: #000;
+ cursor: default;
+ background: #eef;
+ font-family: tahoma,verdana,sans-serif;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+ text-align: center; /* They are the navigation buttons */
+ padding: 2px; /* Make the buttons seem like they're pressing */
+}
+
+.calendar .nav {
+ background: #778 url(menuarrow.gif) no-repeat 100% 100%;
+}
+
+.calendar thead .title { /* This holds the current "month, year" */
+ font-weight: bold; /* Pressing it will take you to the current date */
+ text-align: center;
+ background: #fff;
+ color: #000;
+ padding: 2px;
+}
+
+.calendar thead .headrow { /* Row <TR> containing navigation buttons */
+ background: #778;
+ color: #fff;
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+ background: #bdf;
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+ border-bottom: 1px solid #556;
+ padding: 2px;
+ text-align: center;
+ color: #000;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+ color: #a66;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+ background-color: #aaf;
+ color: #000;
+ border: 1px solid #04f;
+ padding: 1px;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+ background-color: #77c;
+ padding: 2px 0px 0px 2px;
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+ width: 2em;
+ color: #456;
+ text-align: right;
+ padding: 2px 4px 2px 2px;
+}
+.calendar tbody .day.othermonth {
+ font-size: 80%;
+ color: #bbb;
+}
+.calendar tbody .day.othermonth.oweekend {
+ color: #fbb;
+}
+
+.calendar table .wn {
+ padding: 2px 3px 2px 2px;
+ border-right: 1px solid #000;
+ background: #bdf;
+}
+
+.calendar tbody .rowhilite td {
+ background: #def;
+}
+
+.calendar tbody .rowhilite td.wn {
+ background: #eef;
+}
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+ background: #def;
+ padding: 1px 3px 1px 1px;
+ border: 1px solid #bbb;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+ background: #cde;
+ padding: 2px 2px 0px 2px;
+}
+
+.calendar tbody td.selected { /* Cell showing today date */
+ font-weight: bold;
+ border: 1px solid #000;
+ padding: 1px 3px 1px 1px;
+ background: #fff;
+ color: #000;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+ color: #a66;
+}
+
+.calendar tbody td.today { /* Cell showing selected date */
+ font-weight: bold;
+ color: #00f;
+}
+
+.calendar tbody .disabled { color: #999; }
+
+.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
+ visibility: hidden;
+}
+
+.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
+ display: none;
+}
+
+/* The footer part -- status bar and "Close" button */
+
+.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
+ text-align: center;
+ background: #556;
+ color: #fff;
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+ background: #fff;
+ color: #445;
+ border-top: 1px solid #556;
+ padding: 1px;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+ background: #aaf;
+ border: 1px solid #04f;
+ color: #000;
+ padding: 1px;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+ background: #77c;
+ padding: 2px 0px 0px 2px;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.calendar .combo {
+ position: absolute;
+ display: none;
+ top: 0px;
+ left: 0px;
+ width: 4em;
+ cursor: default;
+ border: 1px solid #655;
+ background: #def;
+ color: #000;
+ font-size: 90%;
+ z-index: 100;
+}
+
+.calendar .combo .label,
+.calendar .combo .label-IEfix {
+ text-align: center;
+ padding: 1px;
+}
+
+.calendar .combo .label-IEfix {
+ width: 4em;
+}
+
+.calendar .combo .hilite {
+ background: #acf;
+}
+
+.calendar .combo .active {
+ border-top: 1px solid #46a;
+ border-bottom: 1px solid #46a;
+ background: #eef;
+ font-weight: bold;
+}
+
+.calendar td.time {
+ border-top: 1px solid #000;
+ padding: 1px 0px;
+ text-align: center;
+ background-color: #f4f0e8;
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute,
+.calendar td.time .ampm {
+ padding: 0px 3px 0px 4px;
+ border: 1px solid #889;
+ font-weight: bold;
+ background-color: #fff;
+}
+
+.calendar td.time .ampm {
+ text-align: center;
+}
+
+.calendar td.time .colon {
+ padding: 0px 2px 0px 3px;
+ font-weight: bold;
+}
+
+.calendar td.time span.hilite {
+ border-color: #000;
+ background-color: #667;
+ color: #fff;
+}
+
+.calendar td.time span.active {
+ border-color: #f00;
+ background-color: #000;
+ color: #0f0;
+}
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue2.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue2.css?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue2.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-blue2.css Sun Oct 21 09:23:51 2007
@@ -0,0 +1,236 @@
+/* The main calendar widget. DIV containing a table. */
+
+div.calendar { position: relative; }
+
+.calendar, .calendar table {
+ border: 1px solid #206A9B;
+ font-size: 11px;
+ color: #000;
+ cursor: default;
+ background: #F1F8FC;
+ font-family: tahoma,verdana,sans-serif;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+ text-align: center; /* They are the navigation buttons */
+ padding: 2px; /* Make the buttons seem like they're pressing */
+}
+
+.calendar .nav {
+ background: #007ED1 url(menuarrow2.gif) no-repeat 100% 100%;
+}
+
+.calendar thead .title { /* This holds the current "month, year" */
+ font-weight: bold; /* Pressing it will take you to the current date */
+ text-align: center;
+ background: #000;
+ color: #fff;
+ padding: 2px;
+}
+
+.calendar thead tr { /* Row <TR> containing navigation buttons */
+ background: #007ED1;
+ color: #fff;
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+ background: #C7E1F3;
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+ border-bottom: 1px solid #206A9B;
+ padding: 2px;
+ text-align: center;
+ color: #000;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+ color: #a66;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+ background-color: #34ABFA;
+ color: #000;
+ border: 1px solid #016DC5;
+ padding: 1px;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+ background-color: #006AA9;
+ border: 1px solid #008AFF;
+ padding: 2px 0px 0px 2px;
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+ width: 2em;
+ color: #456;
+ text-align: right;
+ padding: 2px 4px 2px 2px;
+}
+.calendar tbody .day.othermonth {
+ font-size: 80%;
+ color: #bbb;
+}
+.calendar tbody .day.othermonth.oweekend {
+ color: #fbb;
+}
+
+.calendar table .wn {
+ padding: 2px 3px 2px 2px;
+ border-right: 1px solid #000;
+ background: #C7E1F3;
+}
+
+.calendar tbody .rowhilite td {
+ background: #def;
+}
+
+.calendar tbody .rowhilite td.wn {
+ background: #F1F8FC;
+}
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+ background: #def;
+ padding: 1px 3px 1px 1px;
+ border: 1px solid #8FC4E8;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+ background: #cde;
+ padding: 2px 2px 0px 2px;
+}
+
+.calendar tbody td.selected { /* Cell showing today date */
+ font-weight: bold;
+ border: 1px solid #000;
+ padding: 1px 3px 1px 1px;
+ background: #fff;
+ color: #000;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+ color: #a66;
+}
+
+.calendar tbody td.today { /* Cell showing selected date */
+ font-weight: bold;
+ color: #D50000;
+}
+
+.calendar tbody .disabled { color: #999; }
+
+.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
+ visibility: hidden;
+}
+
+.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
+ display: none;
+}
+
+/* The footer part -- status bar and "Close" button */
+
+.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
+ text-align: center;
+ background: #206A9B;
+ color: #fff;
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+ background: #000;
+ color: #fff;
+ border-top: 1px solid #206A9B;
+ padding: 1px;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+ background: #B8DAF0;
+ border: 1px solid #178AEB;
+ color: #000;
+ padding: 1px;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+ background: #006AA9;
+ padding: 2px 0px 0px 2px;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.calendar .combo {
+ position: absolute;
+ display: none;
+ top: 0px;
+ left: 0px;
+ width: 4em;
+ cursor: default;
+ border: 1px solid #655;
+ background: #def;
+ color: #000;
+ font-size: 90%;
+ z-index: 100;
+}
+
+.calendar .combo .label,
+.calendar .combo .label-IEfix {
+ text-align: center;
+ padding: 1px;
+}
+
+.calendar .combo .label-IEfix {
+ width: 4em;
+}
+
+.calendar .combo .hilite {
+ background: #34ABFA;
+ border-top: 1px solid #46a;
+ border-bottom: 1px solid #46a;
+ font-weight: bold;
+}
+
+.calendar .combo .active {
+ border-top: 1px solid #46a;
+ border-bottom: 1px solid #46a;
+ background: #F1F8FC;
+ font-weight: bold;
+}
+
+.calendar td.time {
+ border-top: 1px solid #000;
+ padding: 1px 0px;
+ text-align: center;
+ background-color: #E3F0F9;
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute,
+.calendar td.time .ampm {
+ padding: 0px 3px 0px 4px;
+ border: 1px solid #889;
+ font-weight: bold;
+ background-color: #F1F8FC;
+}
+
+.calendar td.time .ampm {
+ text-align: center;
+}
+
+.calendar td.time .colon {
+ padding: 0px 2px 0px 3px;
+ font-weight: bold;
+}
+
+.calendar td.time span.hilite {
+ border-color: #000;
+ background-color: #267DB7;
+ color: #fff;
+}
+
+.calendar td.time span.active {
+ border-color: red;
+ background-color: #000;
+ color: #A5FF00;
+}
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-brown.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-brown.css?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-brown.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-brown.css Sun Oct 21 09:23:51 2007
@@ -0,0 +1,225 @@
+/* The main calendar widget. DIV containing a table. */
+
+div.calendar { position: relative; }
+
+.calendar, .calendar table {
+ border: 1px solid #655;
+ font-size: 11px;
+ color: #000;
+ cursor: default;
+ background: #ffd;
+ font-family: tahoma,verdana,sans-serif;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+ text-align: center; /* They are the navigation buttons */
+ padding: 2px; /* Make the buttons seem like they're pressing */
+}
+
+.calendar .nav {
+ background: #edc url(menuarrow.gif) no-repeat 100% 100%;
+}
+
+.calendar thead .title { /* This holds the current "month, year" */
+ font-weight: bold; /* Pressing it will take you to the current date */
+ text-align: center;
+ background: #654;
+ color: #fed;
+ padding: 2px;
+}
+
+.calendar thead .headrow { /* Row <TR> containing navigation buttons */
+ background: #edc;
+ color: #000;
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+ border-bottom: 1px solid #655;
+ padding: 2px;
+ text-align: center;
+ color: #000;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+ color: #f00;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+ background-color: #faa;
+ color: #000;
+ border: 1px solid #f40;
+ padding: 1px;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+ background-color: #c77;
+ padding: 2px 0px 0px 2px;
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+ background: #fed;
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+ width: 2em;
+ text-align: right;
+ padding: 2px 4px 2px 2px;
+}
+.calendar tbody .day.othermonth {
+ font-size: 80%;
+ color: #bbb;
+}
+.calendar tbody .day.othermonth.oweekend {
+ color: #fbb;
+}
+
+.calendar table .wn {
+ padding: 2px 3px 2px 2px;
+ border-right: 1px solid #000;
+ background: #fed;
+}
+
+.calendar tbody .rowhilite td {
+ background: #ddf;
+}
+
+.calendar tbody .rowhilite td.wn {
+ background: #efe;
+}
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+ background: #ffe;
+ padding: 1px 3px 1px 1px;
+ border: 1px solid #bbb;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+ background: #ddc;
+ padding: 2px 2px 0px 2px;
+}
+
+.calendar tbody td.selected { /* Cell showing today date */
+ font-weight: bold;
+ border: 1px solid #000;
+ padding: 1px 3px 1px 1px;
+ background: #fea;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+ color: #f00;
+}
+
+.calendar tbody td.today { font-weight: bold; }
+
+.calendar tbody .disabled { color: #999; }
+
+.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
+ visibility: hidden;
+}
+
+.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
+ display: none;
+}
+
+/* The footer part -- status bar and "Close" button */
+
+.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
+ text-align: center;
+ background: #988;
+ color: #000;
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+ border-top: 1px solid #655;
+ background: #dcb;
+ color: #840;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+ background: #faa;
+ border: 1px solid #f40;
+ padding: 1px;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+ background: #c77;
+ padding: 2px 0px 0px 2px;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.calendar .combo {
+ position: absolute;
+ display: none;
+ top: 0px;
+ left: 0px;
+ width: 4em;
+ cursor: default;
+ border: 1px solid #655;
+ background: #ffe;
+ color: #000;
+ font-size: 90%;
+ z-index: 100;
+}
+
+.calendar .combo .label,
+.calendar .combo .label-IEfix {
+ text-align: center;
+ padding: 1px;
+}
+
+.calendar .combo .label-IEfix {
+ width: 4em;
+}
+
+.calendar .combo .hilite {
+ background: #fc8;
+}
+
+.calendar .combo .active {
+ border-top: 1px solid #a64;
+ border-bottom: 1px solid #a64;
+ background: #fee;
+ font-weight: bold;
+}
+
+.calendar td.time {
+ border-top: 1px solid #a88;
+ padding: 1px 0px;
+ text-align: center;
+ background-color: #fed;
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute,
+.calendar td.time .ampm {
+ padding: 0px 3px 0px 4px;
+ border: 1px solid #988;
+ font-weight: bold;
+ background-color: #fff;
+}
+
+.calendar td.time .ampm {
+ text-align: center;
+}
+
+.calendar td.time .colon {
+ padding: 0px 2px 0px 3px;
+ font-weight: bold;
+}
+
+.calendar td.time span.hilite {
+ border-color: #000;
+ background-color: #866;
+ color: #fff;
+}
+
+.calendar td.time span.active {
+ border-color: #f00;
+ background-color: #000;
+ color: #0f0;
+}
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-green.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-green.css?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-green.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-green.css Sun Oct 21 09:23:51 2007
@@ -0,0 +1,229 @@
+/* The main calendar widget. DIV containing a table. */
+
+div.calendar { position: relative; }
+
+.calendar, .calendar table {
+ border: 1px solid #565;
+ font-size: 11px;
+ color: #000;
+ cursor: default;
+ background: #efe;
+ font-family: tahoma,verdana,sans-serif;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+ text-align: center; /* They are the navigation buttons */
+ padding: 2px; /* Make the buttons seem like they're pressing */
+ background: #676;
+ color: #fff;
+ font-size: 90%;
+}
+
+.calendar .nav {
+ background: #676 url(menuarrow.gif) no-repeat 100% 100%;
+}
+
+.calendar thead .title { /* This holds the current "month, year" */
+ font-weight: bold; /* Pressing it will take you to the current date */
+ text-align: center;
+ padding: 2px;
+ background: #250;
+ color: #efa;
+}
+
+.calendar thead .headrow { /* Row <TR> containing navigation buttons */
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+ border-bottom: 1px solid #565;
+ padding: 2px;
+ text-align: center;
+ color: #000;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+ color: #a66;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+ background-color: #afa;
+ color: #000;
+ border: 1px solid #084;
+ padding: 1px;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+ background-color: #7c7;
+ padding: 2px 0px 0px 2px;
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+ background: #dfb;
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+ width: 2em;
+ color: #564;
+ text-align: right;
+ padding: 2px 4px 2px 2px;
+}
+.calendar tbody .day.othermonth {
+ font-size: 80%;
+ color: #bbb;
+}
+.calendar tbody .day.othermonth.oweekend {
+ color: #fbb;
+}
+
+.calendar table .wn {
+ padding: 2px 3px 2px 2px;
+ border-right: 1px solid #8a8;
+ background: #dfb;
+}
+
+.calendar tbody .rowhilite td {
+ background: #dfd;
+}
+
+.calendar tbody .rowhilite td.wn {
+ background: #efe;
+}
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+ background: #efd;
+ padding: 1px 3px 1px 1px;
+ border: 1px solid #bbb;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+ background: #dec;
+ padding: 2px 2px 0px 2px;
+}
+
+.calendar tbody td.selected { /* Cell showing today date */
+ font-weight: bold;
+ border: 1px solid #000;
+ padding: 1px 3px 1px 1px;
+ background: #f8fff8;
+ color: #000;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+ color: #a66;
+}
+
+.calendar tbody td.today { font-weight: bold; color: #0a0; }
+
+.calendar tbody .disabled { color: #999; }
+
+.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
+ visibility: hidden;
+}
+
+.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
+ display: none;
+}
+
+/* The footer part -- status bar and "Close" button */
+
+.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
+ text-align: center;
+ background: #565;
+ color: #fff;
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+ padding: 2px;
+ background: #250;
+ color: #efa;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+ background: #afa;
+ border: 1px solid #084;
+ color: #000;
+ padding: 1px;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+ background: #7c7;
+ padding: 2px 0px 0px 2px;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.calendar .combo {
+ position: absolute;
+ display: none;
+ top: 0px;
+ left: 0px;
+ width: 4em;
+ cursor: default;
+ border: 1px solid #565;
+ background: #efd;
+ color: #000;
+ font-size: 90%;
+ z-index: 100;
+}
+
+.calendar .combo .label,
+.calendar .combo .label-IEfix {
+ text-align: center;
+ padding: 1px;
+}
+
+.calendar .combo .label-IEfix {
+ width: 4em;
+}
+
+.calendar .combo .hilite {
+ background: #af8;
+}
+
+.calendar .combo .active {
+ border-top: 1px solid #6a4;
+ border-bottom: 1px solid #6a4;
+ background: #efe;
+ font-weight: bold;
+}
+
+.calendar td.time {
+ border-top: 1px solid #8a8;
+ padding: 1px 0px;
+ text-align: center;
+ background-color: #dfb;
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute,
+.calendar td.time .ampm {
+ padding: 0px 3px 0px 4px;
+ border: 1px solid #898;
+ font-weight: bold;
+ background-color: #fff;
+}
+
+.calendar td.time .ampm {
+ text-align: center;
+}
+
+.calendar td.time .colon {
+ padding: 0px 2px 0px 3px;
+ font-weight: bold;
+}
+
+.calendar td.time span.hilite {
+ border-color: #000;
+ background-color: #686;
+ color: #fff;
+}
+
+.calendar td.time span.active {
+ border-color: #f00;
+ background-color: #000;
+ color: #0f0;
+}
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup.js?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup.js (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup.js Sun Oct 21 09:23:51 2007
@@ -0,0 +1,200 @@
+/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
+ * ---------------------------------------------------------------------------
+ *
+ * The DHTML Calendar
+ *
+ * Details and latest version at:
+ * http://dynarch.com/mishoo/calendar.epl
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ *
+ * This file defines helper functions for setting up the calendar. They are
+ * intended to help non-programmers get a working calendar on their site
+ * quickly. This script should not be seen as part of the calendar. It just
+ * shows you what one can do with the calendar, while in the same time
+ * providing a quick and simple method for setting it up. If you need
+ * exhaustive customization of the calendar creation process feel free to
+ * modify this code to suit your needs (this is recommended and much better
+ * than modifying calendar.js itself).
+ */
+
+// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $
+
+/**
+ * This function "patches" an input field (or other element) to use a calendar
+ * widget for date selection.
+ *
+ * The "params" is a single object that can have the following properties:
+ *
+ * prop. name | description
+ * -------------------------------------------------------------------------------------------------
+ * inputField | the ID of an input field to store the date
+ * displayArea | the ID of a DIV or other element to show the date
+ * button | ID of a button or other element that will trigger the calendar
+ * eventName | event that will trigger the calendar, without the "on" prefix (default: "click")
+ * ifFormat | date format that will be stored in the input field
+ * daFormat | the date format that will be used to display the date in displayArea
+ * singleClick | (true/false) wether the calendar is in single click mode or not (default: true)
+ * firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc.
+ * align | alignment (default: "Br"); if you don't know what's this see the calendar documentation
+ * range | array with 2 elements. Default: [1900, 2999] -- the range of years available
+ * weekNumbers | (true/false) if it's true (default) the calendar will display week numbers
+ * flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
+ * flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
+ * disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
+ * onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay)
+ * onClose | function that gets called when the calendar is closed. [default]
+ * onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar.
+ * date | the date that the calendar will be initially displayed to
+ * showsTime | default: false; if true the calendar will include a time selector
+ * timeFormat | the time format; can be "12" or "24", default is "12"
+ * electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
+ * step | configures the step of the years in drop-down boxes; default: 2
+ * position | configures the calendar absolute position; default: null
+ * cache | if "true" (but default: "false") it will reuse the same calendar object, where possible
+ * showOthers | if "true" (but default: "false") it will show days from other months too
+ *
+ * None of them is required, they all have default values. However, if you
+ * pass none of "inputField", "displayArea" or "button" you'll get a warning
+ * saying "nothing to setup".
+ */
+Calendar.setup = function (params) {
+ function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
+
+ param_default("inputField", null);
+ param_default("displayArea", null);
+ param_default("button", null);
+ param_default("eventName", "click");
+ param_default("ifFormat", "%Y/%m/%d");
+ param_default("daFormat", "%Y/%m/%d");
+ param_default("singleClick", true);
+ param_default("disableFunc", null);
+ param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined
+ param_default("dateText", null);
+ param_default("firstDay", null);
+ param_default("align", "Br");
+ param_default("range", [1900, 2999]);
+ param_default("weekNumbers", true);
+ param_default("flat", null);
+ param_default("flatCallback", null);
+ param_default("onSelect", null);
+ param_default("onClose", null);
+ param_default("onUpdate", null);
+ param_default("date", null);
+ param_default("showsTime", false);
+ param_default("timeFormat", "24");
+ param_default("electric", true);
+ param_default("step", 2);
+ param_default("position", null);
+ param_default("cache", false);
+ param_default("showOthers", false);
+ param_default("multiple", null);
+
+ var tmp = ["inputField", "displayArea", "button"];
+ for (var i in tmp) {
+ if (typeof params[tmp[i]] == "string") {
+ params[tmp[i]] = document.getElementById(params[tmp[i]]);
+ }
+ }
+ if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) {
+ alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");
+ return false;
+ }
+
+ function onSelect(cal) {
+ var p = cal.params;
+ var update = (cal.dateClicked || p.electric);
+ if (update && p.inputField) {
+ p.inputField.value = cal.date.print(p.ifFormat);
+ if (typeof p.inputField.onchange == "function")
+ p.inputField.onchange();
+ }
+ if (update && p.displayArea)
+ p.displayArea.innerHTML = cal.date.print(p.daFormat);
+ if (update && typeof p.onUpdate == "function")
+ p.onUpdate(cal);
+ if (update && p.flat) {
+ if (typeof p.flatCallback == "function")
+ p.flatCallback(cal);
+ }
+ if (update && p.singleClick && cal.dateClicked)
+ cal.callCloseHandler();
+ };
+
+ if (params.flat != null) {
+ if (typeof params.flat == "string")
+ params.flat = document.getElementById(params.flat);
+ if (!params.flat) {
+ alert("Calendar.setup:\n Flat specified but can't find parent.");
+ return false;
+ }
+ var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
+ cal.showsOtherMonths = params.showOthers;
+ cal.showsTime = params.showsTime;
+ cal.time24 = (params.timeFormat == "24");
+ cal.params = params;
+ cal.weekNumbers = params.weekNumbers;
+ cal.setRange(params.range[0], params.range[1]);
+ cal.setDateStatusHandler(params.dateStatusFunc);
+ cal.getDateText = params.dateText;
+ if (params.ifFormat) {
+ cal.setDateFormat(params.ifFormat);
+ }
+ if (params.inputField && typeof params.inputField.value == "string") {
+ cal.parseDate(params.inputField.value);
+ }
+ cal.create(params.flat);
+ cal.show();
+ return false;
+ }
+
+ var triggerEl = params.button || params.displayArea || params.inputField;
+ triggerEl["on" + params.eventName] = function() {
+ var dateEl = params.inputField || params.displayArea;
+ var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
+ var mustCreate = false;
+ var cal = window.calendar;
+ if (dateEl)
+ params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt);
+ if (!(cal && params.cache)) {
+ window.calendar = cal = new Calendar(params.firstDay,
+ params.date,
+ params.onSelect || onSelect,
+ params.onClose || function(cal) { cal.hide(); });
+ cal.showsTime = params.showsTime;
+ cal.time24 = (params.timeFormat == "24");
+ cal.weekNumbers = params.weekNumbers;
+ mustCreate = true;
+ } else {
+ if (params.date)
+ cal.setDate(params.date);
+ cal.hide();
+ }
+ if (params.multiple) {
+ cal.multiple = {};
+ for (var i = params.multiple.length; --i >= 0;) {
+ var d = params.multiple[i];
+ var ds = d.print("%Y%m%d");
+ cal.multiple[ds] = d;
+ }
+ }
+ cal.showsOtherMonths = params.showOthers;
+ cal.yearStep = params.step;
+ cal.setRange(params.range[0], params.range[1]);
+ cal.params = params;
+ cal.setDateStatusHandler(params.dateStatusFunc);
+ cal.getDateText = params.dateText;
+ cal.setDateFormat(dateFmt);
+ if (mustCreate)
+ cal.create();
+ cal.refresh();
+ if (!params.position)
+ cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
+ else
+ cal.showAt(params.position[0], params.position[1]);
+ return false;
+ };
+
+ return cal;
+};
Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup_stripped.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup_stripped.js?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup_stripped.js (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/calendar-setup_stripped.js Sun Oct 21 09:23:51 2007
@@ -0,0 +1,21 @@
+/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
+ * ---------------------------------------------------------------------------
+ *
+ * The DHTML Calendar
+ *
+ * Details and latest version at:
+ * http://dynarch.com/mishoo/calendar.epl
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ *
+ * This file defines helper functions for setting up the calendar. They are
+ * intended to help non-programmers get a working calendar on their site
+ * quickly. This script should not be seen as part of the calendar. It just
+ * shows you what one can do with the calendar, while in the same time
+ * providing a quick and simple method for setting it up. If you need
+ * exhaustive customization of the calendar creation process feel free to
+ * modify this code to suit your needs (this is recommended and much better
+ * than modifying calendar.js itself).
+ */
+ Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("
showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(pa
rams.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl
.value||dateEl.innerHTML,dateFmt);if(!(cal&¶ms.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};
\ No newline at end of file