<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
  <ModulePrefs  
    title="Xarxa de Blocs Sobiranistes" 
    title_url="http://www.xbs.cat" 
    description="Xarxa de Blocs Sobiranistes (XBS) aggregator. Network of Catalan Sovereigntist Blogs."
    author="Toni Hermoso Pulido"
    author_email="toniher@softcatala.org"
    author_affiliation="Xarxa de Blocs Sobiranistes"
    author_location="Barcelona, Catalan Countries"
    author_link="http://www.cau.cat"
    author_photo="http://www.cau.cat/pics/toniher-petit.png"
    author_aboutme="Catalan activist"
    author_quote="Visca la terra lliure, mori el mal govern!"
    screenshot="http://www.cau.cat/pics/xbs.png"
    thumbnail="http://www.cau.cat/pics/xbs.png"
    height="300"
    width="200"
    > 
  
  <Locale lang="ca" />  
<Require feature="analytics"/>
<Require feature="dynamic-height"/>
</ModulePrefs>
  
  <UserPref name="show_logo" display_name="Logo" datatype="bool"/>
  <UserPref name="show_summ" display_name="Resum" datatype="bool"/>
  <UserPref name="show_title" display_name="Titular" datatype="bool"/>
  <UserPref name="num_entries" display_name="No. entrades:" />
  <UserPref name="color_fons" display_name="Color del fons:" />
  <UserPref name="color_links" display_name="Color dels vincles:" />
  <UserPref name="color_text" display_name="Color del text:" />
  <Content type="html">
  <![CDATA[ 
  
  <style>
    a {text-decoration: none; font-weight: bold;}
    a:hover {text-decoration: underline;}
    #logo_div {text-align:center;}
    #logo_div img {border:0;}
    #content_div { font-size: 80%; margin: 3px 3px 3px 3px;}
    .feed_xbs {margin-bottom: 3px;}
    .resum_feed{padding-left: 2px;}
    #add_xbs {font-weight: bold; font-size: 75%; text-align: right; margin-top: 15px;}
    h3 {text-align: center;}
  </style>

    
 
    <div id="whole_container">
    <div id="logo_div"></div>
    <div id=content_div></div>
    </div>
    
      <script>
        _IG_Analytics("UA-1725441-1", "/xbs_gadget");
      </script>  
    
     <script type="text/javascript">
     // Get userprefs
     
     var prefs = new _IG_Prefs();
     var summary = prefs.getBool("show_summ");
     var entries = prefs.getInt("num_entries");
     var logo = prefs.getBool("show_logo");
     var title = prefs.getBool("show_title");
     var fons = prefs.getString("color_fons");
     var clink = prefs.getString("color_links");
     var ctext = prefs.getString("color_text");       
       
       
     // If user wants to display more than 10 entries, display an error
     // and set the value to 10, the max allowed.
     if (entries > 10)
     {
         alert("Limitat a 10 entrades.");
         entries = 10;
     }

     var element = document.getElementById('whole_container');
     element.style.backgroundColor = fons;  
     element.style.color = ctext;
     

         
     // Use the _IG_FetchFeedAsJSON() function to retrieve core feed data from
     // the specified URL. Then combine the data with HTML markup for display in
     // the gadget.
     _IG_FetchFeedAsJSON("http://feeds.feedburner.com/xbs",
              function(feed) { 
              if (feed == null){ 
                 alert("No hi ha dades al canal.");
                 return;
              }
     
         if (logo==true) { 
             var logo_html = "<a href='http://www.xbs.cat' target='_blank'><img src='http://www.cau.cat/pics/xbs.png' alt='Xarxa de Blocs Sobiranistes' title='Xarxa de Blocs Sobiranistes' /></a>";
            _gel("logo_div").innerHTML = logo_html;
         }
         // Start building HTML string that will be displayed in gadget.
         var html = "";
     
         if (title==true) { 
             html += "<h3><a href='http://www.xbs.cat' target='_blank'>Xarxa de Blocs Sobiranistes</a></h3>";

         }
       
         // Access the data for a given entry
         if (feed.Entry) {
             for (var i = 0; i < feed.Entry.length; i++) {
                 html += "<div class='feed_xbs'>"
                 + "<a target='_blank' href='" + feed.Entry[i].Link + "'>"
                 + feed.Entry[i].Title
                 + "</a> ";

                 if (summary==true) { 
                     html += "<br /><p class='resum_feed'><em>" + feed.Entry[i].Summary + "</em></p>";
                 }
                 html += "</div>";
             }
         }
       html += "<div id='add_xbs'><a href='http://xbs.cat/user/register' target='_blank'>Afegiu-vos-hi...</a></div>";
     _gel("content_div").innerHTML = html;
     _IG_AdjustIFrameHeight();
       
      //Color links
     var anchors = document.getElementsByTagName('a');
     var anLen = anchors.length;

     for (i = 0; i < anLen; i++) {
	
        anchors[i].style.color = clink;
        anchors[i].style.color.visited = clink;
     }  
       
     // The rest of the function parameters, which are optional: the number
     // of entries to return, and whether to return summaries.
     }, entries, summary);
 
  </script>
  ]]> 
  </Content>
</Module>