[Pkg-javascript-commits] [ltx] 14/469: xml: getChildText()

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:00:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit 10bf8dc594ed34b5c3cc5f7e31fe7b551cd24660
Author: Astro <astro at spaceboyz.net>
Date:   Thu May 27 03:04:32 2010 +0200

    xml: getChildText()
---
 lib/xmpp/xml.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/xmpp/xml.js b/lib/xmpp/xml.js
index 2b8a694..531ea19 100644
--- a/lib/xmpp/xml.js
+++ b/lib/xmpp/xml.js
@@ -74,6 +74,17 @@ Element.prototype.getText = function() {
     return text;
 };
 
+Element.prototype.getChildText = function(name) {
+    var text = null;
+    this.children.forEach(function(el) {
+	if (!text && el.name == name)
+	{
+	    text = el.getText();
+	}
+    });
+    return text;
+};
+
 /*** Builder ***/
 
 /** returns uppermost parent */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list