click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r956345 - in /click/trunk/click: examples/webapp/assets/js/ extras/src/org/apache/click/extras/control/ framework/src/META-INF/resources/click/ framework/src/org/apache/click/element/
Date Sun, 20 Jun 2010 11:07:55 GMT
Author: sabob
Date: Sun Jun 20 11:07:55 2010
New Revision: 956345

URL: http://svn.apache.org/viewvc?rev=956345&view=rev
Log:
moved addLoadEvent under Click namespace

Modified:
    click/trunk/click/examples/webapp/assets/js/imports.js
    click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
    click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java
    click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
    click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
    click/trunk/click/framework/src/META-INF/resources/click/control.js
    click/trunk/click/framework/src/org/apache/click/element/JsScript.java

Modified: click/trunk/click/examples/webapp/assets/js/imports.js
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/webapp/assets/js/imports.js?rev=956345&r1=956344&r2=956345&view=diff
==============================================================================
--- click/trunk/click/examples/webapp/assets/js/imports.js (original)
+++ click/trunk/click/examples/webapp/assets/js/imports.js Sun Jun 20 11:07:55 2010
@@ -102,7 +102,7 @@ Click.domready = {
  *    });
  *
  */
-addLoadEvent = function(func) {
+Click.addLoadEvent = function(func) {
     // If dom is ready, fire event and return
     if (Click.domready.ready) {
         return func();

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java?rev=956345&r1=956344&r2=956345&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
(original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
Sun Jun 20 11:07:55 2010
@@ -298,8 +298,6 @@ public abstract class AutoCompleteTextFi
                 versionIndicator));
         }
 
-        // Note the addLoadEvent script is recreated and checked if it
-        // is contained in the headElement.
         String fieldId = getId();
         JsScript script = new JsScript();
         script.setId(fieldId + "_autocomplete");

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java?rev=956345&r1=956344&r2=956345&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java Sun Jun 20
11:07:55 2010
@@ -680,8 +680,6 @@ public class CheckList extends Field {
             }
         }
 
-        // Note, the addLoadEvent script is recreated and checked if it
-        // is contained in the headElement.
         String checkListId = getId();
         JsScript script = new JsScript();
         script.setId(checkListId + "_js_setup");

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java?rev=956345&r1=956344&r2=956345&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java Sun Jun 20
11:07:55 2010
@@ -868,7 +868,7 @@ public class DateField extends TextField
      * The default option script will render as (depending on the values):
      *
      * <pre class="prettyprint">
