<?xml version="1.0" encoding="UTF-8"?>
<Module>
  <ModulePrefs title="del.icio.us (__UP_username__)" height="300" 
    author="Bruno Campagnolo de Paula" 
    author_email="brunodepaula@gmail.com" > 
     <Require feature="opensocial-0.5"/> 
  </ModulePrefs>
    <UserPref name="username" 
    display_name="Username?" 
    datatype="string" 
    required="true" 
    /> 
    <UserPref name="title" 
    display_name="Title?" 
    datatype="string" 
    required="true"
    default-value="My del.icio.us"
    /> 
    <UserPref name="atleast" 
    display_name="At Least?" 
    datatype="string" 
    required="true"
    default-value="10" 
    /> 
    <UserPref name="count" 
    display_name="Count?" 
    datatype="string" 
    required="true"
    default-value="100" 
    /> 
    <UserPref name="minposts" 
    display_name="Min Posts?" 
    datatype="string" 
    required="true"
    default-value="100" 
    /> 
  <Content type="html">
    
  <![CDATA[ 
  <style type="text/css">
  .delicious-tags{font-family:arial,sans-serif}
    .delicious-tags a img{border:0;display:inline;margin:0 0 0 3px;padding:0}
    .delicious-tags a{text-decoration:none}
    .delicious-tags a:hover{text-decoration:underline}
    .delicious-tags ul{list-style-type:none;margin:0;padding:0; text-align:justify}
    .delicious-cloud li{
         display:inline;
         text-align:justify;
         background-image:none !important;
         padding:0;margin:0;
         vertical-align:baseline !important;
          }
    .delicious-cloud {}
    .delicious-tag-count{padding-left:0.2em;font-size:9px;color:#000}
    .delicious-cloud li:before{content:"" !important}
</style>
  
  
     <a name="adelicious1"></a>
     <script type="text/javascript" src="http://del.icio.us/feeds/js/__UP_username__?tags;extended;title=__UP_title__;bullet=%E2%80%A2;icon;name;showadd"></script><noscript><a href="http://del.icio.us/__UP_username__">__UP_title__</a></noscript><br>
     <a name="adelicious2"></a>
     <div id="delicious2" class="delicious-tags"><noscript>Javascript must be enabled for Categories</noscript>
     <script type="text/javascript" src="http://del.icio.us/feeds/json/tags/__UP_username__?atleast=__UP_atleast__&amp;sort=count"></script>
     </div>
     <script type="text/javascript">       
      
       
      // User defined Variables
      var maxFontSize = 40;
      var maxColor = [0xE5,0x56,0x00]//[0,0,255];
      var minFontSize = 11;
      var minColor = [0x87,0xCE,0xEB]// #E55600
      var showCount = true;

      // No More Edits Past this Line
      // ta is for Number of Items Displayed - First Slider on Delicious Tag Setup Page
      // Keep it at 0 to show all tags
      var ta=0
      var c=[];
      // Make some arrays to get the number of matching hits ( the spread )
      // Spread goes to tz
      var delCount = new Array();
      for (p in Delicious.tags){
         if (!delCount[Delicious.tags[p]]){
           delCount[Delicious.tags[p]] = new Array(Delicious.tags[p])
       }
      }
      tz = delCount.length-1;
      del2 = document.getElementById('delicious2');
      // The following function taken directly from the guts of the Delicious Cloud

      function s(a,b,i,x){
         if(a>b){
           var m=(a-b)/Math.log(x),v=a-Math.floor(Math.log(i)*m)
       }
       else{
           var m=(b-a)/Math.log(x),v=Math.floor(Math.log(i)*m+a)
       }
         return v
       }
      ul = document.createElement('ul');
      ul.className = "delicious-cloud";
      for(var t in Delicious.tags){
         for (var i=0;i<3;i++) 
         {
             c[i]=s(minColor[i],maxColor[i],Delicious.tags[t]-ta,tz)
         }
         // Strip out the underscores for the Displayed Text 
         var strip = t.replace(/_/g,' ');
         var fs = s(minFontSize,maxFontSize,Delicious.tags[t]-ta,tz);
         li = document.createElement('li');
         li.style.fontSize = fs+'px';
         li.style.lineHeight = "1";
         a = document.createElement('a');
         a.style.color = 'rgb('+c[0]+','+c[1]+','+c[2]+')';
        // Point the links at the Category Post
       var delTagPost = "http://del.icio.us/__UP_username__/";
        a.href = delTagPost+encodeURIComponent(t)+'?setbundleview=show&setcount=__UP_count__&setminposts=__UP_minposts__';
       if (showCount){
           span = document.createElement('span');
           span.innerHTML = '('+Delicious.tags[t]+') ';
           span.className = 'delicious-tag-count';
           a.appendChild(document.createTextNode(strip));
           li.appendChild(a);
           li.appendChild(span);
       }
       else {
            a.appendChild(document.createTextNode(strip+' '));
            li.appendChild(a);
       }
       ul.appendChild(li);
   }
  del2.appendChild(ul);
</script>
  ]]> 
  </Content>
</Module>  