<commit_before>// Query Build, a jQuery plugin for making a JSON filter input
//
// Version 0.0.1
// Full source at https://github.com/mjpa/query-build
// Copyright (c) 2014 Mike Anchor
// Released under MIT License

(function($) {
  // Name prefix for classes / data attributes
  var namespace = 'query-build-';

  function QueryBuild(target, options) {
    var instance = this;

    // Options
    instance._options = $.extend({
      auto_submit: false
    }, options);

    // The facets / filter
    instance._facets = {};
    instance._filter = {};

    // Loop through the form elements and build up the facet / filters
    target.find('input[type="text"], select, textarea').each(function(idx, element) {
      // Extract info about the input
      var $element = $(element);
      var key = $element.attr('name');
      var val = $element.val();
      var label = $element.attr('placeholder') || $element.attr('title');

      // Add the facet and if there is a value, add it to the filter
      instance._facets[key] = label;
      if (val != '') {
        instance._filter[key] = val;
      }

      // Hide the element now
      // $element.css({ display: 'none' });
    });

    // Save the form target
    instance._target = target;

    // No current facet
    instance._current_facet = null;

    // Container element
    instance._container = $('<div></div>')
                        .data(namespace + 'instance', instance)
                        .addClass(namespace + 'container')
                        .click(instance.openFacetSelect)
                        .insertAfter(target);
<commit_msg>Hiding the inputs would be nice...<commit_after>// Query Build, a jQuery plugin for making a JSON filter input
//
// Version 0.0.2
// Full source at https://github.com/mjpa/query-build
// Copyright (c) 2014 <NAME>
// Released under MIT License

(function($) {
  // Name prefix for classes / data attributes
  var namespace = 'query-build-';

  function QueryBuild(target, options) {
    var instance = this;

    // Options
    instance._options = $.extend({
      auto_submit: false
    }, options);

    // The facets / filter
    instance._facets = {};
    instance._filter = {};

    // Loop through the form elements and build up the facet / filters
    target.find('input[type="text"], select, textarea').each(function(idx, element) {
      // Extract info about the input
      var $element = $(element);
      var key = $element.attr('name');
      var val = $element.val();
      var label = $element.attr('placeholder') || $element.attr('title');

      // Add the facet and if there is a value, add it to the filter
      instance._facets[key] = label;
      if (val != '') {
        instance._filter[key] = val;
      }

      // Hide the element now
      $element.css({ display: 'none' });
    });

    // Save the form target
    instance._target = target;

    // No current facet
    instance._current_facet = null;

    // Container element
    instance._container = $('<div></div>')
                        .data(namespace + 'instance', instance)
                        .addClass(namespace + 'container')
                        .click(instance.openFacetSelect)
                        .insertAfter(target);

{'fraction_non_alphanumeric': 0.13351834720937403, 'fraction_numerical': 0.004316990440949738, 'mean_word_length': 2.1710654936461387, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '197335', 'n_tokens_mistral': 913, 'n_tokens_neox': 860, 'n_words': 276}