web/data/cubicweb.js
changeset 5727 29afb9e715bb
parent 5705 30b94973bc67
child 5949 2a273c896a38
--- a/web/data/cubicweb.js	Fri Jun 11 07:58:52 2010 +0200
+++ b/web/data/cubicweb.js	Fri Jun 11 07:58:53 2010 +0200
@@ -57,10 +57,10 @@
     },
 
     swapDOM: function (dest, src) {
-        dest = getNode(dest);
+        dest = cw.getNode(dest);
         var parent = dest.parentNode;
         if (src) {
-            src = getNode(src);
+            src = cw.getNode(src);
             parent.replaceChild(src, dest);
         } else {
             parent.removeChild(dest);
@@ -159,7 +159,7 @@
         var children = visitor(node);
         if (children) {
             for (var i = 0; i < children.length; i++) {
-                nodeWalkDepthFirst(children[i], visitor);
+                cw.utils.nodeWalkDepthFirst(children[i], visitor);
             }
         }
     },
@@ -192,7 +192,7 @@
         if (typeof(elem) == "undefined" || elem === null) {
             elem = document.body;
         } else {
-            elem = getNode(elem);
+            elem = cw.getNode(elem);
         }
         cw.utils.nodeWalkDepthFirst(elem, function (elem) {
             var name = elem.name;
@@ -250,8 +250,17 @@
                 if (tagName === "FORM" || tagName === "P" || tagName === "SPAN" || tagName === "DIV") {
                     return elem.childNodes;
                 }
+		var value = elem.value;
+		if (tagName === "TEXTAREA") {
+		    if (typeof(FCKeditor) != 'undefined') {
+			var fck = FCKeditorAPI.GetInstance(elem.id);
+			if (fck) {
+			    value = fck.GetHTML();
+			}
+		    }
+		}
                 names.push(name);
-                values.push(elem.value || '');
+                values.push(value || '');
                 return null;
             }
             return elem.childNodes;