cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r1086733 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources: forms-calendar-styling.xsl js/DropdownDateTimePicker.js
Date Tue, 29 Mar 2011 20:45:13 GMT
Author: antonio
Date: Tue Mar 29 20:45:13 2011
New Revision: 1086733

URL: http://svn.apache.org/viewvc?rev=1086733&view=rev
Log:
In DropdownDateTimePicker dojo widget rename internal pattern attribute to cPattern. Attribute
pattern is part of HTML5 specification for input element. See: http://dev.w3.org/html5/spec/Overview.html#the-pattern-attribute

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl?rev=1086733&r1=1086732&r2=1086733&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
Tue Mar 29 20:45:13 2011
@@ -62,7 +62,7 @@
         </xsl:when>
         <xsl:otherwise>
         <!-- regular input -->
-	      <input id="{@id}:input" name="{@id}" value="{fi:value}" title="{normalize-space(fi:hint)}"
type="text" dojoType="forms:dropdownDateTimePicker" pattern="{$format}" variant="{$variant}">
+	      <input id="{@id}:input" name="{@id}" value="{fi:value}" title="{normalize-space(fi:hint)}"
type="text" dojoType="forms:dropdownDateTimePicker" cPattern="{$format}" variant="{$variant}">
 	        <xsl:apply-templates select="." mode="styling"/>
 	      </input>
         <!-- common stuff -->

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js?rev=1086733&r1=1086732&r2=1086733&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js
Tue Mar 29 20:45:13 2011
@@ -32,7 +32,7 @@ dojo.widget.defineWidget("cocoon.forms.D
     {
         variant: "date", /* date, time or datetime */
 
-        pattern: "yyyy-MM-dd",
+        cPattern: "yyyy-MM-dd",
 
         showInputSample: "false", /* should a sample date entry be shown next to the input
field? */
 
@@ -224,11 +224,11 @@ dojo.widget.defineWidget("cocoon.forms.D
 
             if (this.variant == "date") {
                 // pure date mode, assume pattern is only for dates
-                this.datePattern = this.pattern;
+                this.datePattern = this.cPattern;
                 return;
             } else if (this.variant == "time") {
                 // pure time mode, assume patter is only for times
-                this.timePattern = this.pattern;
+                this.timePattern = this.cPattern;
                 return;
             }
 
@@ -236,27 +236,27 @@ dojo.widget.defineWidget("cocoon.forms.D
             // http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns
             var timeFormattingChars = ["a", "h", "H", "K", "k", "m", "s", "S", "A", "z",
"Z"];
 
-            var pattern = this.pattern;
-            if (pattern == null || pattern == "")
+            var cPattern = this.cPattern;
+            if (cPattern == null || cPattern == "")
                 return;
 
-            // search position of first time pattern character
+            // search position of first time cPattern character
             var beginTimePattern = -1;
-            for (var i = 0; i < pattern.length; i++) {
-                var c = pattern.charAt(i);
+            for (var i = 0; i < cPattern.length; i++) {
+                var c = cPattern.charAt(i);
                 if (dojo.lang.inArray(timeFormattingChars, c)) {
                     beginTimePattern = i;
                     break;
                 }
             }
 
-            // split pattern in date and time component
+            // split cPattern in date and time component
             if (beginTimePattern == -1) {
-                // pure date pattern
-                this.datePattern = pattern;
+                // pure date cPattern
+                this.datePattern = cPattern;
             } else {
-                this.datePattern = dojo.string.trimEnd(pattern.substr(0, beginTimePattern));
-                this.timePattern = pattern.substr(beginTimePattern, pattern.length);
+                this.datePattern = dojo.string.trimEnd(cPattern.substr(0, beginTimePattern));
+                this.timePattern = cPattern.substr(beginTimePattern, cPattern.length);
             }
         },
 



Mime
View raw message