You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by dd...@apache.org on 2011/11/15 15:19:48 UTC

svn commit: r1202203 - /shindig/trunk/content/samplecontainer/examples/DynamicSizeDemo.xml

Author: ddumont
Date: Tue Nov 15 14:19:48 2011
New Revision: 1202203

URL: http://svn.apache.org/viewvc?rev=1202203&view=rev
Log:
Adding sample dynamic size gadget

Added:
    shindig/trunk/content/samplecontainer/examples/DynamicSizeDemo.xml   (with props)

Added: shindig/trunk/content/samplecontainer/examples/DynamicSizeDemo.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/content/samplecontainer/examples/DynamicSizeDemo.xml?rev=1202203&view=auto
==============================================================================
--- shindig/trunk/content/samplecontainer/examples/DynamicSizeDemo.xml (added)
+++ shindig/trunk/content/samplecontainer/examples/DynamicSizeDemo.xml Tue Nov 15 14:19:48 2011
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<Module>
+  <ModulePrefs title="Dynamic Size example gadget">
+    <Require feature="dynamic-height" />
+    <Require feature="dynamic-width" />
+  </ModulePrefs>
+
+  <Content type="html" view="default"><![CDATA[
+    <head>
+    <script type="text/javascript">
+      gadgets.util.registerOnLoadHandler(function() {
+        window.skinny = function skinny() {
+          gadgets.window.adjustWidth(100);
+        }
+        window.fat = function fat() {
+          gadgets.window.adjustWidth(600);
+        }
+        window.short = function short() {
+          gadgets.window.adjustHeight(100);
+        }
+        window.tall = function tall() {
+          gadgets.window.adjustHeight(600);
+        }
+        window.fitw = function fitw() {
+          gadgets.window.adjustWidth();
+        }
+        window.fith = function fith() {
+          gadgets.window.adjustHeight();
+        }
+      });
+    </script>
+    </head>
+    <body style="background:#5AF">
+      <div style="background:#FAA; width:300px">
+         I'm styled to be 300px wide.
+      </div>
+      <input type="button" onclick="skinny()" value="skinny" />
+      <input type="button" onclick="fat()" value="fat" />
+      <input type="button" onclick="short()" value="short" />
+      <input type="button" onclick="tall()" value="tall" />
+      <input type="button" onclick="fitw()" value="fit - width" />
+      <input type="button" onclick="fith()" value="fit - height" />
+    </body>
+  ]]></Content>
+</Module>
\ No newline at end of file

Propchange: shindig/trunk/content/samplecontainer/examples/DynamicSizeDemo.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain