/ * Users */
function User(username, id) {
  this.username = username;
  this.id = id;
}

/* Comments */
function Comment(text, date, username) {
  this.text = text;
  this.date = date;
  this.username = username;

  /**
   * param commentList an html <ul> element
   */
  this.draw = function(commentList) {
    var html = $('<li class="inline_comment"><a class="manager_link_comment" href="/' + this.username + '">' + this.username + '</a> - ' + this.text + '  <span class="comment_timestamp">' + this.date + '</span></li>');
    html.appendTo(commentList);
  }

}

/* Feed Items */
function FeedItem(feedItemId, feedItemElement, commentLink, commentFormBlock, voteBox) {
  this.id = feedItemId;
  this.container = feedItemElement;
  this.commentLink = commentLink;
  this.commentFormBlock = commentFormBlock;
  this.voteBox = voteBox;
  this.voteUpIcon;
  this.voteDownIcon;
  this.commentForm;
  this.commentFormInput;
  this.commentFormSubmit;
  this.commentFormCancel;
  this.commentList;

  this.findCommentForm = function() {
    this.commentForm = $("form", this.container);
  }

  this.findCommentFormInput = function() {
    this.commentFormInput = $("input[name=text]", this.container)[0];
  }

  this.findCommentFormSubmit = function() {
    this.commentFormSubmit = $(".inline_comment_submit", this.container)[0];
  }
  
  this.findCommentFormCancel = function() {
    this.commentFormCancel = $(".inline_comment_cancel", this.container);
  }

  this.findCommentList = function() {
    this.commentList = $("ul", this.container)[0];
  }

}