<commit_before>
"use strict";

var _gaq = _gaq || [];

// TODO: window.tags and window._gaq_page_name...

$(function () {

  var selectizeOptions = {
    openOnFocus: false,
    highlight: true,
    hideSelected: true,
    valueField: 'tag',
    labelField: 'tag',
    searchField: ['tag'],
    options: window.tags,
    onChange: search,
    onInitialize: search,
  };

  $('#selected-tags').selectize(selectizeOptions);
  $('#excluded-tags').selectize(selectizeOptions);

  $('input[name="op"]').on('change', search);

  var NProgress = window.NProgress;
  NProgress.configure({ trickleRate: 0.3 });
  $(document).ajaxStart(function () {
    NProgress.start();
  });
  $(document).ajaxStop(function () {
    NProgress.done();
  });

  function search () {
    var op = $('input[name="op"]:checked').val() || 'or',
        selectedTags = $('#selected-tags').val() || '',
        excludedTags = $('#excluded-tags').val() || '',
        url = '/search/' + selectedTags +'%25' + op + '%25' + excludedTags,
        query = buildQueryString(selectedTags, excludedTags, op);

    if (query.length === 0) {
      console.debug('no query');
      $('#query').html('Search by tags');
      $('#results').hide();
    }
    else {
      $('#query').html('<a href="/page' + url + '">' + query + '</a>');

      _gaq.push(['_trackEvent', 'Search', window._gaq_page_name, query]);

      $.ajax({
        type:'GET',
        url: '/tag' + url,
        success: function (result) {
          result = $.parseJSON(result);
          $('#results').show();
          injectResults($('#link_results'), result[0]);
          injectResults($('#list_results'), result[1]);
        }
      });
    }
  };

  function resultLayoutTpl (content) {
    return '<div class="panel"><h5>' + content + '</h5></div>';
  };
<commit_msg>Remove console debug<commit_after>
"use strict";

var _gaq = _gaq || [];

// TODO: window.tags and window._gaq_page_name...

$(function () {

  var selectizeOptions = {
    openOnFocus: false,
    highlight: true,
    hideSelected: true,
    valueField: 'tag',
    labelField: 'tag',
    searchField: ['tag'],
    options: window.tags,
    onChange: search,
    onInitialize: search,
  };

  $('#selected-tags').selectize(selectizeOptions);
  $('#excluded-tags').selectize(selectizeOptions);

  $('input[name="op"]').on('change', search);

  var NProgress = window.NProgress;
  NProgress.configure({ trickleRate: 0.3 });
  $(document).ajaxStart(function () {
    NProgress.start();
  });
  $(document).ajaxStop(function () {
    NProgress.done();
  });

  function search () {
    var op = $('input[name="op"]:checked').val() || 'or',
        selectedTags = $('#selected-tags').val() || '',
        excludedTags = $('#excluded-tags').val() || '',
        url = '/search/' + selectedTags +'%25' + op + '%25' + excludedTags,
        query = buildQueryString(selectedTags, excludedTags, op);

    if (query.length === 0) {
      $('#query').html('Search by tags');
      $('#results').hide();
    }
    else {
      $('#query').html('<a href="/page' + url + '">' + query + '</a>');

      _gaq.push(['_trackEvent', 'Search', window._gaq_page_name, query]);

      $.ajax({
        type:'GET',
        url: '/tag' + url,
        success: function (result) {
          result = $.parseJSON(result);
          $('#results').show();
          injectResults($('#link_results'), result[0]);
          injectResults($('#list_results'), result[1]);
        }
      });
    }
  };

  function resultLayoutTpl (content) {
    return '<div class="panel"><h5>' + content + '</h5></div>';
  };

{'fraction_non_alphanumeric': 0.21273031825795644, 'fraction_numerical': 0.006141820212171971, 'mean_word_length': 2.928728070175439, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '5480779', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1123, 'n_words': 216}