Author: vsiveton
Date: Thu Apr  2 12:11:01 2009
New Revision: 761260

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

Modified:
    incubator/shindig/branches/1.0.x-incubating/features/core.io/io.js

Modified: incubator/shindig/branches/1.0.x-incubating/features/core.io/io.js
URL: 
http://svn.apache.org/viewvc/incubator/shindig/branches/1.0.x-incubating/features/core.io/io.js?rev=761260&r1=761259&r2=761260&view=diff
==============================================================================
--- incubator/shindig/branches/1.0.x-incubating/features/core.io/io.js 
(original)
+++ incubator/shindig/branches/1.0.x-incubating/features/core.io/io.js Thu Apr  
2 12:11:01 2009
@@ -94,8 +94,7 @@
       return;
     }
     var data = {
-      body: xobj.responseText,
-      rc: 200
+      body: xobj.responseText
     };
     callback(transformResponseData(params, data));
   }
@@ -142,46 +141,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;
@@ -446,7 +440,7 @@
       if (refresh === undefined) {
         refresh = "3600";
       }
-
+      
       var urlParams = gadgets.util.getUrlParameters();
 
       return config.proxyUrl.replace("%url%", encodeURIComponent(url)).


Reply via email to