﻿<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Google Gadget to display a Feed"
title_url="http://sites.google.com/site/annuairevin/"
height="500"
width="300"
scrolling="false"
directory_title="Google Gadget to display a Feed"
description="Google Gadget to add a Feed. Displaying a feed in a Site or a Blog"
screenshot="http://winepic061.googlepages.com/feed-screen.png"
thumbnail="http://winepic061.googlepages.com/google-code.png"
author="Philippe Chappuis"
author_email="philippe.chappuis+gadgetCSE@gmail.com"
author_affiliation="Google"
author_location="Rolle Switzerland"
author_link="http://philippe.chappuis.googlepages.com"
author_photo="http://winepic02.googlepages.com/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">

</ModulePrefs>

<UserPref name="Flux" display_name="Flux" required="true" default_value="http://viti-vino-feed.blogspot.com/feeds/posts/default" />
<UserPref name="Nombre" display_name="Nombre d'entrées" datatype="string" default_value="12" />

<UserPref name="Link" display_name="Lien" required="true" default_value="http://viti-vino-feed.blogspot.com" />

<UserPref name="Couleur_Fond" display_name="Couleur fond container" required="true" default_value="#d1dae3" />
<UserPref name="Couleur_Police" display_name="Couleur police" required="true" default_value="#660000" />
<UserPref name="Couleur_Titre" display_name="Couleur fond titre" required="true" default_value="#c3d9ff" />
<UserPref name="Couleur_Bord" display_name="Couleur bord" required="true" default_value="#cc0000" />


<Content type="html"><![CDATA[

<style type="text/css">
body
{
background: transparent;
padding: 0;
margin:0;
}

#feed_container
{
font-size: 1em;
color: __UP_Couleur_Police__;
margin: 5px; padding: 8px;
font-family: Arial, Helvetica, sans-serif;
background-color: __UP_Couleur_Fond__;
border: solid 2px __UP_Couleur_Bord__;
}

#titre
{
font-size: 1.1em;
font-weight: bold;
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
background-color: __UP_Couleur_Titre__;
}

#description
{
font-size: 0.9em;
font-weight: bold;
font-style: italic;
text-align: left;
margin-top: 15px;
margin-bottom: 15px;
color: __UP_Couleur_Police__;
background-color: __UP_Couleur_Titre__;
}

.ligne
{
font-size: 0.8em;
font-weight: normal;
text-align: left;
margin-top: 15px;
margin-bottom: 15px;
background-color: __UP_Couleur_Titre__;
}


.lien a:link
{
text-decoration: none;
color: __UP_Couleur_Police__;
}

.lien a:visited
{
text-decoration: none;
color: __UP_Couleur_Police__;
font-style: italic;
}

.lien a:focus
{
text-decoration: none;
color: __UP_Couleur_Bord__;
font-weight: bold;
background-color: __UP_Couleur_Fond__;
}

.lien a:hover
{
text-decoration: none;
color: __UP_Couleur_Bord__;
font-weight: bold;
background-color: __UP_Couleur_Fond__;


.lien a:active
{
text-decoration: none;
color: __UP_Couleur_Bord__;
font-weight: bold;
background-color: __UP_Couleur_Fond__;

</style>

<div id="feed_container"></div>

<script type="text/javascript">

var s

var prefs = new _IG_Prefs(__MODULE_ID__);

var s_url = _trim(prefs.getString("Flux"));
s_url = s_url.replace("'"," ");
s_url = s_url.replace(" ","%20");


var s_lnk = _trim(prefs.getString("Link"));
s_lnk = s_lnk.replace("'"," ");
s_lnk = s_lnk.replace(" ","%20");


var entries = prefs.getInt("Nombre");

if (entries > 100)
{alert("Au plus 100 entrées");entries = 100;}

_IG_FetchFeedAsJSON(s_url,



function(feed) {
if (feed == null)
{
alert("Le Flux est vide");
return;
}

var html = "<div id='titre' class='lien'><a href='" + s_lnk + "' title='" +
feed.Title + "' target='_blank'>" + feed.Title + "</a></div>" +
"<div id='description'>" + feed.Description +
"&nbsp;&nbsp;<a href='" +
s_url + "' target='_blank' title='Souscrire'><img src='http://winepic061.googlepages.com/subscribe-feed.gif' style='border: 0 none;' title='Souscrire' alt='.'></a></div>";


if (feed.Entry) {
for (var i = 0; i < feed.Entry.length; i++)
{
s=feed.Entry[i].Title.replace("'"," ");
html = html + "<div class='ligne lien'>"
+ "<a target='_blank' href='" + feed.Entry[i].Link + "' title='" + s + "'>"
+ feed.Entry[i].Title
+ "</a></div>";
}
}
_gel("feed_container").innerHTML = html;

}, entries, 1);

</script>





]]></Content>
</Module>
