public/main.js
// populates the "send to" combo box with all users on the chat
populates the "send to" combo box with all users on the chat
populates the " send to " combo box with all users on the chat
function updateUserCombo(objusers) 
  {
	  var selectbox = $('#sendTo');
	  var currvalue = $("#sendTo option:selected").text();
	  $('#sendTo option').remove();
	  for(var propt in objusers)
	  {
		    $('<option/>').val(objusers[propt]).html(objusers[propt]).appendTo('#sendTo');
	  }
  }
function updateUserCombo ( objusers ) { var selectbox = $ ( '#sendTo' ) ; var currvalue = $ ( "#sendTo option:selected" ) . text ( ) ; $ ( '#sendTo option' ) . remove ( ) ; for ( var propt in objusers ) { $ ( '<option/>' ) . val ( objusers [ propt ] ) . html ( objusers [ propt ] ) . appendTo ( '#sendTo' ) ; } }
populates the "send to" combo box with all users on the chat
populates the " send to " combo box with all users on the chat
// get the current selected value // clear the list of values // populate user drop-down now //alert(propt + ': ' + objusers[propt]); //set the selected value /*	  if ((currvalue !== undefined) && (currvalue != ""))
		  for(var i = 0, j = selectbox.options.length; i < j; ++i) 
		  {
	        if(selectbox.options[i].innerHTML === currval) 
	        {
	        	selectbox.selectedIndex = i;
alert("DEBUG - found item " + i);
	        	break;
		    }
		  }*/