<commit_before>(function($) {
  "use strict";
  $.extend({
    ///////////////////////////////////////////
    // Creates a Tab Bar for Toggling Articles:
    ///////////////////////////////////////////
    UITabbar : function ( options ) {
      /*
      var options = {
        id: 'mySpecialTabbar',
        tabs: 4,
        labels: ["Refresh", "Add", "Info", "Downloads", "Favorite"],
        icons: ["refresh", "add", "info", "downloads", "favorite"],
        selected: 2
      }
      */
      if (!options) return;
      $('body').addClass('hasTabBar');
      if ($.isiOS6) $('body').addClass('isiOS6');
      var id = options.id || $.Uuid();
      var selected = options.selected || '';
      var tabbar = '<div class="tabbar" id="' + id + '">';
      var icon = ($.isiOS || $.isSafari) ? '<span class="icon"></span>' : '';
      for (var i = 0; i < options.tabs; i++) {
        tabbar += '<a class="button ' + options.icons[i];
        if (selected === i+1) {
          tabbar += ' selected';
        }
        tabbar += '">' + icon + '<label>' + options.labels[i] + '</label></a>';
      }
      tabbar += '</div>';
      $('body').append(tabbar);
      $('nav').removeClass('current').addClass('next');
      $('#global-nav').removeClass('next');
      $('nav').eq(selected).removeClass('next').addClass('current');
      $('article').removeClass('current').addClass('next');
      $('article').eq(selected-1).removeClass('next').addClass('current');
      $('.tabbar').on('singletap', '.button', function() {
        var $this = this;
        var index;
        var id;
        $.publish('chui/navigate/leave', $('article.current')[0].id);

        $this.classList.add('selected');
        $($this).siblings('a').removeClass('selected');
        index = $(this).index();
        $('article.previous').removeClass('previous').addClass('next');
        $('nav.previous').removeClass('previous').addClass('next');
        $('article.current').removeClass('current').addClass('next');
        $('nav.current').removeClass('current').addClass('next');
        $('article').eq(index).removeClass('next').addClass('current');
        $('nav').eq(index+1).removeClass('next').addClass('current');

        id = $('article').eq(index)[0].id;
        $.publish('chui/navigate/enter', id);
        $('article').forEach(function(ctx) {
          if (window.jQuery) {
            $(ctx).scrollTop(0);
          } else if (window.$chocolatechipjs) {
            ctx.scrollTop = 0;
          }
        });
        $.UISetHashOnUrl('#'+id);
        if ($.UINavigationHistory[0] === ('#' + id)) {
          $.UINavigationHistory = [$.UINavigationHistory[0]];
        } else if ($.UINavigationHistory.length === 1) {
          if ($.UINavigationHistory[0] !== ('#' + id)) {
            $.UINavigationHistory.push('#'+id);
          }
        } else if($.UINavigationHistory.length === 3) {
          $.UINavigationHistory.pop();
        } else {
          $.UINavigationHistory[1] = '#'+id;
        }
      });
    }
  });
})(window.$);<commit_msg>UITabbar update for navigation.<commit_after>(function($) {
  "use strict";
  $.extend({
    ///////////////////////////////////////////
    // Creates a Tab Bar for Toggling Articles:
    ///////////////////////////////////////////
    UITabbar : function ( options ) {
      /*
      var options = {
        id: 'mySpecialTabbar',
        tabs: 4,
        labels: ["Refresh", "Add", "Info", "Downloads", "Favorite"],
        icons: ["refresh", "add", "info", "downloads", "favorite"],
        selected: 2
      }
      */
      if (!options) return;
      $('body').addClass('hasTabBar');
      if ($.isiOS6) $('body').addClass('isiOS6');
      var id = options.id || $.Uuid();
      var selected = options.selected || '';
      var tabbar = '<div class="tabbar" id="' + id + '">';
      var icon = ($.isiOS || $.isSafari) ? '<span class="icon"></span>' : '';
      for (var i = 0; i < options.tabs; i++) {
        tabbar += '<a class="button ' + options.icons[i];
        if (selected === i+1) {
          tabbar += ' selected';
        }
        tabbar += '">' + icon + '<label>' + options.labels[i] + '</label></a>';
      }
      tabbar += '</div>';
      $('body').append(tabbar);
      $('nav').removeClass('current').addClass('next');
      $('#global-nav').removeClass('next');
      $('nav').eq(selected).removeClass('next').addClass('current');
      $('article').removeClass('current').addClass('next');
      $('article').eq(selected-1).removeClass('next').addClass('current');
      $('.tabbar').on('singletap', '.button', function() {
        var $this = this;
        var index;
        var id;
        $.publish('chui/navigate/leave', $('article.current')[0].id);

        $this.classList.add('selected');
        $($this).siblings('a').removeClass('selected');
        index = $(this).index();
        $('article.previous').removeClass('previous').addClass('next');
        $('nav.previous').removeClass('previous').addClass('next');
        $('article.current').removeClass('current').addClass('next');
        $('nav.current').removeClass('current').addClass('next');
        $('article').eq(index).removeClass('next').addClass('current');
        $('nav').eq(index+1).removeClass('next').addClass('current');

        id = $('article').eq(index)[0].id;
        $.publish('chui/navigate/enter', id);
        $('article').forEach(function(ctx) {
          if (window.jQuery) {
            $(ctx).scrollTop(0);
          } else if (window.$chocolatechipjs) {
            ctx.scrollTop = 0;
          }
        });
        $.UISetHashOnUrl('#'+id);
        $.UINavigationHistory = ['#'+id];
      });
    }
  });
})(window.$);
{'fraction_non_alphanumeric': 0.2527259936686599, 'fraction_numerical': 0.005276116778051354, 'mean_word_length': 2.2534324942791764, 'pattern_counts': {'":': 0, '<': 21, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7105947', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1674, 'n_words': 276}