<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
  <ModulePrefs  
    title="Blognone" 
    title_url="http://www.blognone.com/" /> 
  <UserPref name="bgcolor" display_name="Background" default_value="FFFFFF"/>
  <UserPref name="size" display_name="Font-Size" default_value="small"/>

  <Content type="html">
  <![CDATA[ 
 
    <div id=content_div></div>
     <script type="text/javascript">
     // Get userprefs
     var prefs = new _IG_Prefs(__MODULE_ID__);
     //var showdate = prefs.getBool("show_date");
     //var summary = prefs.getBool("show_summ");
     var bgcolor = prefs.getString("bgcolor");
     var fontsize = prefs.getString("size");
     var entries = 10;

     // If user wants to display more than 100 entries, display an error
     // and set the value to 100, the max allowed.
     if (entries > 100)
     {
         alert("You cannot display more than 100 entries.");
         entries = 100;
     }

     // 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/blognone/BNBN",
              function(feed) { 
              if (feed == null){ 
                 //alert("There is no data.");
                 return;
              }
     
         // Start building HTML string that will be displayed in gadget.
         var html = "<style> #content_div {background-color: #"+ bgcolor + ";} </style>";

         // Access the fields in the feed
         //html += "<div><h3>" + feed.Title + "</h3></div>";
         //html += "<div>" + feed.Description + "</div><br>";
     
         // Access the data for a given entry
         if (feed.Entry) {
             for (var i = 0; i < feed.Entry.length; i++) {
                 html += "<div style=\"font-size:"+fontsize+"\">"
                 + "<a target='_blank' href='" + feed.Entry[i].Link + "'>"
                 + feed.Entry[i].Title
                 + "</a> ";
                 html += "</div>";
             }
         }
     _gel("content_div").innerHTML = html;

     // The rest of the function parameters, which are optional: the number
     // of entries to return, and whether to return summaries.
     }, entries);
 
  </script>
  ]]> 
  </Content>
</Module>
