<Module>
<ModulePrefs title="Steegle.com - Google Sites Like Button" width="300" height="35" scrolling="false" title_url="http://www.steegle.com/websites/google-sites-howtos/facebook-like-button-gadget" description="Facebook Like button for Google Sites - follow the instructions on my site Steegle.com" author="Stephen Hind" author_email="stephen@steegle.com" author_affiliation="Steegle.com" author_location="Carlisle, Cumbria, UK" screenshot="http://www.steegle.com/images/facebook-like-120x60.png" author_link="http://www.steegle.com/" thumbnail="http://www.steegle.com/images/facebook-like-120x60.png" directory_title="Steegle.com - Facebook Like Button"></ModulePrefs>
<UserPref name="url" display_name="URL to Like (leave blank for automatic):" datatype="string" default_value=""/>
<UserPref name="layout" display_name="Layout Style:" datatype="enum" default_value="standard">
  <EnumValue value="standard" display_value="Standard [300x35]"/>
  <EnumValue value="button_count" display_value="Button Count [300x21]"/>
  <EnumValue value="box_count" display_value="Box Count [300x90]"/>
</UserPref>
<UserPref name="width" display_name="Width:" datatype="string" default_value=""/>
<UserPref name="showfaces" display_name="Show Faces:" datatype="enum" default_value="false">
  <EnumValue value="false" display_value="No"/>
  <EnumValue value="true" display_value="Yes"/>
</UserPref>
<UserPref name="action" display_name="Verb to display:" datatype="enum" default_value="like">
  <EnumValue value="like" display_value="Like"/>
  <EnumValue value="recommend" display_value="Recommend"/>
</UserPref>
<UserPref name="font" display_name="Font:" datatype="enum" default_value="arial">
  <EnumValue value="arial" display_value="Arial"/>
  <EnumValue value="lucida+grande" display_value="Lucida Grande"/>
  <EnumValue value="segoe+ui" display_value="Segoe UI"/>
  <EnumValue value="tahoma" display_value="Tahoma"/>
  <EnumValue value="trebuchet+ms" display_value="Trebuchet MS"/>
  <EnumValue value="verdana" display_value="Verdana"/>
</UserPref>
<UserPref name="colorscheme" display_name="Colour Scheme:" datatype="enum" default_value="light">
  <EnumValue value="light" display_value="Light"/>
  <EnumValue value="dark" display_value="Dark"/>
</UserPref>
<Content type="html">
<![CDATA[
<html><head><title>Steegle.com - Facebook Like Button</title></head><body style="background-color:transparent;">
<div id="google_sites_facebook_like_button" style="background-color:transparent;">
  <img src="http://www.google.com/ig/images/spinner.gif">
</div>
<script type="text/javascript"> 
  // Get userprefs 
  var prefs = new gadgets.Prefs(); 
  var layout = prefs.getString("layout"); 
  var width = prefs.getString("width"); 
  var showfaces = prefs.getString("showfaces");
  var action = prefs.getString("action"); 
  var font = prefs.getString("font"); 
  var colorscheme = prefs.getString("colorscheme");
  if(layout=="standard"){var height = "35";}
  else if(layout=="button_count"){var height = "21";}
  else{var height = "90";}
  if(prefs.getString("url")){var url = prefs.getString("url")}else{var url = document.referrer;}
  var iframeURL = '//www.facebook.com/plugins/like.php?href='+encodeURIComponent(url)+'&send=false&layout='+layout+'&width='+width+'&show_faces='+showfaces+'&action='+action+'&colorscheme='+colorscheme+'&font='+font+'&height='+height; 
  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'); // TODO: add options to control frameborder 
  iframe.setAttribute('frameBorder','no'); 
  iframe.setAttribute('src',iframeURL); 
  iframe.setAttribute('allowtransparency','true'); 
  iframe.setAttribute('scrolling','no'); 
  // set the follow button to the placeholder div 
  var dest = document.getElementById('google_sites_facebook_like_button'); 
  dest.innerHTML = ''; 
  dest.appendChild(iframe); 
</script>
</body></html>
]]>
</Content>
</Module>
