Hi,

We have a minimal Shindig based backend running for the hi5 sandbox.
Very beta right now.  

  http://lindner.sandbox.hi5.com/friend/apps/entry/www.inuus.com/os/unittest.xml

Here's some notes (and patches!)

First, we had problems with gadgets.views disappearing.  Turns out
that core.js was getting included after views.js.

Here's the first part of our opensocial-0.7/feature.xml:

<feature>
  <name>opensocial-0.7</name>
  <dependency>opensocial-reference</dependency>
  <dependency>views</dependency>
  <gadget>
    <script src="hi5container.js"></script>
    <script src="hi5profile.js"></script>
    .....

In any case changing core.js with this patch fixed this:

===================================================================
--- features/core/core.js       (revision 617148)
+++ features/core/core.js       (working copy)
@@ -1 +1 @@
-var gadgets = {};
+var gadgets = gadgets || {};


----------------------------------------------------------------------

Another set of modficiations I made centered on
javascript/container/gadgets.js.  I needed to have a way to pass in a
standard set of hash values, plus nocache, country, and language.
These params seem like they should be part of the base object, so
here's a proposed patch:

===================================================================
--- javascript/container/gadgets.js     (revision 617148)
+++ javascript/container/gadgets.js     (working copy)
@@ -275,7 +275,7 @@
 };

 /**
- * Gets the HTML element that is the chrome of a gadget into which the cotnent
+ * Gets the HTML element that is the chrome of a gadget into which the content
  * of the gadget can be rendered.
  * @param {Object} gadget Gadget instance
  * @return {Object} HTML element that is the chrome for the given gadget
@@ -347,7 +347,7 @@
 // Gadget

 /**
- * Creates a new instance of gadget.  Optoinal parameters are set as instance
+ * Creates a new instance of gadget.  Optional parameters are set as instance
  * variables.
  * @constructor
  * @param {Object} params Parameters to set on gadget.  Common parameters:
@@ -355,10 +355,10 @@
  *    "private": Whether gadget spec is accessible only privately, which means
  *        browser can load it but not gadget server
  *    "spec": Gadget Specification in XML
+ *    "hashData": data to be passed on the # of the iframe URL
  */
 gadgets.Gadget = function(params) {
   this.userPrefs_ = {};
-
   if (params) {
     for (var name in params) {
       this[name] = params[name];
@@ -497,9 +497,11 @@

 gadgets.IfrGadget.prototype.getIframeUrl = function() {
   return this.serverBase_ + 'ifr?url=' +
-      encodeURIComponent(this.specUrl) + '&synd=' + this.SYND + '&mid=' +
+      encodeURIComponent(this.specUrl) + '&nocache=' + this.nocache_ + 
'&synd=' + this.SYND + '&mid=' +
       this.id + '&parent=' + encodeURIComponent(gadgets.container.parentUrl_) +
-      '&ogc=' + document.location.host + this.getUserPrefsParams();
+      '&ogc=' + document.location.host + this.getUserPrefsParams() +
+      '&country=' + this.country_ + '&lang=' + this.language_ +
+      '#' + this.hashData;
 };
 
 gadgets.IfrGadget.prototype.getUserPrefsParams = function() {
@@ -536,7 +538,7 @@
     var script = document.createElement('script');
     script.src = 'http://gmodules.com/ig/gadgetsettings?url=' + this.specUrl +
-        '&mid=' + this.id + '&output=js' + this.getUserPrefsParams();
+        '&mid=' + this.id + '&output=js' + this.getUserPrefsParams() + '#' + 
this.hashData;
     document.body.appendChild(script);
   }
 };
@@ -600,6 +602,9 @@
 gadgets.Container = function() {
   this.gadgets_ = {};
   this.parentUrl_ = '';
+  this.country_  = 'US';
+  this.language_  = 'en';
+  this.nocache_ = 1;
 };
 
 gadgets.Container.inherits(gadgets.Extensible);
@@ -626,6 +631,18 @@ 
   this.parentUrl_ = url;
 };
 
+gadgets.Container.prototype.setCountry = function(country) {
+  this.country_ = country;
+};
+
+gadgets.Container.prototype.setNoCache = function(nocache) {
+  this.nocache_ = nocache;
+}
+
+gadgets.Container.prototype.setLanguage = function(language) {
+  this.language_ = language;
+};
+
 gadgets.Container.prototype.getGadgetKey_ = function(instanceId) {
   return 'gadget_' + instanceId;
 };





-- 
Paul Lindner
hi5 Architect
[EMAIL PROTECTED]

Reply via email to