You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by li...@apache.org on 2008/03/04 12:42:43 UTC
svn commit: r633435 - in /incubator/shindig/trunk: features/rpc/rpc.js
javascript/container/gadgets.js javascript/container/sample6.html
Author: lindner
Date: Tue Mar 4 03:42:42 2008
New Revision: 633435
URL: http://svn.apache.org/viewvc?rev=633435&view=rev
Log:
Reviving the ability to use setParentUrl() to send
a parent= param to the iframe generator. Make sure
it's correctly encoded/decoded. Add an example
Modified:
incubator/shindig/trunk/features/rpc/rpc.js
incubator/shindig/trunk/javascript/container/gadgets.js
incubator/shindig/trunk/javascript/container/sample6.html
Modified: incubator/shindig/trunk/features/rpc/rpc.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/rpc/rpc.js?rev=633435&r1=633434&r2=633435&view=diff
==============================================================================
--- incubator/shindig/trunk/features/rpc/rpc.js (original)
+++ incubator/shindig/trunk/features/rpc/rpc.js Tue Mar 4 03:42:42 2008
@@ -166,7 +166,7 @@
for (var i = 0, param; param = params[i]; ++i) {
// Only the first parent can be validated.
if (param.indexOf("parent=") === 0) {
- parentParam = param.substring(7);
+ parentParam = decodeURIComponent(param.substring(7));
break;
}
}
Modified: incubator/shindig/trunk/javascript/container/gadgets.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/container/gadgets.js?rev=633435&r1=633434&r2=633435&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/container/gadgets.js (original)
+++ incubator/shindig/trunk/javascript/container/gadgets.js Tue Mar 4 03:42:42 2008
@@ -521,6 +521,7 @@
'&country=' + gadgets.container.country_ +
'&lang=' + gadgets.container.language_ +
'&view=' + gadgets.container.view_ +
+ (gadgets.container.parentUrl_ ? '&parent=' + encodeURIComponent(gadgets.container.parentUrl_) : '') +
(this.debug ? '&debug=1' : '') +
this.getUserPrefsParams() +
'#rpctoken=' + this.rpcToken +
@@ -744,8 +745,7 @@
url = document.location.href.match(/^[^?#]+\//)[0] + url;
}
- /* Nasty hack to get around the hardcoded /ig/ifpc_relay URL */
- this.parentUrl_ = url + '?';
+ this.parentUrl_ = url;
};
/**
Modified: incubator/shindig/trunk/javascript/container/sample6.html
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/container/sample6.html?rev=633435&r1=633434&r2=633435&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/container/sample6.html (original)
+++ incubator/shindig/trunk/javascript/container/sample6.html Tue Mar 4 03:42:42 2008
@@ -14,6 +14,8 @@
gadgets.container.layoutManager =
new gadgets.FloatLeftLayoutManager('gadget-parent');
+ // An example of explicitly setting the parentUrl
+ gadgets.container.setParentUrl("http://" + document.location.host + '/');
var gadget = gadgets.container.createGadget({specUrl: specUrl0, title: "Dynamic Height Demo", width: 500});
gadgets.container.addGadget(gadget);
};