﻿<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Slideshow from Picasa Media RSS Feed. Display original pictures, maximum size : 1600px"
title_url="http://viti-vino.blogspot.com/p/gadgets.html"
width="440" 
height="600"
scrolling="false"
directory_title="Media RSS Feed Slideshow. Slideshow from Picasa. Display original pictures, maximum size : 1600px."
description="Media RSS Feed Slideshow. Simple Slideshow (without title of Feed and without title of pictures), without border. Can display the original picture (max width : 1600px). Can define display and transition time. Display jpg, gif and png pictures. Random order available."
screenshot="http://www.liens-du-vin.ch/_pic062/picasa-slideshow-screen.png"
thumbnail="http://www.liens-du-vin.ch/_pic062/picasa-slideshow-thumb.png"
author="Philippe Chappuis"
author_email="info+gadgetCSE@liens-du-vin.ch"
author_affiliation="Google"
author_location="Rolle Switzerland"
author_link="http://www.liens-du-vin.ch"
author_photo="http://www.liens-du-vin.ch/_pic02/gadget-author-photo.png"
author_aboutme="An Engineer who likes to develop for the Net and tastes wines"
author_quote="A chief is a man who assumes responsibility. He says &quot;I was beaten&quot; he does not say &quot;My men were beaten&quot; - Antoine de Saint-Exupery">

<Require feature="analytics" />

</ModulePrefs>

<UserPref name="FEED" display_name="Feed to display" required="true" default_value="http://picasaweb.google.fr/data/feed/base/user/philippe.chappuis/albumid/5297196325809923457?alt=rss&amp;kind=photo&amp;hl=en" />

<UserPref name="PWH" display_name="Width of pictures" required="true" default_value="280" />
<UserPref name="PHT" display_name="Height of pictures" required="true" default_value="190" />

<UserPref name="DTime" display_name="Display Time (ms)" required="false" />
<UserPref name="TTime" display_name="Transition Time (ms)" required="false" />
<UserPref name="RND" display_name="Random display (Yes - No)" required="false" />
<UserPref name="CLP" display_name="Open Picture on Clic (Yes - No)" required="false" />
<UserPref name="NAB" display_name="Display Navigation Bar (Yes - No)" required="false" />
  
<UserPref name="SCOL" display_name="Background of Slide" required="true" default_value="#c3d9ff" />
<UserPref name="CCOL" display_name="Background of Container" required="true" default_value="#d1dae3" />

<Content type="html"><![CDATA[
<script src="https://www.google.com/jsapi" type="text/javascript"></script>
<script src="https://www.google.com/uds/solutions/slideshow/gfslideshow.js" type="text/javascript"></script>

<style text="text/css">

body
{
background-color: __UP_CCOL__;
}

#slide_box
{
width: __UP_PWH__px;
height: __UP_PHT__px;
margin: 0;
background-color: __UP_SCOL__;
padding: 0px;
}

#slide_box a img
{
border: 0;
}

#feed_title
{
display: none;
}
</style>

<script type="text/javascript">

// Global variables

var prefs = new gadgets.Prefs();

var s_fil = prefs.getString("FEED");

var dti="4000";
var s_dti = prefs.getString("DTime");
if (s_dti)
{
if ((s_dti < 1000) | (s_dti > 12000)) dti="4000";
dti=s_dti;
}

var tti="2000";
var s_tti = prefs.getString("TTime");
if (s_tti)
{
if ((s_tti < 500) | (s_tti > 6000)) tti="2000";
tti=s_tti;
}

var rnd="N";
var s_rnd = prefs.getString("RND");
if (s_rnd)
{
s_rnd=s_rnd.toUpperCase();
if (s_rnd.substr(0,1) == 'N')
   {rnd="N";}
else
   {rnd="Y";}
}

var clp=null;
var s_clp = prefs.getString("CLP");
if (s_clp)
{
s_clp=s_clp.toUpperCase();
if (s_clp.substr(0,1) == 'N')
   {clp=null;}
else
   {clp="_blank";}
}

// navbar

var nab=true;
var s_nab = prefs.getString("NAB");
if (s_nab)
{
s_nab=s_nab.toUpperCase();
if (s_nab.substr(0,1) == 'N')
   {nab=null;}
else
   {nab=true;}
}


function load_feed()
{
var feed_input = s_fil; 

var options = {
fullControlPanel: nab,
fullControlPanelSmallIcons: nab,
fullControlPanelFadeOutTime: 1000,
pauseOnHover: false,
scaleImages : true,
displayTime: dti,
transitionTime: tti,
numResults: 1000,
linkTarget: clp,
feedLoadCallback: FeedTitle,
thumbnailUrlResolver: UrlResolver, 
transitionCallback: TransitionHandler
};


if (rnd != "N") /* Random call */
{
  var processEntries = GFslideShow.prototype.processEntries;
    GFslideShow.prototype.processEntries =
      function(entries) {
        for (var i=0, entry;  entry = entries[i];  i++) {
          var j = Math.floor(Math.random() * entries.length);
          var t = entries[j];
          entries[j] = entries[i];
          entries[i] = t;
        }
        processEntries.call(this, entries);
      };
 } 


new GFslideShow(feed_input, "slide_box", options);
}

// Find the title of the Feed

function FeedTitle(result)
{ if ( result.error ) { alert("Error : " + result.error.mesage); }
else
{document.getElementById("feed_title").innerHTML=" "; }
}

// Find title of pic

function TransitionHandler(entry, transitionTime)
{

}

// Get the full size (picasa send thumb from s288

function UrlResolver (entry)
{

var c=entry.content; 
var s1 = c.indexOf("src=")+5;

var i = c.toUpperCase().indexOf(".jpg".toUpperCase(),s1); 
if (i==-1) {i=c.toUpperCase().indexOf(".gif".toUpperCase(),s1);}  
if (i==-1) {i=c.toUpperCase().indexOf(".png".toUpperCase(),s1);} 

var s2 = i + 4;  
var thumb= c.substring(s1,s2); 

// take the picture from s1600
  
thumb=thumb.replace("/s288/","/s1600/");
return(thumb);    
}        
  
google.load("feeds", "1");
google.setOnLoadCallback(load_feed);

_IG_Analytics("UA-442758-35", "/gg_1600_slide");  

</script>

<center><div id="feed_title"></div><div id="slide_box">Loading pictures...</div></center>

]]></Content>
</Module>
