<commit_before>$(document).ready(function() {
  // Javascript checkboxes
  $('input[type="checkbox"]').wrap('<span class="toggle"></span>')
  $('input[type="checkbox"]').change(function() {
    if ($(this).is(':checked')) {
      $(this).closest('.toggle').removeClass('off')
    } else {
      $(this).closest('.toggle').addClass('off')
    }
  })
  
  // help
  $('#tagline').click(function() {
    $('#help').fadeToggle()
  });
  
  $('#length').change(function() {
    $('.range-val').text($(this).val())
  })
  
  $('#aboutproject').click(function() {
    $('#about').slideToggle(100);
  	 return false;
  });
  
  $('#master').val(localStorage.hp_master).trigger('focus_empty')
  if ($('#master').val() != '') {
    $('#master').next('.clearinput').fadeIn(50)
  }
  
  // Set settings
  $('#settings input, #settings select').each(function(index) {
    var id = $(this).attr('id')  
    switch (typeof settings[id]) {
      case "boolean":
        $('#'+id).attr('checked', settings[id])
        break
      case "number":
        $('#'+id).val(settings[id]).prev('.range-val').text(settings[id])
        break
      case "string":<commit_msg>iphone checkbox fix<commit_after>$(document).ready(function() {
  // Javascript checkboxes
  $('input[type="checkbox"]').wrap('<span class="toggle"></span>')
  $('input[type="checkbox"]').change(function() {
    if ($(this).is(':checked')) {
      $(this).closest('.toggle').removeClass('off')
    } else {
      $(this).closest('.toggle').addClass('off')
    }
  })
  
  // iPhone checkbox fix
  if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) {
  	$(document).ready(function () {
  		$('label[for]').click(function () {
  			var el = $(this).attr('for');
  			if ($('#' + el + '[type=radio], #' + el + '[type=checkbox]').attr('selected', !$('#' + el).attr('selected'))) {
  				return;
  			} else {
  				$('#' + el)[0].focus();
  			}
  		});
  	});
  }
  
  // help
  $('#tagline').click(function() {
    $('#help').fadeToggle()
  });
  
  $('#length').change(function() {
    $('.range-val').text($(this).val())
  })
  
  $('#aboutproject').click(function() {
    $('#about').slideToggle(100);
  	 return false;
  });
  
  $('#master').val(localStorage.hp_master).trigger('focus_empty')
  if ($('#master').val() != '') {
    $('#master').next('.clearinput').fadeIn(50)
  }
  
  // Set settings
  $('#settings input, #settings select').each(function(index) {
    var id = $(this).attr('id')  
    switch (typeof settings[id]) {
      case "boolean":
        $('#'+id).attr('checked', settings[id])
        break
      case "number":
        $('#'+id).val(settings[id]).prev('.range-val').text(settings[id])
        break
      case "string":
{'fraction_non_alphanumeric': 0.26148282097649184, 'fraction_numerical': 0.003978300180831827, 'mean_word_length': 3.2751159196290573, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 7, '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': '1427219', 'n_tokens_mistral': 933, 'n_tokens_neox': 929, 'n_words': 116}