test

hello world example

Не удалось найти URL спецификации гаджета
<?
xml version="1.0" encoding="UTF-8" ?>
<Module>
 
<ModulePrefs title="Include gadget (iframe)" title_url="http://sites.google.com/"
         
description="Include another web page in your Google Site"
         
thumbnail="http://www.gstatic.com/sites-gadgets/common/images/sites-icon-gadget-thumb.png"
         
screenshot="http://www.gstatic.com/sites-gadgets/common/images/sites-icon-gadget-ss.png"
         
height="800" width="600" author="Google">
   
<Require feature="dynamic-height"/>
 
</ModulePrefs>
 
<UserPref name="iframeURL" display_name="URL to content" required="true"/>
 
<UserPref name="scroll" display_name="Display scrollbar" default_value="auto" datatype="enum">
   
<EnumValue value="auto" display_value="Automatic"/>
   
<EnumValue value="no" display_value="No"/>
   
<EnumValue value="yes" display_value="Yes"/>
 
</UserPref>
 
<Content type="html" view="default,canvas">
 
<div id='dest'><img src="http://www.google.com/ig/images/spinner.gif"></div>
 
<script type="text/javascript">
  gadgets
.util.registerOnLoadHandler(doRender);

 
function doRender(){
   
// setup variables
   
var prefs = new gadgets.Prefs();
   
var iframeURL = prefs.getString('iframeURL');
   
var scroll = prefs.getString('scroll');
   
var height = 800;
   
var width = 600;

   
if (gadgets.window) {
     
var viewport = gadgets.window.getViewportDimensions();
     
if (viewport.width) {
       
var width = viewport.width;
     
}
     
if (viewport.height) {
       
var height = viewport.height;
     
}
   
}

   
var iframe = document.createElement('iframe');
    iframe
.setAttribute('width', width + 'px');
    iframe
.setAttribute('height', height + 'px');
    iframe
.setAttribute('frameborder','no');
   
if(scroll){
      iframe
.setAttribute('scrolling', scroll);
   
}
    iframe
.setAttribute('src', iframeURL);

   
// set the slideshow to the placeholder div
   
var dest = document.getElementById('dest');
    dest
.innerHTML = '';
    dest
.appendChild(iframe);
 
}
 
</script>
 
</Content>
</Module>




Comments