You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by lr...@apache.org on 2008/10/23 23:27:34 UTC

svn commit: r707478 - in /incubator/shindig/trunk/features: opensocial-jsonrpc/jsonrpccontainer.js opensocial-reference/container.js opensocial-reference/opensocial.js opensocial-rest/restfulcontainer.js

Author: lryan
Date: Thu Oct 23 14:27:34 2008
New Revision: 707478

URL: http://svn.apache.org/viewvc?rev=707478&view=rev
Log:
Make synchronous callbacks asynchronous in opensocial. SHINDIG-660

Modified:
    incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
    incubator/shindig/trunk/features/opensocial-reference/container.js
    incubator/shindig/trunk/features/opensocial-reference/opensocial.js
    incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js

Modified: incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js?rev=707478&r1=707477&r2=707478&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js (original)
+++ incubator/shindig/trunk/features/opensocial-jsonrpc/jsonrpccontainer.js Thu Oct 23 14:27:34 2008
@@ -64,7 +64,9 @@
   var totalRequests = requestObjects.length;
 
   if (totalRequests == 0) {
-    callback(new opensocial.DataResponse({}, true));
+    window.setTimeout(function() {
+      callback(new opensocial.DataResponse({}, true));
+    }, 0);
     return;
   }
 

Modified: incubator/shindig/trunk/features/opensocial-reference/container.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-reference/container.js?rev=707478&r1=707477&r2=707478&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-reference/container.js (original)
+++ incubator/shindig/trunk/features/opensocial-reference/container.js Thu Oct 23 14:27:34 2008
@@ -99,8 +99,10 @@
 opensocial.Container.prototype.requestSendMessage = function(recipients,
     message, opt_callback, opt_params) {
   if (opt_callback) {
-    opt_callback(new opensocial.ResponseItem(
-        null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    window.setTimeout(function() {
+      opt_callback(new opensocial.ResponseItem(
+          null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    }, 0);
   }
 };
 
@@ -132,8 +134,10 @@
 opensocial.Container.prototype.requestShareApp = function(recipients, reason,
     opt_callback, opt_params) {
   if (opt_callback) {
-    opt_callback(new opensocial.ResponseItem(
-        null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    window.setTimeout(function() {
+      opt_callback(new opensocial.ResponseItem(
+          null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    }, 0);
   }
 };
 
@@ -155,8 +159,10 @@
 opensocial.Container.prototype.requestCreateActivity = function(activity,
     priority, opt_callback) {
   if (opt_callback) {
-    opt_callback(new opensocial.ResponseItem(
-        null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    window.setTimeout(function() {
+      opt_callback(new opensocial.ResponseItem(
+          null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    }, 0);
   }
 };
 
@@ -191,8 +197,10 @@
 opensocial.Container.prototype.requestPermission = function(permissions, reason,
     opt_callback) {
   if (opt_callback) {
-    opt_callback(new opensocial.ResponseItem(
-        null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    window.setTimeout(function () {
+      opt_callback(new opensocial.ResponseItem(
+          null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+    }, 0);
   }
 };
 

Modified: incubator/shindig/trunk/features/opensocial-reference/opensocial.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-reference/opensocial.js?rev=707478&r1=707477&r2=707478&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-reference/opensocial.js (original)
+++ incubator/shindig/trunk/features/opensocial-reference/opensocial.js Thu Oct 23 14:27:34 2008
@@ -169,9 +169,11 @@
   if (!activity || (!activity.getField(opensocial.Activity.Field.TITLE)
       && !activity.getField(opensocial.Activity.Field.TITLE_ID))) {
     if (opt_callback) {
-      opt_callback(new opensocial.ResponseItem(null, null,
-          opensocial.ResponseItem.Error.BAD_REQUEST,
-          "You must pass in an activity with a title or title id."));
+      window.setTimeout(function() {
+        opt_callback(new opensocial.ResponseItem(null, null,
+            opensocial.ResponseItem.Error.BAD_REQUEST,
+            "You must pass in an activity with a title or title id."));
+      }, 0);
     }
     return;
   }

Modified: incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js?rev=707478&r1=707477&r2=707478&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js (original)
+++ incubator/shindig/trunk/features/opensocial-rest/restfulcontainer.js Thu Oct 23 14:27:34 2008
@@ -66,7 +66,9 @@
   var totalRequests = requestObjects.length;
 
   if (totalRequests == 0) {
-    callback(new opensocial.DataResponse({}, true));
+    window.setTimeout(function () {
+      callback(new opensocial.DataResponse({}, true));
+    }, 0);
     return;
   }