<commit_before># Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

$(document).ready () ->
  $('#cachecontrol-tabs a').click (e) ->
    e.preventDefault()
    $(this).tab('show')

  $('#form_cachecontrol input').change (event) ->
    $.ajax({
      type: $(this).parents('form').attr('method'),
      url:  $(this).parents('form').attr('action'),
      data: $(this).parents('form').serialize(),
      dataType: 'jsonp',
    })

  $('#form_timeout input').change (event) ->
    $.ajax({
        type: $('#form_timeout').attr('method'),
        url:  $('#form_timeout').attr('action'),
        data: $('#form_timeout').serialize(),
        dataType: 'jsonp',
    })

  $('.slider').each (ui) ->
    s = $(this).slider({
      min: parseInt($(this).closest('div.form-group').find('input').attr('data-min')),
      max: parseInt($(this).closest('div.form-group').find('input').attr('data-max')),
      step: 1,
      range: 'min',
      value: parseInt($(this).closest('div.form-group').find('input').val())
      slide: (event, ui) ->
        $(this).closest('div.form-group').find('input').val( ui.value )
        $(this).closest('div.form-group').find('.form-control-static').text( ui.value + 's' )
        $(this).closest('div.form-group').find('input').change()
    })
    $(this).closest('div.form-group').find('.form-control-static').show()
    $(this).closest('div.form-group').find('input').hide()

  $('button.housekeeping').click (e) ->
    e.preventDefault()
    $('button.housekeeping').prop('disabled', true)
    $.ajax({
      type: 'GET'
      url:  '/housekeeping/' + $(this).val(),
      dataType: 'json',
    }).done (json) ->
      $('#cleanResult').text('')
      $('#cleanResult').append('&gt; ' + line + '\n') for line in json.out
      $('#cleanResult').append('&lt; ' + line + '\n') for line in json.in
      $('button.housekeeping').prop('disabled', false)<commit_msg>No caching for housekeeping<commit_after># Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

$(document).ready () ->
  $('#cachecontrol-tabs a').click (e) ->
    e.preventDefault()
    $(this).tab('show')

  $('#form_cachecontrol input').change (event) ->
    $.ajax({
      type: $(this).parents('form').attr('method'),
      url:  $(this).parents('form').attr('action'),
      data: $(this).parents('form').serialize(),
      dataType: 'jsonp',
    })

  $('#form_timeout input').change (event) ->
    $.ajax({
        type: $('#form_timeout').attr('method'),
        url:  $('#form_timeout').attr('action'),
        data: $('#form_timeout').serialize(),
        dataType: 'jsonp',
    })

  $('.slider').each (ui) ->
    s = $(this).slider({
      min: parseInt($(this).closest('div.form-group').find('input').attr('data-min')),
      max: parseInt($(this).closest('div.form-group').find('input').attr('data-max')),
      step: 1,
      range: 'min',
      value: parseInt($(this).closest('div.form-group').find('input').val())
      slide: (event, ui) ->
        $(this).closest('div.form-group').find('input').val( ui.value )
        $(this).closest('div.form-group').find('.form-control-static').text( ui.value + 's' )
        $(this).closest('div.form-group').find('input').change()
    })
    $(this).closest('div.form-group').find('.form-control-static').show()
    $(this).closest('div.form-group').find('input').hide()

  $('button.housekeeping').click (e) ->
    e.preventDefault()
    $('button.housekeeping').prop('disabled', true)
    $.ajax({
      type: 'GET'
      url:  '/housekeeping/' + $(this).val(),
      dataType: 'json',
      cache: false,
    }).done (json) ->
      $('#cleanResult').text('')
      $('#cleanResult').append('&gt; ' + line + '\n') for line in json.out
      $('#cleanResult').append('&lt; ' + line + '\n') for line in json.in
      $('button.housekeeping').prop('disabled', false)
{'fraction_non_alphanumeric': 0.2374274661508704, 'fraction_numerical': 0.00048355899419729207, 'mean_word_length': 3.2737603305785123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '2393419', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1301, 'n_words': 238}