diff forms.js @ 58:b98e545a94f7 default tip

Always use children instead of tags. Might break something.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 13 Sep 2011 00:54:55 +0200
parents addbf6bbfaa8
children
line wrap: on
line diff
--- a/forms.js
+++ b/forms.js
@@ -114,8 +114,8 @@ exports.parse = function(x, params) {
 	}
 
 	form.fields = {};
-	for (var i in x.tags) {
-		var field = x.tags[i];
+	for (var i in x.children) {
+		var field = x.children[i];
 		var name = field.getAttribute('var');
 		if (params && name == 'FORM_TYPE')
 			continue;
@@ -124,8 +124,8 @@ exports.parse = function(x, params) {
 			var type = field.getAttribute('type');
 			if (type == 'jid-multi' || type == 'list-multi' || type == 'text-multi') {
 				form.fields[name] = [];
-				for (var j in field.tags) {
-					var elem = field.tags[j];
+				for (var j in field.children) {
+					var elem = field.children[j];
 					if (elem.name == 'value')
 						form.fields[name].push(elem.getText());
 				}
@@ -152,8 +152,8 @@ exports.parse = function(x, params) {
 			if (type == 'jid-multi' || type == 'list-multi' || type == 'text-multi') {
 				form.fields[name].options = {};
 				form.fields[name].values = [];
-				for (var j in field.tags) {
-					var elem = field.tags[j];
+				for (var j in field.children) {
+					var elem = field.children[j];
 					if (elem.name == 'option') {
 						var value = elem.getChild('value');
 						if (!value)