/*
 *
 */

jQuery(function($) { 

  function processPerson( n, peep ) {
    var previous_node_id = ( n == 0 ) ? "#followMe" : "#peep" + (n-1);
    if( "default_icon.png" == peep.icon )
    {
      peep.icon = "/images/" + peep.icon;
    }
    $("<div id=\"peep" + n + "\" style=\"float: left;\"></div>").insertAfter(previous_node_id);
    $('#peep' + n).html("<img src=\"" + peep.icon + "\" title=\"" + peep.name + "\"</>");
  }

  $("#req_due_date").datepicker({
buttonImage: "/images/calendar.gif",
buttonImageOnly: true
    });
  $("#req_category_ids").change( 
    function(){ var category_id = $(this).val();
                $.getJSON( '/categories/' + category_id, '', function(data){peeps = data.category.people;$.each(peeps,processPerson);});
              });
});

@@ -5,16 +5,38 @@
  *%0D%0A */%0D
+%0Avar OSCURRENCY = %7B%7D;%0D
 %0A%0D%0AjQuer
@@ -90,24 +90,268 @@
 , peep ) %7B%0D%0A
+    // make sure this peep isn't already on list%0D%0A    //%0D%0A    for(var k = 0; k %3C OSCURRENCY.peeps.length; k++)%0D%0A    %7B%0D%0A      if(peep.id == OSCURRENCY.peeps%5Bk%5D.id)%0D%0A      %7B%0D%0A        return;%0D%0A      %7D%0D%0A    %7D%0D%0A%0D%0A    OSCURRENCY.peeps.push(peep);%0D%0A%0D%0A
     var prev
@@ -542,16 +542,35 @@
  n + %22%5C%22
+ class=%5C%22peepnode%5C%22
  style=%5C
@@ -724,16 +724,493 @@
 %0A  %7D%0D%0A%0D%0A
+  function processJSONResponse(data) %7B%0D%0A    OSCURRENCY.category_people%5BOSCURRENCY.i%5D = data.category.people;%0D%0A    OSCURRENCY.i++;%0D%0A    if( OSCURRENCY.category_ids.length == OSCURRENCY.i )%0D%0A    %7B%0D%0A      for(var j = 0; j %3C OSCURRENCY.category_ids.length; j++)%0D%0A      %7B%0D%0A        $.each(OSCURRENCY.category_people%5Bj%5D,processPerson);%0D%0A      %7D%0D%0A    %7D%0D%0A    else%0D%0A    %7B%0D%0A      $.getJSON( '/categories/' + OSCURRENCY.category_ids%5BOSCURRENCY.i%5D, '', processJSONResponse);%0D%0A    %7D%0D%0A  %7D%0D%0A%0D%0A
   $(%22#re
@@ -1306,16 +1306,18 @@
    %7D);%0D%0A
+%0D%0A
   $(%22#re
@@ -1359,20 +1359,27 @@
 tion()%7B 
-var 
+OSCURRENCY.
 category
@@ -1381,16 +1381,17 @@
 egory_id
+s
  = $(thi
@@ -1421,126 +1421,338 @@
     
-$.getJSON( '/categories/' + category_id, '', function(data)%7Bpeeps = data.category.people;$.each(peeps,processPerson);%7D
+OSCURRENCY.category_people = %5B%5D;%0D%0A                $('.peepnode').remove();%0D%0A                OSCURRENCY.i = 0; // category counter%0D%0A                OSCURRENCY.j = 0; // people counter%0D%0A                OSCURRENCY.peeps = %5B%5D;%0D%0A                $.getJSON( '/categories/' + OSCURRENCY.category_ids%5BOSCURRENCY.i%5D, '', processJSONResponse
 );%0D%0A

make ajaxy request notification target stuff more robust