<commit_before>function() {
  var value = $(this).val();
  var sts = $("#status").val();
  var flt = $("#flight").val();
  
  if (value.match(/[^a-zA-Z ]/g)) {
    this.value = this.value.replace(/[^a-zA-Z ]/g, '');
    return false;
  }

  var startKey = [];
  var endKey = [];
  var viewName = "basic/all_by_name";

  if ((sts != "All") && (flt == "All")) {
    startKey.push(sts);
    endKey.push(sts);
    viewName = "basic/all_by_status_and_name";
  } else if ((flt != "All") && (sts == "All")) {
      startKey.push(flt);
      endKey.push(flt);
      viewName = "basic/all_by_flight_and_name";
  }

  if (value.length > 0) {
    startKey.push(value);
    endKey.push(value + "\ufff0");
  } else {
    startKey.push("a");
    endKey.push("\ufff0");
  }

  // Clear the result area.
  var rslt = $("#results");
  rslt.html("");

  // Get the data.
  var app = $$(this).app;
  app.db.view(viewName, {
    limit : 50,
    startkey : startKey,
    endkey : endKey,
    descending : false,
    type : "newRows",
    success: function(resp) {
      for (row in resp.rows) {
        var id = resp.rows[row].id;
        var person = resp.rows[row].value;

        var anchor = "<a href='#'>";
        if (person.type == 'Veteran') {
          anchor = "<a href='vet_edit.html?vetid=" + id + "' target='_blank'>";
        } else if (person.type == 'Guardian') {
          anchor = "<a href='grd_edit.html?grdid=" + id + "' target='_blank'>";
        } else if (person.type == 'Volunteer') {
          anchor = "<a href='vol_edit.html?volid=" + id + "' target='_blank'>";
        }


        tr = $("<tr/>", { class: person.type });
        tr.append("<td>" + anchor + person.name + "</a></td>");
        tr.append("<td>" + anchor + person.city + "</a></td>");
        tr.append("<td>" + anchor + person.appdate + "</a></td>");
        tr.append("<td>" + anchor + person.flight + "</a></td>");
        tr.append("<td>" + anchor + person.status + "</a></td>");
        tr.append("<td>" + anchor + person.pairing + "</a></td>");
        rslt.append(tr);     
      }
    }
  })

  return true;
};

//@ sourceURL=finder/loggedIn/selectors/#last_name/keyup.js
<commit_msg>Allow single quote in finder search.<commit_after>function() {
  var value = $(this).val();
  var sts = $("#status").val();
  var flt = $("#flight").val();
  
  if (value.match(/[^a-zA-Z' ]/g)) {
    this.value = this.value.replace(/[^a-zA-Z' ]/g, '');
    return false;
  }

  var startKey = [];
  var endKey = [];
  var viewName = "basic/all_by_name";

  if ((sts != "All") && (flt == "All")) {
    startKey.push(sts);
    endKey.push(sts);
    viewName = "basic/all_by_status_and_name";
  } else if ((flt != "All") && (sts == "All")) {
      startKey.push(flt);
      endKey.push(flt);
      viewName = "basic/all_by_flight_and_name";
  }

  if (value.length > 0) {
    startKey.push(value);
    endKey.push(value + "\ufff0");
  } else {
    startKey.push("a");
    endKey.push("\ufff0");
  }

  // Clear the result area.
  var rslt = $("#results");
  rslt.html("");

  // Get the data.
  var app = $$(this).app;
  app.db.view(viewName, {
    limit : 50,
    startkey : startKey,
    endkey : endKey,
    descending : false,
    type : "newRows",
    success: function(resp) {
      for (row in resp.rows) {
        var id = resp.rows[row].id;
        var person = resp.rows[row].value;

        var anchor = "<a href='#'>";
        if (person.type == 'Veteran') {
          anchor = "<a href='vet_edit.html?vetid=" + id + "' target='_blank'>";
        } else if (person.type == 'Guardian') {
          anchor = "<a href='grd_edit.html?grdid=" + id + "' target='_blank'>";
        } else if (person.type == 'Volunteer') {
          anchor = "<a href='vol_edit.html?volid=" + id + "' target='_blank'>";
        }


        tr = $("<tr/>", { class: person.type });
        tr.append("<td>" + anchor + person.name + "</a></td>");
        tr.append("<td>" + anchor + person.city + "</a></td>");
        tr.append("<td>" + anchor + person.appdate + "</a></td>");
        tr.append("<td>" + anchor + person.flight + "</a></td>");
        tr.append("<td>" + anchor + person.status + "</a></td>");
        tr.append("<td>" + anchor + person.pairing + "</a></td>");
        rslt.append(tr);     
      }
    }
  })

  return true;
};

//@ sourceURL=finder/loggedIn/selectors/#last_name/keyup.js

{'fraction_non_alphanumeric': 0.22582127268550425, 'fraction_numerical': 0.002297266253158741, 'mean_word_length': 2.409553641346907, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 51, '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': '8967', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1561, 'n_words': 309}