| <?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() { |
| gadgets.window.adjustWidth(600); |
| } |
| window.short = function() { |
| gadgets.window.adjustHeight(100); |
| } |
| window.tall = function() { |
| gadgets.window.adjustHeight(600); |
| } |
| window.fitw = function() { |
| gadgets.window.adjustWidth(); |
| } |
| window.fith = function() { |
| gadgets.window.adjustHeight(); |
| } |
| window.addrtl = function() { |
| var elem = document.getElementById('rtl'); |
| elem.style.display = ''; |
| } |
| }); |
| </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" /><br> |
| <input type="button" onclick="short()" value="short" /> |
| <input type="button" onclick="tall()" value="tall" /><br> |
| <input type="button" onclick="fitw()" value="fit - width" /> |
| <input type="button" onclick="fith()" value="fit - height" /><br> |
| <input type="button" onclick="addrtl()" value="show rtl element" /> |
| <div id="rtl" style="display:none; background:#BFA; width:300px; height:40px; right:40px; top:100px; position:absolute; direction:rtl;"> |
| I'm styled rtl, 300px wide, offset 40px from right. |
| </div> |
| </body> |
| ]]></Content> |
| </Module> |