<commit_before>(function() {
  "use strict";
  window.GOVUK = window.GOVUK || {};
  var $ = window.jQuery;

  function BrowseColumns(options){
    if(options.$el.length === 0) return;

    this.$el = options.$el;
    this.$root = this.$el.find('#root');
    this.$section = this.$el.find('#section');
    this.$subsection = this.$el.find('#subsection');

    if(this.$subsection.length === 0){
      this.$subsection = '<div id="subsection" class="pane" />';
      this.$el.prepend($subsection);
    } else {
      this.$subsection.show();
    }

    this.state = this.$el.data('state');
    this._cache = {};

    this.$el.on('click', 'a', $.proxy(this.navigate, this));

    $(window).on('popstate', $.proxy(this.popState, this));
  }
  BrowseColumns.prototype = {
    popState: function(e){
      var state = e.originalEvent.state;

      if(state.subsection){
        this.showSubsection(state.title, state.data);
        this.highlightSection('section', state.path);
        this.highlightSection('root', '/browse/' + state.section);
      } else {
        this.showSection(state.title, state.data);
        this.highlightSection('root', state.path);
      }
    },
    sectionCache: function(slug, data){
      if(typeof data === 'undefined'){
        return this._cache[slug];
      } else {
        this._cache[slug] = data;
      }
    },
    showSection: function(title, data){
      this.$section.mustache('browse/_section', { title: title, options: data.results});
      if(this.state !== 'section'){
        // animate to the right position and update the data
        this.$subsection.hide();
        this.$section.css('margin-right', '63%');
        this.$section.find('.pane-inner').animate({
          paddingLeft: '96px'
        }, 200);
        this.$section.animate({
          width: '35%',
          marginLeft: '0%',
          marginRight: '40%'
        }, 200, $.proxy(function(){
          this.state = 'section';

          this.$el.removeClass('subsection').addClass('section');
          this.$section.attr('style', '');
          this.$section.find('.pane-inner').attr('style', '');
          this.$section.addClass('with-sort');
        }, this));
      }
      // update the data
    },
    showSubsection: function(title, data){
      this.$subsection.mustache('browse/_section', { title: title, options: data.results});

      if(this.state !== 'subsection'){
        // animate to the right position and update the data
        this.$section.find('.sort-order').hide();
        this.$section.find('.pane-inner').animate({
          paddingLeft: '0'
        }, 200);
        this.$section.animate({
          width: '25%',
          marginLeft: '-13%',
          marginRight: '63%'
        }, 200, $.proxy(function(){
          this.state = 'section';

          this.$el.removeClass('section').addClass('subsection');
          this.$subsection.show();
          this.$section.removeClass('with-sort');
          this.state = 'subsection';

          this.$section.find('.sort-order').attr('style', '');
          this.$section.attr('style', '');
          this.$section.find('.pane-inner').attr('style', '');
        }, this));

      }
      // update the data
    },<commit_msg>Set page title on new pages<commit_after>(function() {
  "use strict";
  window.GOVUK = window.GOVUK || {};
  var $ = window.jQuery;

  function BrowseColumns(options){
    if(options.$el.length === 0) return;

    this.$el = options.$el;
    this.$root = this.$el.find('#root');
    this.$section = this.$el.find('#section');
    this.$subsection = this.$el.find('#subsection');

    if(this.$subsection.length === 0){
      this.$subsection = $('<div id="subsection" class="pane" />').hide();
      this.$el.prepend(this.$subsection);
    } else {
      this.$subsection.show();
    }

    this.state = this.$el.data('state');
    this._cache = {};

    this.$el.on('click', 'a', $.proxy(this.navigate, this));

    $(window).on('popstate', $.proxy(this.popState, this));
  }
  BrowseColumns.prototype = {
    popState: function(e){
      var state = e.originalEvent.state;

      if(state.subsection){
        this.showSubsection(state.title, state.data);
        this.highlightSection('section', state.path);
        this.highlightSection('root', '/browse/' + state.section);
      } else {
        this.showSection(state.title, state.data);
        this.highlightSection('root', state.path);
      }
    },
    sectionCache: function(slug, data){
      if(typeof data === 'undefined'){
        return this._cache[slug];
      } else {
        this._cache[slug] = data;
      }
    },
    showSection: function(title, data){
      this.setTitle(title);
      this.$section.mustache('browse/_section', { title: title, options: data.results});
      if(this.state !== 'section'){
        // animate to the right position and update the data
        this.$subsection.hide();
        this.$section.css('margin-right', '63%');
        this.$section.find('.pane-inner').animate({
          paddingLeft: '96px'
        }, 200);
        this.$section.animate({
          width: '35%',
          marginLeft: '0%',
          marginRight: '40%'
        }, 200, $.proxy(function(){
          this.state = 'section';

          this.$el.removeClass('subsection').addClass('section');
          this.$section.attr('style', '');
          this.$section.find('.pane-inner').attr('style', '');
          this.$section.addClass('with-sort');
        }, this));
      }
      // update the data
    },
    showSubsection: function(title, data){
      this.setTitle(title);
      this.$subsection.mustache('browse/_section', { title: title, options: data.results});

      if(this.state !== 'subsection'){
        // animate to the right position and update the data
        this.$section.find('.sort-order').hide();
        this.$section.find('.pane-inner').animate({
          paddingLeft: '0'
        }, 200);
        this.$section.animate({
          width: '25%',
          marginLeft: '-13%',
          marginRight: '63%'
        }, 200, $.proxy(function(){
          this.state = 'section';

          this.$el.removeClass('section').addClass('subsection');
          this.$subsection.show();
          this.$section.removeClass('with-sort');
          this.state = 'subsection';

          this.$section.find('.sort-order').attr('style', '');
          this.$section.attr('style', '');
          this.$section.find('.pane-inner').attr('style', '');
        }, this));

      }
      // update the data
    },
    setTitle: function(title){
      $('title').text(title);
    },
{'fraction_non_alphanumeric': 0.1892754063496886, 'fraction_numerical': 0.009114385538508279, 'mean_word_length': 2.3712237583205327, 'pattern_counts': {'":': 0, '<': 5, '<?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': '354905', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1940, 'n_words': 333}