Author: doll
Date: Mon Jan 14 18:11:22 2008
New Revision: 611994
URL: http://svn.apache.org/viewvc?rev=611994&view=rev
Log:
The sample container now has toggles for cajoling a gadget and for using the
cache. These add parameters to the gadget url used in the iframe. These url
parameters are not respected by the shindig server yet.. so the checkboxes
won't actually do anything for a little bit. I also changed the default gadget
spec url to be something non-existent. The previous url had a confusing gadget
in it. This is temporary, I will find some good sample gadgets to check in so
that we can have a sensible default.
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=611994&r1=611993&r2=611994&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html
(original)
+++ incubator/shindig/trunk/javascript/samplecontainer/samplecontainer.html Mon
Jan 14 18:11:22 2008
@@ -33,7 +33,9 @@
<script type="text/javascript" src="../container/gadgets.js"></script>
<script type="text/javascript">
-var specUrl =
'http://hosting.gmodules.com/ig/gadgets/file/117247905274371511495/caja-clickme.xml';
+var specUrl = 'enter_your_gadget_here.xml';
+var useCaja = false;
+var useCache = true;
var gadget;
function initGadget() {
@@ -53,6 +55,9 @@
};
function changeGadgetUrl() {
+ useCaja = document.getElementById("useCajaCheckbox").checked;
+ useCache = document.getElementById("useCacheCheckbox").checked;
+
specUrl = document.getElementById("gadgetUrl").value;
gadget.specUrl = specUrl;
goog.net.cookies.set('sampleContainerGadgetUrl',
encodeURIComponent(specUrl));
@@ -60,6 +65,28 @@
gadgets.container.renderGadgets();
};
+
+SampleContainerGadget = function(opt_params) {
+ gadgets.IfrGadget.call(this, opt_params);
+};
+
+SampleContainerGadget.inherits(gadgets.IfrGadget);
+
+SampleContainerGadget.prototype.getIframeUrl = function() {
+ var url = this.serverBase_ + 'ifr?url=' +
+ encodeURIComponent(this.specUrl) + '&synd=' + this.SYND + '&mid=' +
+ this.id + '&parent=' + encodeURIComponent(gadgets.container.parentUrl_) +
+ '&ogc=' + document.location.host + this.getUserPrefsParams();
+ if (useCaja) {
+ url += "&caja=1";
+ }
+ if (!useCache) {
+ url += "&bpc=1";
+ }
+ return url;
+};
+gadgets.container.gadgetClass = SampleContainerGadget;
+
</script>
</head>
<body onLoad="initGadget();">
@@ -68,6 +95,8 @@
<div class="subTitle">
Displaying gadget:
<input type="text" size="75" id="gadgetUrl"/>
+ <input type="checkbox" id="useCajaCheckbox"/>use caja
+ <input type="checkbox" id="useCacheCheckbox" checked="true"/>use cache
<input type="button" value="reset" onclick="changeGadgetUrl();"/>
</div>
<div style="clear:both; height: 1px;"> </div>