<commit_before>$(document).ready(function() {

  // open / close folder
  $('#pages-list ul.folder img.toggler').click(function(e) {
    var toggler = $(this);
    var children = toggler.parent().find('> ul.folder');
    if (children.is(':visible')) {
      children.slideUp('fast', function() {
        toggler.attr('src', toggler.attr('src').replace('open', 'closed'));
        $.cookie(children.attr('id'), 'none');
      });
    } else {
      children.slideDown('fast', function() {
        toggler.attr('src', toggler.attr('src').replace('closed', 'open'));
        $.cookie(children.attr('id'), 'block');
      });
    }
  });

  // sortable folder items
  $('#pages-list ul.folder').sortable({
    'handle': 'em',
    'axis': 'y',
    'update': function(event, ui) {
      var params = $(this).sortable('serialize', { 'key': 'children[]' });
      params += '&_method=put';

      $.post($(this).attr('data_url'), params, function(data) {
        var error = typeof(data.error) != 'undefined';
        $.growl((error ? 'error' : 'success'), (error ? data.error : data.notice));
      }, 'json');
    }
  });

  // templatized feature

  $.subscribe('toggle.page_templatized.checked', function(event, data) {
    $('#page_slug_input').hide();
    $('#page_redirect').parent('li').hide();
    $('#page_content_type_id_input').show();
  }, []);

  $.subscribe('toggle.page_templatized.unchecked', function(event, data) {
    $('#page_slug_input').show();
    $('#page_redirect').parent('li').show();
    $('#page_slug').val(makeSlug($('#page_title').val())).addClass('touched');
    $('#page_content_type_id_input').hide();
  }, []);

  // redirect feature

  $.subscribe('toggle.page_redirect.checked', function(event, data) {
    $('#page_templatized').parent('li').hide();
    $('#page_cache_strategy_input').hide();
    $('#page_redirect_url_input').show();
  }, []);

 $.subscribe('toggle.page_redirect.unchecked', function(event, data) {
    $('#page_templatized').parent('li').show();
    $('#page_cache_strategy_input').show();
    $('#page_redirect_url_input').hide();
  }, []);

  // automatic slug from page title
  $('#page_title').keypress(function() {
    var input = $(this);
    var slug = $('#page_slug');
<commit_msg>javascript for the unlisted options show/hide<commit_after>$(document).ready(function() {

  // open / close folder
  $('#pages-list ul.folder img.toggler').click(function(e) {
    var toggler = $(this);
    var children = toggler.parent().find('> ul.folder');
    if (children.is(':visible')) {
      children.slideUp('fast', function() {
        toggler.attr('src', toggler.attr('src').replace('open', 'closed'));
        $.cookie(children.attr('id'), 'none');
      });
    } else {
      children.slideDown('fast', function() {
        toggler.attr('src', toggler.attr('src').replace('closed', 'open'));
        $.cookie(children.attr('id'), 'block');
      });
    }
  });

  // sortable folder items
  $('#pages-list ul.folder').sortable({
    'handle': 'em',
    'axis': 'y',
    'update': function(event, ui) {
      var params = $(this).sortable('serialize', { 'key': 'children[]' });
      params += '&_method=put';

      $.post($(this).attr('data_url'), params, function(data) {
        var error = typeof(data.error) != 'undefined';
        $.growl((error ? 'error' : 'success'), (error ? data.error : data.notice));
      }, 'json');
    }
  });

  // templatized feature

  $.subscribe('toggle.page_templatized.checked', function(event, data) {
    $('#page_slug_input').hide();
    $('#page_redirect').parent('li').hide();
    $('#page_unlisted').parent('li').hide();
    $('#page_content_type_id_input').show();
  }, []);

  $.subscribe('toggle.page_templatized.unchecked', function(event, data) {
    $('#page_slug_input').show();
    $('#page_redirect').parent('li').show();
    $('#page_unlisted').parent('li').show();
    $('#page_slug').val(makeSlug($('#page_title').val())).addClass('touched');
    $('#page_content_type_id_input').hide();
  }, []);

  // redirect feature

  $.subscribe('toggle.page_redirect.checked', function(event, data) {
    $('#page_templatized').parent('li').hide();
    $('#page_unlisted').parent('li').show();
    $('#page_cache_strategy_input').hide();
    $('#page_redirect_url_input').show();
  }, []);

 $.subscribe('toggle.page_redirect.unchecked', function(event, data) {
    $('#page_templatized').parent('li').show();
    $('#page_unlisted').parent('li').show();
    $('#page_cache_strategy_input').show();
    $('#page_redirect_url_input').hide();
  }, []);

  // automatic slug from page title
  $('#page_title').keypress(function() {
    var input = $(this);
    var slug = $('#page_slug');

{'fraction_non_alphanumeric': 0.23891730605285594, 'fraction_numerical': 0.0, 'mean_word_length': 3.8632124352331605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5088050', 'n_tokens_mistral': 1495, 'n_tokens_neox': 1526, 'n_words': 219}