You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by do...@apache.org on 2008/01/30 20:05:16 UTC
svn commit: r616847 - /incubator/shindig/trunk/javascript/opensocial6to7.js
Author: doll
Date: Wed Jan 30 11:05:14 2008
New Revision: 616847
URL: http://svn.apache.org/viewvc?rev=616847&view=rev
Log:
Wrapped the translated function calls in methods so that the "this" param refers to the right thing when used inside the called functions.
Thanks to Paul Lindner for pointing out this problem and providing a fix.
Modified:
incubator/shindig/trunk/javascript/opensocial6to7.js
Modified: incubator/shindig/trunk/javascript/opensocial6to7.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/opensocial6to7.js?rev=616847&r1=616846&r2=616847&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/opensocial6to7.js (original)
+++ incubator/shindig/trunk/javascript/opensocial6to7.js Wed Jan 30 11:05:14 2008
@@ -2,11 +2,15 @@
// container that only supports 0.7, including this file should allow the gadget
// to run without making any changes.
-opensocial.requestNavigateTo = gadgets.views.requestNavigateTo;
+opensocial.requestNavigateTo = function() {
+ return gadgets.views.requestNavigateTo();
+};
// If using enums, gadgets are ok.
// TODO: Translate hardcoded string params to the new gadgets values
-opensocial.makeRequest = gadgets.io.makeRequest;
+opensocial.makeRequest = function() {
+ return gadgets.io.makeRequest();
+};
opensocial.ContentRequestParameters = {
METHOD : gadgets.io.RequestParameters.METHOD,
@@ -77,9 +81,15 @@
// Note: The names of views may have changed in a container between 0.6 and 0.7
// but that is container specific
-opensocial.Environment.prototype.getSurface = gadgets.views.getCurrentView;
-opensocial.Environment.prototype.getSupportedSurfaces
- = gadgets.views.getSupportedViews;
-opensocial.Environment.prototype.getParams = gadgets.views.getParams;
-
-opensocial.Environment.prototype.hasCapability = gadgets.util.hasFeature;
+opensocial.Environment.prototype.getSurface = function() {
+ return gadgets.views.getCurrentView();
+};
+opensocial.Environment.prototype.getSupportedSurfaces = function() {
+ return gadgets.views.getSupportedViews();
+};
+opensocial.Environment.prototype.getParams = function() {
+ return gadgets.views.getParams();
+};
+opensocial.Environment.prototype.hasCapability = function() {
+ return gadgets.util.hasFeature();
+};