<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<!--  http://code.google.com/apis/gadgets/docs/dev_guide.html-->
<!--  http://code.google.com/apis/gadgets/docs/reference.html-->
  <ModulePrefs
    title="del.icio.us/__UP_D_USER__"
    title_url="http://del.icio.us/__UP_D_USER__"
    directory_title="Search your delicious tags live."
    description="Simply enter your username and start searching. If you add a new item, you
      may need to refresh the Google cache, so pick a new 'funny word' and you will be all set.
      Detailed documentation at http://wiki.drbeagle.com/del-icio-us-search-gadget"
    screenshot="http://drbeagledotcom.googlepages.com/delicious.png"
    thumbnail="http://drbeagledotcom.googlepages.com/delicioustb.png"
    author="Cameron Hall"
    author_email="drbeagledotcom+modulefeedback@gmail.com"
    author_affiliation="Cornell University Student"
    author_location="Ithaca, NY, USA"
    author_photo="http://drbeagledotcom.googlepages.com/profile.png"
    author_aboutme="2008 Information Science student at Cornell University. Enjoy doing work,
      but love getting distracted by google modules."
    author_link="http://drbeagle.com/"
    author_quote="So long, and thanks for all the fish"
    >
    <Require feature="dynamic-height" />
  </ModulePrefs>
  <UserPref name="D_USER" 
    display_name="delicious username" 
    datatype="string"
    required="true" />
  <UserPref name="FUNNY" 
    display_name="funny word"
    datatype="enum"
    default_value="taco">
    <EnumValue value="taco" display_value="taco"/>
    <EnumValue value="bananna" display_value="bananna"/>
    <EnumValue value="hotsauce" display_value="hotsauce"/>
    <EnumValue value="goldfish" display_value="goldfish"/>
    <EnumValue value="banjo" display_value="banjo"/>
  </UserPref>
  <UserPref name="FONTSZ" 
    display_name="font size" 
    datatype="string"
    default_value="8" />
  <Content type="html">
    <![CDATA[
      <div>
        <img src="http://images.del.icio.us/static/img/delicious.small.gif"
          height="10" width="10" alt="delicious" style="margin: 0 5px 0 0" />
        <input type="text" />
        <p style="font-size: __UP_FONTSZ__px; margin: 5px 0 0"></p>
      </div>
      <!--http://del.icio.us/help/api/-->
      <script type="text/javascript" 
        src="http://feeds.delicious.com/feeds/json/__UP_D_USER__?count=999amp;__UP_FUNNY__"></script>
      <script type="text/javascript">
        var t = document.getElementsByTagName('input');
        var p = document.getElementsByTagName('p');
			  t[0].style.width = p[0].offsetWidth-20;
        window.onload = letsGo;
        
        function letsGo() {
          t[0].onkeyup = search;
        }
        
        function search() {
          if (this.keyCode == 8) return;
          p[0].innerHTML = '';
          if(t[0].value != ''){
          var s = t[0].value.split(' ');
          var r = new Array();
          for(a in s){
          	if(s[a] != ''){
          		r[r.length] = new RegExp(s[a]);
          	}
          }
          for(e in Delicious.posts){
            var d = true;
            for(i in r){
              if(d){
                if(!(r[i].test(Delicious.posts[e].t))){
                  d = false;
                }
              }
            }
            if(d){
            	p[0].innerHTML += '<a target="_top" href="'+Delicious.posts[e].u+'">'
                +Delicious.posts[e].d+'</a><br />';
            }  
          }
        }
          _IG_AdjustIFrameHeight();
        }
        _IG_AdjustIFrameHeight();
      </script>
		]]>
  </Content>
</Module>