Add ElementWrapper.text()
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/1087fe88 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/1087fe88 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/1087fe88 Branch: refs/heads/master Commit: 1087fe8879b1bea551e2313af117665ef1e3b769 Parents: 8401bea Author: Howard M. Lewis Ship <[email protected]> Authored: Wed Apr 3 11:56:03 2013 -0700 Committer: Howard M. Lewis Ship <[email protected]> Committed: Wed Apr 3 11:56:03 2013 -0700 ---------------------------------------------------------------------- .../org/apache/tapestry5/t5-core-dom-jquery.coffee | 2 ++ .../apache/tapestry5/t5-core-dom-prototype.coffee | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1087fe88/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 033fa7e..32ec62e 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 @@ -363,6 +363,8 @@ define ["_", "./utils", "jquery"], (_, utils, $) -> exports.on @element, events, match, handler return this + # Returns the text of the element (and its children). + text: -> @element.text() # Wrapper around the `jqXHR` object class ResponseWrapper http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1087fe88/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 0752843..a1cdc86 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 @@ -407,6 +407,9 @@ define ["_", "./utils", "prototype"], (_, utils) -> exports.on @element, events, match, handler return this + # Returns the text of the element (and its children). + text: -> @element.textContent or @element.innerText + # converts a selector to an array of DOM elements parseSelectorToElements = (selector) -> if _.isString selector
