<commit_before>//= require jquery
//= require stylr/prettify/prettify.js

// TODO: Refactor me!!!!

var Stylr = {
  dropdownButtonSelector: '.dropdown-button'
};

(function($) {

  $(function() {

    Stylr.closeDropdown = function(dropdown) {
      $(dropdown).removeClass('open');
      return dropdown;
    };

    Stylr.toggleDropdown = function(container, dropdown) {
      var height   = $(container).outerHeight(true);
      var dropdown = $(dropdown);

      $(Stylr.dropdownButtonSelector).find('> ul').each(function(i, e) {
        if (!$(e).is(dropdown)) {
          $(e).removeClass('open');
        }
      });

      if (!dropdown.is(':visible')) $('body').click();

      dropdown.toggleClass('open');
      dropdown.css('top', height);

      return dropdown;
    };

    // Code pretty printing
    // ====================

    prettyPrint();

    // Dropdown Navigation
    // ===================

    $(document).on('click', 'body', function (e) {
      Stylr.closeDropdown($('.dropdown > a').next('ul'));
      return true;
    });

    $('.dropdown > a').live('click', function (e) {
      Stylr.toggleDropdown($(this), $(this).next('ul'));<commit_msg>live is deprecated<commit_after>//= require jquery
//= require stylr/prettify/prettify.js

// TODO: Refactor me!!!!

var Stylr = {
  dropdownButtonSelector: '.dropdown-button'
};

(function($) {

  $(function() {

    Stylr.closeDropdown = function(dropdown) {
      $(dropdown).removeClass('open');
      return dropdown;
    };

    Stylr.toggleDropdown = function(container, dropdown) {
      var height   = $(container).outerHeight(true);
      var dropdown = $(dropdown);

      $(Stylr.dropdownButtonSelector).find('> ul').each(function(i, e) {
        if (!$(e).is(dropdown)) {
          $(e).removeClass('open');
        }
      });

      if (!dropdown.is(':visible')) $('body').click();

      dropdown.toggleClass('open');
      dropdown.css('top', height);

      return dropdown;
    };

    // Code pretty printing
    // ====================

    prettyPrint();

    // Dropdown Navigation
    // ===================

    $(document).on('click', 'body', function (e) {
      Stylr.closeDropdown($('.dropdown > a').next('ul'));
      return true;
    });

    $(document).on('click', '.dropdown > a', function (e) {
      Stylr.toggleDropdown($(this), $(this).next('ul'));
{'fraction_non_alphanumeric': 0.22255192878338279, 'fraction_numerical': 0.0, 'mean_word_length': 2.8562091503267975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6066013', 'n_tokens_mistral': 746, 'n_tokens_neox': 686, 'n_words': 126}