<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Slang O The Day" directory_title="Slang O The Day" title_url="http://slang.otheday.com" description="Get the 411 on American and English slang delivered everyday by the peeps at Slang O The Day." author_affiliation="OTheDay.com" author="H. Wallace" author_email="slang+gadget@otheday.com" screenshot="http://slang.otheday.com/images/GoogleGadgetScreenShot.png" thumbnail="http://slang.otheday.com/images/GoogleGadgetThumbnail.png" height="100"> 
    <Require feature="dynamic-height"/>
  </ModulePrefs>

<UserPref name="num_entries" display_name="Number of Entries?" default_value="3" datatype="enum">
<EnumValue value="1"/>
<EnumValue value="2"/>
<EnumValue value="3"/>
<EnumValue value="4"/>
<EnumValue value="5"/>
<EnumValue value="6"/>
<EnumValue value="7"/>
<EnumValue value="8"/>
<EnumValue value="9"/>
</UserPref>

<Content type="html">
<![CDATA[
<style> #OUT__MODULE_ID__ { font-size: 80%; margin: 5px;} </style>

<div id=OUT__MODULE_ID__></div>
<script type="text/javascript">
// Tells gadget to resize itself
       _IG_AdjustIFrameHeight();

// Get userprefs
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");

document.bgColor = prefs.getString("bgcolor");

// 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/SlangOTheDay",
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 += "<div><b>" + feed.Title + "</b></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>"
+ "<a href='" + feed.Entry[i].Link + "' target='" + feed.Entry[i].Title + "'>"
+ 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 += "<br>" + date.toLocaleDateString();
html += " ";
html += date.toLocaleTimeString();
}
if (summary==true) {
html += "<br><i>" + feed.Entry[i].Summary + "</i>";
}
html += "</div><br>";
}
}
_gel("OUT__MODULE_ID__").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>