Author: doll
Date: Tue Jul  8 16:15:17 2008
New Revision: 675046

URL: http://svn.apache.org/viewvc?rev=675046&view=rev
Log:
Fixed bug in samplecontainer caused by latest abdera changes.

The abdera code can now return an empty response so the samplecontainer.html 
code has been modified to allow that emptiness. 


Modified:
    incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html

Modified: 
incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html?rev=675046&r1=675045&r2=675046&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html 
(original)
+++ incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html Tue 
Jul  8 16:15:17 2008
@@ -164,6 +164,9 @@
 function dumpStateFile() {
   sendRequestToServer('dumpstate', 'GET', null,
       function(data) {
+        if (!data) {
+          alert("Could not dump the current state.");
+        }
         document.getElementById('gadgetState').innerHTML
             = gadgets.json.stringify(data);
       });
@@ -178,15 +181,11 @@
     "METHOD" : method,
     "POST_DATA" : encodeValues(opt_postParams)};
 
-  makeRequest(socialDataPath + url,
+  makeRequest(socialDataPath + url + "?st=" + gadget.secureToken,
       function(data) {
         data = data.data;
-        if (!data) {
-          alert("The request to the server caused an error.");
-        } else {
-          if (opt_callback) {
-            opt_callback(data);
-          }
+        if (opt_callback) {
+          opt_callback(data);
         }
       },
       makeRequestParams);
@@ -219,7 +218,7 @@
 
     // We are using eval directly here because the outer response comes from a
   // trusted source, and json parsing is slow in IE.
-  var data = eval("(" + txt + ")");
+  var data = txt ? eval("(" + txt + ")") : "";
   var resp = {
     data: data
   };


Reply via email to