Author: lryan
Date: Wed Apr  1 18:59:23 2009
New Revision: 761013

URL: http://svn.apache.org/viewvc?rev=761013&view=rev
Log:
Rollback of 760873. See SHINDIG 848 comments for context

Modified:
    incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js

Modified: 
incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js?rev=761013&r1=761012&r2=761013&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js 
(original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js 
Wed Apr  1 18:59:23 2009
@@ -97,8 +97,7 @@
       return;
     }
     var data = {
-      body: xobj.responseText,
-      rc: 200
+      body: xobj.responseText
     };
     callback(transformResponseData(params, data));
   }
@@ -145,46 +144,41 @@
      oauthErrorText: data.oauthErrorText,
      errors: []
     };
-    if (resp.rc === 200) {
-      if (resp.text) {
-        switch (params.CONTENT_TYPE) {
-          case "JSON":
-          case "FEED":
-            resp.data = gadgets.json.parse(resp.text);
-            if (!resp.data) {
-              resp.errors.push("failed to parse JSON");
-              resp.data = null;
+    if (resp.text) {
+      switch (params.CONTENT_TYPE) {
+        case "JSON":
+        case "FEED":
+          resp.data = gadgets.json.parse(resp.text);
+          if (!resp.data) {
+            resp.errors.push("failed to parse JSON");
+            resp.data = null;
+          }
+          break;
+        case "DOM":
+          var dom;
+          if (window.ActiveXObject) {
+            dom = new ActiveXObject("Microsoft.XMLDOM");
+            dom.async = false;
+            dom.validateOnParse = false;
+            dom.resolveExternals = false;
+            if (!dom.loadXML(resp.text)) {
+              resp.errors.push("failed to parse XML");
+            } else {
+              resp.data = dom;
             }
-            break;
-          case "DOM":
-            var dom;
-            if (window.ActiveXObject) {
-              dom = new ActiveXObject("Microsoft.XMLDOM");
-              dom.async = false;
-              dom.validateOnParse = false;
-              dom.resolveExternals = false;
-              if (!dom.loadXML(resp.text)) {
-                resp.errors.push("failed to parse XML");
-              } else {
-                resp.data = dom;
-              }
+          } else {
+            var parser = new DOMParser();
+            dom = parser.parseFromString(resp.text, "text/xml");
+            if ("parsererror" === dom.documentElement.nodeName) {
+              resp.errors.push("failed to parse XML");
             } else {
-              var parser = new DOMParser();
-              dom = parser.parseFromString(resp.text, "text/xml");
-              if ("parsererror" === dom.documentElement.nodeName) {
-                resp.errors.push("failed to parse XML");
-              } else {
-                resp.data = dom;
-              }
+              resp.data = dom;
             }
-            break;
-          default:
-            resp.data = resp.text;
-            break;
-        }
-      } else {
-        resp.errors.push("failed to retrieve data from backend");
-        resp.data = null;
+          }
+          break;
+        default:
+          resp.data = resp.text;
+          break;
       }
   }
     return resp;


Reply via email to