<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Google Mini Apps" 
            description="Displays gadgets recently submitted to the 
            Google Mini Apps directory. Also, 
            provides a searchbox and a form for submitting your own gadgets." 
            author="MiniApps"
            author_email="miniapps+miniapps-gadget@gmail.com"   
            author_affiliation="MiniApps."
            author_location="Sweden" 
            author_link="http://www.googleminiapps.com/" 
            title_url="http://www.googleminiapps.com/"  
            screenshot="http://miniapps.googlepages.com/miniapps_screenshot.png" 
            thumbnail="http://miniapps.googlepages.com/miniapps_thumbnail.png"  
            height="200"
            width="260" 
            scrolling="true" 
            singleton="false">
<Require feature="dynamic-height"/>
    <Require feature="setprefs"/>
  <Require feature="tabs"/>
  <Require feature="analytics"/>
</ModulePrefs>
<UserPref name="headerBackground" display_name="Header Background(default=#0996d8)" default_value="#0996d8"/>
<UserPref name="tabBackground" display_name="Tab Background(default=#fff)" default_value="#fff"/>  
<UserPref name="tabForeground" display_name="Tab Text Color(default=#0996d8)" default_value="#0996d8"/>
<UserPref name="tabFontSize" display_name="Tab Font Size(default=0.7em)" default_value="0.7em"/>
<UserPref name="listFontSize" display_name="List Font Size(default=0.7em)" default_value="0.7em"/> 
<UserPref name="linksColor" display_name="Links Color(default=#0996d8)" default_value="#0996d8"/> 
<UserPref name="visitedLinksColor" display_name="Visited Links Color(default=red)" default_value="red"/>
<UserPref name="hoverLinksColor" display_name="Hover Links Color(default=red)" default_value="red"/>   
<UserPref name="activeLinksColor" display_name="Active Links Color(default=red)" default_value="red"/>     
<UserPref name="entries" display_name="Number of Entries(default=4)" datatype="enum" default_value="4">
  <EnumValue value="1"/>
  <EnumValue value="2"/> 
  <EnumValue value="3"/>
  <EnumValue value="4"/>
</UserPref>
<UserPref name="summaries" display_name="Summaries(default=Titles + Screenshots)" datatype="enum" default_value="0">
  <EnumValue value="-1" display_value="Gadget Titles Only"/>
  <EnumValue value="0" display_value="Gadget Titles and Screenshots"/>
</UserPref>
<UserPref name="selectedTab" datatype="hidden"/>
<Content type="html" view="home,profile"><![CDATA[
<script language="javascript">
function formReset(){document.getElementById("myForm").reset();}

function trimURL(sInString) { 
sInString = sInString.replace( /^\s+/g, "" );
// strip leading 
return sInString.replace( /\s+$/g, "" );
// strip trailing
}
function checkForm() {
var url_value= document.submitgadgets.url.value;
var NewCount = 0;
if (document.submitgadgets.news.checked){NewCount = NewCount + 1}
if (document.submitgadgets.tools.checked){NewCount = NewCount + 1}
if (document.submitgadgets.communication.checked){NewCount = NewCount + 1}
if (document.submitgadgets.technology.checked){NewCount = NewCount + 1}
if (document.submitgadgets.lifestyle.checked){NewCount = NewCount + 1}
if (document.submitgadgets.finance.checked){NewCount = NewCount + 1}
if (document.submitgadgets.funandgames.checked){NewCount = NewCount + 1}
if (document.submitgadgets.sports.checked){NewCount = NewCount + 1}
if(url_value == null || trimURL(url_value) == "") {
var no_url_mess = document.getElementById("no_url_alert");
no_url_mess.style.color = "red";
no_url_mess.innerHTML = "<div id='redsmile'>OOps, no URL found :-)</div>";
return false;
}
else if (NewCount == 0 || NewCount >= 3){
var no_cat_mess = document.getElementById("no_cat_alert");
no_cat_mess.style.color = "red";
no_cat_mess.innerHTML = "<div id='redsmile'> 1 or 2 categories, please. :-)</div>";
return false;
}
else {
var gif = document.getElementById("loading");
loadinggif.style.visibility="hidden";
formReset();
loadinggif.style.visibility="hidden";
return true;
}
} 
</script> 
<style type="text/css">
body {height:200px;}
h2.entryTitle {
font-size:100%;
margin-bottom:0.3em;
font-weight:bolder;
}
.entrySummary {
/**/
}
.feedList {
width:100%;
overflow:hidden;
}
.feedList a:link {color: __UP_linksColor__}     /* unvisited link */
.feedList a:visited {color: __UP_visitedLinksColor__}  /* visited link */
.feedList a:hover {color: __UP_hoverLinksColor__}   /* mouse over link */
.feedList a:active {color: __UP_activeLinksColor__}   /* selected link */
  .tablib_table {
    font-size: __UP_tabFontSize__;
background:__UP_headerBackground__;
  }
  .tablib_selected, .tablib_unselected {
    width: 23%;
    height:3.5em;
    color:__UP_tabForeground__;
    background:__UP_tabBackground__;
    padding:3px;
  }
  .feedList {
    font-size:__UP_listFontSize__;
    margin:0;
    padding:0;
    overflow:hidden;
    /*border-bottom: 1px solid #000;*/
  }
  .feedList li {
    margin-bottom: 5px;
    padding: 3px 3px 0 3px;
    border-bottom: 1px solid #bbb;
  }
  .feedList li div.entryTitle a {
    font-weight: bolder;
    color:#0996d8;
  }
  .feedList li div.entryTimestamp {
    font-size: 0.95em;
    font-style: italic;
    color: #676767;
  }
#search-gadgets {
display:none;
font-size:0.7em;
}
#search-gadgets form {
padding:2px;
margin:0 5px 0 5px;
overflow:hidden;
}
#submitgadgets {
padding:2px;
margin:0 5px 0 5px;
overflow:hidden;
width:97%;
}
#submitgadgets table,#submitgadgets input {
font-size:0.7em;
}
#submitgadgets span.helptext {
font-size:1em;color:#aaa;
}
#submitgadgets h2 {
font-size:.9em;
margin-bottom:0.3em;
}
#submitgadgets h2#url-title {
margin-top:0;padding-top:0;
}
#submitgadgets td, #submitgadgets th {
text-align:left;
width:100px;
}

