<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
   <ModulePrefs title="Bancuri Noi" 
                description="Bancuri noi de pe www.yeti.ro" 
                author="T. Ionut" 
                author_email="admin@yeti.ro" 
        author_link="http://www.yeti.ro"
                title_url="http://www.yeti.ro" 
                screenshot="http://www.yeti.ro"
        thumbnail="http://www.yeti.ro" /> 
  <UserPref name="show_date" display_name="Afisez data?" datatype="bool"/>
  <UserPref name="show_summ" display_name="Afisez rezumat?" datatype="bool"/>
  <UserPref name="num_entries" display_name="Numar articole:" />
  <Content type="html">
  <![CDATA[ 
    <style> 
         #content_div p{font-size: 80%; background-color: #82CAFF;}
         #content_div p1{font-size:large; background-color: #38ACEC; margin-left: 140px;}
         #content_div div:first-letter {color:#6D7B8D; font-size: large}
         #content_div div {margin-top: 10px;}

         #content_div {font-size: 80%;  margin: 3px; background-color: #38ACEC; padding: 2px; outline: #000000 solid 3px} 
         #content_div a:link, a:visited, a:active {text-decoration: none; color: #ffffff;}
         #content_div a:hover {text-decoration: none; color: #6D7B8D;}     
    </style>
 
    <div id=content_div></div>
     <script type="text/javascript">

     var prefs = new _IG_Prefs(__MODULE_ID__);
     var showdate = prefs.getBool("show_date");
     var summary = prefs.getBool("show_summ");
     var entries = prefs.getInt("num_entries");

     if (entries > 100)
     {
         alert("You cannot display more than 100 entries.");
         entries = 100;
     }

     _IG_FetchFeedAsJSON("http://www.yeti.ro/feed/)",
              function(feed) { 
              if (feed == null){ 
                 alert("There is no data.");
                 return;
              }
     
         // Start building HTML string that will be displayed in gadget.
         var html = "";

         // Access the fields in the feed
         html += "<p>" + feed.Description + "</p>";
         html += "<p1><b>" + feed.Title + "</b></p1>";
         
     
         // Access the data for a given entry
         if (feed.Entry) {
             for (var i = 0; i < feed.Entry.length; i++) {
                 html += "<div>"
                 + "<a target='_blank' href='" + feed.Entry[i].Link + "'>"
                 + feed.Entry[i].Title
                 + "</a>";
                
                 if (showdate==true)
                 { 
                     // The feed entry Date field contains the timestamp in seconds
                     // since Jan. 1, 1970. To convert it to the milliseconds needed
                     // to initialize the JavaScript Date object with the correct date, 
                     // multiply by 1000.
                     var milliseconds = (feed.Entry[i].Date) * 1000; 
                     var date = new Date(milliseconds); 
                     html += date.toLocaleDateString();
                     html += " ";
                     html += date.toLocaleTimeString(); 
                 } 
                 if (summary==true) { 
                     html += "<br><i>" + feed.Entry[i].Summary + "</i>";
                 }
                 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, summary);
 
  </script>
  ]]> 
  </Content>
</Module>