-     * addLoadEvent(function() {
+     * Click.addLoadEvent(function() {
      *   Event.observe('my-calendar-button', 'click', function(){
      *     Date.first_day_of_week=0;
      *     calendar = new CalendarDateSelect($('my-calendar'), {

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java?rev=956345&r1=956344&r2=956345&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java Sun Jun 20 11:07:55
2010
@@ -1060,8 +1060,6 @@ public class Menu extends AbstractContro
             headElements.add(jsImport);
         }
 
-        // Note, the addLoadEvent script is recreated and checked if it
-        // is contained in the headElement.
         JsScript script = new JsScript();
         script.setId(id + "_js_setup");
         if (!headElements.contains(script)) {

Modified: click/trunk/click/framework/src/META-INF/resources/click/control.js
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/META-INF/resources/click/control.js?rev=956345&r1=956344&r2=956345&view=diff
==============================================================================
--- click/trunk/click/framework/src/META-INF/resources/click/control.js (original)
+++ click/trunk/click/framework/src/META-INF/resources/click/control.js Sun Jun 20 11:07:55
2010
@@ -96,21 +96,21 @@ if ( typeof Click.domready == 'undefined
 })();
 
 /**
- * Usage: Call addLoadEvent passing in a function to invoke when the DOM is
+ * Usage: Call Click.addLoadEvent passing in a function to invoke when the DOM is
  * ready:
  *
  *    Example 1:
  *    function something() {
  *       // do something
  *    }
- *    addLoadEvent(something);
+ *    Click.addLoadEvent(something);
  *
  *    Example 2:
- *    addLoadEvent(function() {
+ *    Click.addLoadEvent(function() {
  *        // do something
  *    });
  */
-addLoadEvent = function(func) {
+Click.addLoadEvent = function(func) {
     // If dom is ready, fire event and return
     if (Click.domready.ready) {
         return func();
@@ -118,6 +118,8 @@ addLoadEvent = function(func) {
     Click.domready.events.push(func);
 };
 
+addLoadEvent=Click.addLoadEvent;
+
 function doubleFilter(event) {
     var keyCode;
     if (document.all) {
@@ -358,11 +360,12 @@ function validateForm(msgs, id, align, s
 /**
  * Submit the form and optionally validate the fields.
  *
- * Usage: <input onclick="Click.submit(formName, false)">
+ * Usage: <input onclick="Click.submit(form, false)">
  */
 Click.submit=function(form, validate) {
     if (typeof form == "undefined") {
-        alert('Error: form is undefined. Usage: Click.submit(formName)');
+        alert('Error: form is undefined. Usage: Click.submit(form, false)');
+        return false;
     }
 
     // Validate is true by default

Modified: click/trunk/click/framework/src/org/apache/click/element/JsScript.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/element/JsScript.java?rev=956345&r1=956344&r2=956345&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/element/JsScript.java (original)
+++ click/trunk/click/framework/src/org/apache/click/element/JsScript.java Sun Jun 20 11:07:55
2010
@@ -293,7 +293,7 @@ public class JsScript extends ResourceEl
      * DOM is ready.
      * <p/>
      * If this flag is true, the JsScript content will be registered with
-     * the "<tt>addLoadEvent</tt>" function from the JavaScript file
+     * the "<tt>Click.addLoadEvent</tt>" function from the JavaScript file
      * "<tt>/click/control.js</tt>".
      * <p/>
      * <b>Please note:</b> when setting this flag to true, the JavaScript
@@ -302,7 +302,7 @@ public class JsScript extends ResourceEl
      * <p/>
      * <b>Also note:</b> for {@link org.apache.click.Context#isAjaxRequest()
Ajax}
      * requests the JsScript content won't be registered with the
-     * "<tt>addLoadEvent</tt>" function because Ajax requests does not trigger
+     * "<tt>Click.addLoadEvent</tt>" function because Ajax requests does not
trigger
      * the browser's DOM loaded event. Instead the JsScript content will be
      * evaluated immediately by the browser.
      *
@@ -493,23 +493,23 @@ public class JsScript extends ResourceEl
     }
 
     /**
-     * Render the "<tt>addLoadEvent</tt>" function prefix to ensure the script
+     * Render the "<tt>Click.addLoadEvent</tt>" function prefix to ensure the
script
      * is executed as soon as the browser DOM is available. The prefix is
-     * "<tt>addLoadEvent(function(){</tt>".
+     * "<tt>Click.addLoadEvent(function(){</tt>".
      *
      * @see #renderDomReadySuffix(org.apache.click.util.HtmlStringBuffer)
      *
-     * @param buffer buffer to append the addLoadEvent function to
+     * @param buffer the buffer to append the Click.addLoadEvent function to
      */
     protected void renderDomReadyPrefix(HtmlStringBuffer buffer) {
-        // Wrap content in addLoadEvent function
+        // Wrap content in Click.addLoadEvent function
         if (isExecuteOnDomReady()) {
-            buffer.append("addLoadEvent(function(){\n");
+            buffer.append("Click.addLoadEvent(function(){\n");
         }
     }
 
     /**
-     * Render the "<tt>addLoadEvent</tt>" function suffix. The suffix is
+     * Render the "<tt>Click.addLoadEvent</tt>" function suffix. The suffix is
      * "<tt>});</tt>".
      *
      * @see #renderDomReadyPrefix(org.apache.click.util.HtmlStringBuffer)
@@ -517,7 +517,7 @@ public class JsScript extends ResourceEl
      * @param buffer buffer to append the conditional comment prefix
      */
     protected void renderDomReadySuffix(HtmlStringBuffer buffer) {
-        // Close addLoadEvent function
+        // Close Click.addLoadEvent function
         if (isExecuteOnDomReady()) {
             buffer.append("});");
         }



Mime
View raw message