<commit_before><% live_search = active_scaffold_config.search.live? -%>
<% url_options =  params_for(:action => :index, :escape => false).delete_if{|k,v| k == 'search'} -%>
<%=
options = {:id => search_form_id,
           :class => "as_form search",
           :remote => true,
           :method => :get}
options['data-loading'] = true unless live_search
  form_tag url_options, options %>
  <%= text_field_tag :search, search_params, :class => 'text-input', :id => search_input_id, :size => 50, :autocompleted => :off %>
  <%= submit_tag as_(:search), :class => "submit" unless live_search %>
  <%= link_to as_(:reset), url_for(url_options.merge(:search => '')), :class => 'as_cancel', :remote => true %>
  <%= loading_indicator_tag(:action => :search) %>
</form>

<script type="text/javascript">
//<![CDATA[
  new TextFieldWithExample('<%= search_input_id %>', '<%= as_(live_search ? :live_search : :search_terms) %>', {focus: true});
<% if live_search -%>
  new Form.Element.DelayedObserver('<%= search_input_id %>', 0.5, function(element, value) {
    if (!$(element.id)) return false; // because the element may have been destroyed
    $(element).up('form').onsubmit();
  });
<% end -%>
//]]>
</script><commit_msg>live_search in Rails 3<commit_after><% live_search = active_scaffold_config.search.live? -%>
<% url_options =  params_for(:action => :index, :escape => false).delete_if{|k,v| k == 'search'} -%>
<%=
options = {:id => search_form_id,
           :class => "as_form search",
           :remote => true,
           :method => :get}
options['data-loading'] = true unless live_search
  form_tag url_options, options %>
  <%= text_field_tag :search, search_params, :class => 'text-input', :id => search_input_id, :size => 50, :autocompleted => :off %>
  <%= submit_tag as_(:search), :class => "submit" %>
  <%= link_to as_(:reset), url_for(url_options.merge(:search => '')), :class => 'as_cancel', :remote => true %>
  <%= loading_indicator_tag(:action => :search) %>
</form>

<script type="text/javascript">
//<![CDATA[
  new TextFieldWithExample('<%= search_input_id %>', '<%= as_(live_search ? :live_search : :search_terms) %>', {focus: true});
<% if live_search -%>
  $('<%= search_input_id %>').next().hide();
  new Form.Element.DelayedObserver('<%= search_input_id %>', 0.5, function(element, value) {
    if (!$(element.id)) return false; // because the element may have been destroyed
    $(element).next().click();
  });
<% end -%>
//]]>
</script>
{'fraction_non_alphanumeric': 0.21272285251215559, 'fraction_numerical': 0.003646677471636953, 'mean_word_length': 4.548314606741573, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 66, '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': '3940452', 'n_tokens_mistral': 873, 'n_tokens_neox': 820, 'n_words': 176}