#submitgadgets #submit-button {
font-size:.9em;
margin-bottom:.5em;
}
#url, #tags {
width:90%;
}
.logo, .logo a {
border:none;
border-width:0;
}

  </style>
 <div id="search-gadgets"><a target="_blank" href="http://www.googleminiapps.com/"><img class="logo" alt="Google Mini Apps" src="http://miniapps.googlepages.com/logo_small.gif" /></a>

<!-- Google CSE Search Box Begins --><form target="_blank" action="http://www.googleminiapps.com/search-results/" id="searchbox_017897718807980037540:kk-_io2scn8"> <input type="hidden" name="cx" value="017897718807980037540:kk-_io2scn8" /> <input type="hidden" name="cof" value="FORID:11" /> <input type="text" name="q" size="25" /> <input type="submit" name="sa" value="Search" /></form><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_017897718807980037540%3Akk-_io2scn8&lang=en"></script><!-- Google CSE Search Box Ends -->



</div>
<script type="text/javascript"> 


  // Global variables
  var prefs = new _IG_Prefs(__MODULE_ID__);
  var tabs = new _IG_Tabs(__MODULE_ID__);
function analytics_click(t) {
_IG_Analytics('UA-2574778-1', '/googleminiapps_gadget/' + t);  
};

  /**
   * Initialize tabs when page loads.
   * Create tab for each userpref only if userpref is not empty.
   */
  function init() {
    
    var f1 = "http://www.googleminiapps.com/feed/";
    var f2 = "submit-gadgets";
    var f3 = "search-gadgets"
    var ft1 = _trim(prefs.getString("feedTitle1"));
    var ft2 = _trim(prefs.getString("feedTitle2"));
    var ft3 = _trim(prefs.getString("feedTitle3"));
   
    if (f1 != "") {
     tabs.addDynamicTab("Recent Gadgets", _IG_Callback(callbackTab, f1));    }
    if (f2 != "") {
      tabs.addDynamicTab("Submit Gadgets", _IG_Callback(callbackTab, f2));
    }
    if (f3 != "") {
      tabs.addDynamicTab("Search Gadgets", _IG_Callback(callbackTab, f3));
    }
    };

  /**
   * Fetches an Atom or RSS feed and generates content inside the
   * selected tab's content container.  This function is called whenever
   * a tab is selected.
   */
  function callbackTab(tabId, feedUrl) {
    var showFeedDesc = prefs.getBool("showFeedDesc");
    var summaries = prefs.getInt("summaries");
    var entries = prefs.getInt("entries");
    var container = _gel(tabId);
container.style.overflow="hidden";
    container.innerHTML ='<div style="width:100%;text-align:center;color:red;font-weight:bolder;margin:2px;padding:3px" id="loading">Loading...</div>';
    // Fetch feed and return it as a JSON object.
    // Callback function is defined within local scope.
    _IG_FetchFeedAsJSON(
      feedUrl,
      function(feed) {
      var logo = document.getElementById('search-gadgets');
      var loading_text = document.getElementById('loading');
      logo.style.display = "none";
        if(feedUrl=="submit-gadgets") { 
         container.innerHTML = '<a target="_blank" href="http://www.googleminiapps.com/">'+
'<img class="logo" alt="Google Mini Apps" src="http://miniapps.googlepages.com/logo_small.gif" /></a>'+
'<form target="_blank" name="submitgadgets" id="submitgadgets" method="post" action="http://www.googleminiapps.com/miniapps/gadget-submission/index.php5" onSubmit="return checkForm()" ><h2 id="url-title" >URL: <span class="helptext" id="no_url_alert">(google gadget xml file)</span></h2><input name="url" id="url" /><h2>Tags: <span class="helptext">(optional, up to 5 space separated)</span></h2> <input name="tags" id="tags" maxLength="60" /><h2>Categories: <span class="helptext" id="no_cat_alert">(required, choose 1 or 2)</span></h2><table id="category-table"><tr><th>News</th><th>Tools</th></tr><tr><td><input type="checkbox" name="news" value="News" /></td><td><input type="checkbox" name="tools" value="Tools" /></td></tr><tr><th>Communication</th><th>Fun & Games</th></tr><tr><td><input type="checkbox" name="communication" value="Communication" /></td><td><input type="checkbox" name="funandgames" value="Funandgames" /></td></tr><tr><th>Finance</th><th>Sports</th></tr><tr><td><input type="checkbox" name="finance" value="Finance" /></td><td><input type="checkbox" name="sports" value="Sports" /></td></tr><tr><th>Lifestyle</th><th>Technology</th></tr><tr><td><input type="checkbox" name="lifestyle" value="Lifestyle" /></td><td><input type="checkbox" name="technology" value="Technology" /></td></tr></table><input id="submit-button" type="submit" value="Submit Gadget" /><span style="margin-left:10px;visibility:hidden" id="loading">Processing...<img style="height:16px;width:16px;border:none;margin-left:10px" width="16" src="http://www.googleminiapps.com/miniapps/images/loading.gif" height="16" style="width: 16px; height: 16px" id="loading_img" /></span><input name="gma" type="hidden" /></form>'; 



      



}
        else if(feedUrl=="search-gadgets" || feedUrl=="submit-gadgets") {
        logo.style.display = "block";
        container.style.display="none";
        } 
        else if (typeof feed == "undefined" || typeof feed.Entry == "undefined") {
         container.innerHTML = '<div class="statusLabel">Invalid feed URL:<br>' + feedUrl + '</div>';
        }
        else {
          // Fetch feed successful.  Generate HTML content from returned JSON object.
          // Create feed header containing title and description.
          var html = new Array();
          
          html.push('<div id="wrapper"><a target="_blank" href="http://www.googleminiapps.com/"><img class="logo" alt="Google Mini Apps" src="http://miniapps.googlepages.com/logo_small.gif" /></a>'); 
          // Iterate through each feed entry and generate list of content.
          html.push('<ul class="feedList">');
          for (var n = 0; n < feed.Entry.length; n++) {
            var entry = feed.Entry[n];
            html.push('<li>');
            html.push('<h2 class="entryTitle"> <a onClick="analytics_click(entry.Title)" class="title" target="_blank" href="' + entry.Link + '">' + _hesc(entry.Title) + '</a></h2>');
            if (typeof entry.Summary != "undefined" && entry.Summary != "") {
              var summary = document.createElement("div");
              summary.innerHTML = (summaries == 0) ? entry.Summary : entry.Summary.substr(0, summaries);
              html.push('<div class="entrySummary">');
              html.push(summary.innerHTML);
              html.push('</div>');
            }
            html.push('</li>');
          }
          html.push('</ul></div>');
          container.innerHTML = html.join("");
        }

        // Resize iframe height to fit content.
       _IG_AdjustIFrameHeight(200);
      },
      entries,
      (summaries > -1)
    );
  }
 setTimeout('_IG_AdjustIFrameHeight(200)', 700);     
_IG_AdjustIFrameHeight(200); 
  // Set onload event handler to call init()
  _IG_RegisterOnloadHandler(init);
  _IG_Analytics("UA-2574778-1", "/googleminiapps_gadget/home-view");
  </script>
]]>
</Content>

<Content type="html" view="canvas"><![CDATA[
<style type="text/css">
body {
min-width:800px;
width:100%;
height:100%;
}
#canvas-wrap {
min-width:800px;
width:100%;
margin:0;
padding:0;
text-align:left;
}
</style>
<div id="canvas-wrap">
<iframe src="http://www.googleminiapps.com/" width="100%" height="3500px" frameborder="0" scrolling="no"></iframe>
</div>
<script type="text/javascript">
_IG_AdjustIFrameHeight();
_IG_Analytics("UA-2574778-1", "/googleminiapps_gadget/canvas-view");
</script>

 ]]>
</Content>
</Module>





























































































