<commit_before><%
remote_url = {:controller => 'chat', :action => 'say', :id => @channel}

loading_command = %(
  msg = '<div class="message" id="tmp_msg">' + time_and_name + '<span class="content">' + $('entryfield').value + '</span></div>';
  $('entryfield').value = ''; 
  $('entryfield').focus;
  new Insertion.Bottom('stage', msg);
  $('conversation').scrollTop = $('conversation').scrollHeight + $('conversation').clientHeight; )

complete = "eval(request.responseText)"
%>

<% content_for :style do %>
  @import url(/stylesheets/chat.css);
<% end %>

<div id="userlist">
  <%= render :partial => 'chat/userlist' %>
</div>

<div id="conversation">
  <div id="stage">
    <% for message in @messages -%>
    <%= message_content(message) %>
    <% end -%>
  </div>
</div>

<%= javascript_tag scroll_conversation_script %>
<%= javascript_tag set_time_and_name_script %>

<% form_remote_tag(:url => remote_url, :loading => loading_command, :complete => complete) do %>
<table id="typebox" cellpadding='0' cellspacing='0'>
<tr>
  <td width="1%" id='handle'><%= current_user.login %></td>
  <td width="99%">
    <% default_text = "Type your messages here and press enter..."[:type_your_messages_here] -%>
    <input id="entryfield" type="text" name="message" value="<%=default_text%>"
      onclick="if ($('entryfield').value == '<%=default_text%>') {$('entryfield').clear();}"
      />
    <input type="submit" value="Say" style="display: none;" />
  </td>
</tr>
</table>
<% end -%>

<%= # poll server every wait_time seconds for new messages
wait_time = 3
periodically_call_remote :url => { :controller => 'chat',
                                   :action => 'poll_channel_for_updates',
                                   :id => @channel},
                         :frequency => wait_time,
                         :complete => "eval(request.responseText)"
#                         :update => 'userlist'<commit_msg>Get rid of browser autofill on chat input field. fixes #943<commit_after><%
remote_url = {:controller => 'chat', :action => 'say', :id => @channel}

loading_command = %(
  msg = '<div class="message" id="tmp_msg">' + time_and_name + '<span class="content">' + $('entryfield').value + '</span></div>';
  $('entryfield').value = ''; 
  $('entryfield').focus;
  new Insertion.Bottom('stage', msg);
  $('conversation').scrollTop = $('conversation').scrollHeight + $('conversation').clientHeight; )

complete = "eval(request.responseText)"
%>

<% content_for :style do %>
  @import url(/stylesheets/chat.css);
<% end %>

<div id="userlist">
  <%= render :partial => 'chat/userlist' %>
</div>

<div id="conversation">
  <div id="stage">
    <% for message in @messages -%>
    <%= message_content(message) %>
    <% end -%>
  </div>
</div>

<%= javascript_tag scroll_conversation_script %>
<%= javascript_tag set_time_and_name_script %>

<% form_remote_tag(:url => remote_url, :loading => loading_command, :complete => complete) do %>
<table id="typebox" cellpadding='0' cellspacing='0'>
<tr>
  <td width="1%" id='handle'><%= current_user.login %></td>
  <td width="99%">
    <% default_text = "Type your messages here and press enter..."[:type_your_messages_here] -%>
    <input id="entryfield" type="text" name="message" autocomplete="off" value="<%=default_text%>"
      onclick="if ($('entryfield').value == '<%=default_text%>') {$('entryfield').clear();}"
      />
    <input type="submit" value="Say" style="display: none;" />
  </td>
</tr>
</table>
<% end -%>

<%= # poll server every wait_time seconds for new messages
wait_time = 3
periodically_call_remote :url => { :controller => 'chat',
                                   :action => 'poll_channel_for_updates',
                                   :id => @channel},
                         :frequency => wait_time,
                         :complete => "eval(request.responseText)"
#                         :update => 'userlist'
{'fraction_non_alphanumeric': 0.20061491160645656, 'fraction_numerical': 0.003843197540353574, 'mean_word_length': 3.4617142857142857, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 101, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1333901', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1212, 'n_words': 260}