<commit_before>- title "Chat"

.chat
  .row
    .large-10.columns.main-chat
      .chats 
        .chat-display
          .chat-text
            %ul
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p You around?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Yep, stuck here for the next 4 hours.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p What kind of structure would I need to get something similar to the Hipchat web chat interface
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Sorry, not sure what you mean by structure?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p I can't figure out the HTML/CSS.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p You around?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Yep, stuck here for the next 4 hours.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p What kind of structure would I need to get something similar to the Hipchat web chat interface
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Sorry, not sure what you mean by structure?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p I can't figure out the HTML/CSS.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              
              
    .large-2.columns.onlineUsers
      %h4 Online Users
      %p Loading...
  
  .row
    .large-10.columns
      %form.sendMessage
        .row.collapse
          .small-12.columns
            .small-10.columns
              %input.message(type="text")
            .small-2.columns
              %input.button.prefix(type="submit" value="send")

:coffee
  onlineUsersTemplate = Hogan.compile "
    <h4>Online Users</h4>
    <ul>
      {{#user}}
        <li><a href='{{url}}'>{{name}}</a></li>
      {{/user}}
    </ul>"
  ping = ->
    $.getJSON "/chat/ping", (d) ->
      $(".onlineUsers").html onlineUsersTemplate.render {user: d}
  ping()
  setInterval ping, 8000

  $("form.sendMessage").submit ->
    console.log $("input.message").val()
    return false
 
<commit_msg>Automatically scroll to the bottom.<commit_after>- title "Chat"

.chat
  .row
    .large-10.columns.main-chat#mainChatScroll
      .chats 
        .chat-display
          .chat-text
            %ul
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p You around?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Yep, stuck here for the next 4 hours.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p What kind of structure would I need to get something similar to the Hipchat web chat interface
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Sorry, not sure what you mean by structure?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p I can't figure out the HTML/CSS.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p You around?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Yep, stuck here for the next 4 hours.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p What kind of structure would I need to get something similar to the Hipchat web chat interface
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/002/thumb/avatar.jpg?1362317029", :class => "avatar-image"
                .large-11.columns.message.current-user
                  %span.name= link_to "JoshFabian", "#"
                  %p Sorry, not sure what you mean by structure?
                .large-1.columns.time-stamp
                  %p 1 hour ago
              %li.message-block
                .large-1.columns.avatar
                  = image_tag "http://hummingbird.ly/system/users/avatars/000/000/001/thumb/av.jpg?1362343675", :class => "avatar-image"
                .large-11.columns.message
                  %span.name= link_to "Vikhyat", "#" 
                  %p I can't figure out the HTML/CSS.
                .large-1.columns.time-stamp
                  %p 1 hour ago
              
              
    .large-2.columns.onlineUsers
      %h4 Online Users
      %p Loading...
  
  .row
    .large-10.columns
      %form.sendMessage
        .row.collapse
          .small-12.columns
            .small-10.columns
              %input.message(type="text")
            .small-2.columns
              %input.button.prefix(type="submit" value="send")

:coffee
  onlineUsersTemplate = Hogan.compile "
    <h4>Online Users</h4>
    <ul>
      {{#user}}
        <li><a href='{{url}}'>{{name}}</a></li>
      {{/user}}
    </ul>"
  ping = ->
    $.getJSON "/chat/ping", (d) ->
      $(".onlineUsers").html onlineUsersTemplate.render {user: d}
  ping()
  setInterval ping, 8000

  $("form.sendMessage").submit ->
    console.log $("input.message").val()
    return false
  
  updateChatScroll = ->
    c = document.getElementById("mainChatScroll");
    c.scrollTop = c.scrollHeight;
  updateChatScroll()

{'fraction_non_alphanumeric': 0.1253137325206167, 'fraction_numerical': 0.04643241305127286, 'mean_word_length': 1.4291312867406925, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7124629', 'n_tokens_mistral': 3799, 'n_tokens_neox': 3279, 'n_words': 602}