<commit_before>// Handles search filter functionality.
define([
  'search/filter/TextInput',
  'search/filter/CheckboxSubtractive',
  'util/geolocation/geolocate-action',
  'app/alert-manager',
  'domReady!'
],
function (TextInput, CheckboxSubtractive, geo, alert) {
  'use strict';

  // The form to submit.
  var _searchForm;

  // Main module initialization.
  function init() {
    // Set up geolocation button.
    geo.init('button-geolocate', _geolocationClicked);

    // Set up text input filters
    var keyword = TextInput.create('keyword-search-box');
    keyword.addEventListener('change', _showNotice);
    var location = TextInput.create('location-options');
    location.addEventListener('change', _showNotice);
    var agency = TextInput.create('org-name-options');
    agency.addEventListener('change', _showNotice);

    // Set up checkbox filters
    var kind = CheckboxSubtractive.create('kind-options');
    kind.addEventListener('change', _showNotice);

    var serviceArea = CheckboxSubtractive.create('service-area-options');
    serviceArea.addEventListener('change', _showNotice);

    // Capture form submission.
    _searchForm = document.getElementById('form-search');

    // Hook reset button on the page and listen for a click event.
    var resetButton = document.getElementById('button-reset');
    resetButton.addEventListener('click', _resetClicked,false);
  }

  // The geolocation button was clicked in the location filter.
  function _geolocationClicked(address) {
    document.getElementById('location').value = address;
    _searchForm.submit();
  }

  // The clear filters button was clicked.
  function _resetClicked(evt) {
    keyword.reset();
    location.reset();
    agency.reset();

    evt.preventDefault();
    evt.target.blur();
  }

  function _showNotice() {
    var notice = "<a id='update-results' style='cursor:pointer;'>Update search results</a>";
    alert.show(notice, alert.type.INFO);
    var trigger = document.getElementById('update-results');
    trigger.onclick = function(){ _searchForm.submit(); };
  }


  return {
    init:init
  };
});<commit_msg>Removes alert on filter change<commit_after>// Handles search filter functionality.
define([
  'search/filter/TextInput',
  'search/filter/CheckboxSubtractive',
  'util/geolocation/geolocate-action',
  'app/alert-manager',
  'domReady!'
],
function (TextInput, CheckboxSubtractive, geo, alert) {
  'use strict';

  // The form to submit.
  var _searchForm;

  // Main module initialization.
  function init() {
    // Set up geolocation button.
    geo.init('button-geolocate', _geolocationClicked);

    // Set up text input filters
    var keyword = TextInput.create('keyword-search-box');
    var location = TextInput.create('location-options');
    var agency = TextInput.create('org-name-options');

    // Set up checkbox filters
    var kind = CheckboxSubtractive.create('kind-options');

    var serviceArea = CheckboxSubtractive.create('service-area-options');

    // Capture form submission.
    _searchForm = document.getElementById('form-search');

    // Hook reset button on the page and listen for a click event.
    var resetButton = document.getElementById('button-reset');
    resetButton.addEventListener('click', _resetClicked,false);
  }

  // The geolocation button was clicked in the location filter.
  function _geolocationClicked(address) {
    document.getElementById('location').value = address;
    _searchForm.submit();
  }

  // The clear filters button was clicked.
  function _resetClicked(evt) {
    keyword.reset();
    location.reset();
    agency.reset();

    evt.preventDefault();
    evt.target.blur();
  }

  return {
    init:init
  };
});
{'fraction_non_alphanumeric': 0.1284478096268253, 'fraction_numerical': 0.0, 'mean_word_length': 3.7790697674418605, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '132212', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1040, 'n_words': 251}