You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2013/06/13 00:50:18 UTC

[1/3] git commit: Search up from element clicked to containing element with data-update-zone attribute

Updated Branches:
  refs/heads/master f40f4f7eb -> 48644151a


Search up from element clicked to containing element with data-update-zone attribute


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/5898990d
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/5898990d
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/5898990d

Branch: refs/heads/master
Commit: 5898990d67ceeba49b1b9cc92f1653a8e6ea816d
Parents: f40f4f7
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Jun 12 13:54:59 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Jun 12 13:54:59 2013 -0700

----------------------------------------------------------------------
 .../coffeescript/META-INF/modules/t5/core/zone.coffee    | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/5898990d/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
index 57bbaf6..31f2231 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
@@ -38,20 +38,25 @@ define ["./dom", "./events", "./ajax", "./console", "./forms",  "underscore"],
         zone = element.findParent "[data-container-type=zone]"
 
         if zone is null
-          console.error "Unable to locate containing zone for #{element}."
+          throw new Error "Unable to locate containing zone for #{element}."
 
         return zone
 
       zone = dom zoneId
 
       if zone is null
-        console.error "Unable to locate zone '#{zoneId}'."
+        throw new Error "Unable to locate zone '#{zoneId}'."
 
       return zone
 
     dom.onDocument "click", "a[data-update-zone]", ->
 
-      zone = findZone this
+      element = @closest "[data-update-zone]"
+
+      unless element
+        throw new Error "Could not locate containing element with data-update-zone attribute."
+
+      zone = findZone element
 
       if zone
         zone.trigger events.zone.refresh,  url: @attribute "href"


[2/3] git commit: Provide a toString() on implementations of ElementWrapper

Posted by hl...@apache.org.
Provide a toString() on implementations of ElementWrapper


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7439533b
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7439533b
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7439533b

Branch: refs/heads/master
Commit: 7439533bcb72891b6b6a075a5bc58d82417f6816
Parents: 5898990
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Jun 12 13:55:26 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Jun 12 13:55:26 2013 -0700

----------------------------------------------------------------------
 .../org/apache/tapestry5/t5-core-dom-jquery.coffee            | 5 +++++
 .../org/apache/tapestry5/t5-core-dom-prototype.coffee         | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7439533b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
index a55e45e..80cc099 100644
--- a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
+++ b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
@@ -118,6 +118,11 @@ define ["underscore", "./utils", "jquery", "./events"], (_, utils, $, events) ->
     # Some coders would use some JavaScript cleverness to automate more of the mapping from the ElementWrapper API
     # to the jQuery API, but that eliminates a chance to write some very necessary documentation.
 
+    toString: ->
+      markup = @element.outerHTML
+
+      "ElementWrapper[#{markup.substring 0, (markup.indexOf ">") + 1}]"
+
     # Hides the wrapped element, setting its display to 'none'.
     hide: ->
       @$.hide()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7439533b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
index 9bd01a1..04c7b37 100644
--- a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
+++ b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
@@ -161,7 +161,12 @@ define ["underscore", "./utils", "./events", "prototype"], (_, utils, events) ->
   # Passed the DOM Element
     constructor: (@element) ->
 
-      # Hides the wrapped element, setting its display to 'none'.
+    toString: ->
+      markup = @element.outerHTML
+
+      "ElementWrapper[#{markup.substring 0, (markup.indexOf ">") + 1}]"
+
+    # Hides the wrapped element, setting its display to 'none'.
     hide: ->
       @element.hide()
 


[3/3] git commit: Extract the Ajax request URL from the correct element's href attribute

Posted by hl...@apache.org.
Extract the Ajax request URL from the correct element's href attribute


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/48644151
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/48644151
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/48644151

Branch: refs/heads/master
Commit: 48644151ae1ecd9a989af2dca86ab4b77929b46d
Parents: 7439533
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Jun 12 14:00:24 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Jun 12 14:00:24 2013 -0700

----------------------------------------------------------------------
 .../src/main/coffeescript/META-INF/modules/t5/core/zone.coffee     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/48644151/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
index 31f2231..152a212 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
@@ -59,7 +59,7 @@ define ["./dom", "./events", "./ajax", "./console", "./forms",  "underscore"],
       zone = findZone element
 
       if zone
-        zone.trigger events.zone.refresh,  url: @attribute "href"
+        zone.trigger events.zone.refresh,  url: element.attribute "href"
 
       return false
 


[2/3] git commit: Provide a toString() on implementations of ElementWrapper

Posted by hl...@apache.org.
Provide a toString() on implementations of ElementWrapper


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7439533b
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7439533b
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7439533b

Branch: refs/heads/master
Commit: 7439533bcb72891b6b6a075a5bc58d82417f6816
Parents: 5898990
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Jun 12 13:55:26 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Jun 12 13:55:26 2013 -0700

----------------------------------------------------------------------
 .../org/apache/tapestry5/t5-core-dom-jquery.coffee            | 5 +++++
 .../org/apache/tapestry5/t5-core-dom-prototype.coffee         | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7439533b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
index a55e45e..80cc099 100644
--- a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
+++ b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-jquery.coffee
@@ -118,6 +118,11 @@ define ["underscore", "./utils", "jquery", "./events"], (_, utils, $, events) ->
     # Some coders would use some JavaScript cleverness to automate more of the mapping from the ElementWrapper API
     # to the jQuery API, but that eliminates a chance to write some very necessary documentation.
 
+    toString: ->
+      markup = @element.outerHTML
+
+      "ElementWrapper[#{markup.substring 0, (markup.indexOf ">") + 1}]"
+
     # Hides the wrapped element, setting its display to 'none'.
     hide: ->
       @$.hide()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7439533b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
index 9bd01a1..04c7b37 100644
--- a/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
+++ b/tapestry-core/src/main/coffeescript/org/apache/tapestry5/t5-core-dom-prototype.coffee
@@ -161,7 +161,12 @@ define ["underscore", "./utils", "./events", "prototype"], (_, utils, events) ->
   # Passed the DOM Element
     constructor: (@element) ->
 
-      # Hides the wrapped element, setting its display to 'none'.
+    toString: ->
+      markup = @element.outerHTML
+
+      "ElementWrapper[#{markup.substring 0, (markup.indexOf ">") + 1}]"
+
+    # Hides the wrapped element, setting its display to 'none'.
     hide: ->
       @element.hide()
 


[3/3] git commit: Extract the Ajax request URL from the correct element's href attribute

Posted by hl...@apache.org.
Extract the Ajax request URL from the correct element's href attribute


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/48644151
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/48644151
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/48644151

Branch: refs/heads/master
Commit: 48644151ae1ecd9a989af2dca86ab4b77929b46d
Parents: 7439533
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Wed Jun 12 14:00:24 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed Jun 12 14:00:24 2013 -0700

----------------------------------------------------------------------
 .../src/main/coffeescript/META-INF/modules/t5/core/zone.coffee     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/48644151/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
index 31f2231..152a212 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/zone.coffee
@@ -59,7 +59,7 @@ define ["./dom", "./events", "./ajax", "./console", "./forms",  "underscore"],
       zone = findZone element
 
       if zone
-        zone.trigger events.zone.refresh,  url: @attribute "href"
+        zone.trigger events.zone.refresh,  url: element.attribute "href"
 
       return false