<commit_before>var tabsView = Backbone.View.extend({

  initialize: function() {
    this.render();
    this.getElements();
  },

  template: Handlebars.templates.tabs,

  render: function() {
    var html = this.template(this.collection);
    this.$el.append(html);
  },

  events: {
    'click .header-tab': 'triggerDropdown'
  },

  getElements: function() {
    this.$container = $('div.tabs-block'),
    this.$tabs = $('div.header-tab')
  },

  triggerDropdown: function(e) {
    var tab = $(e.target).parents('div.header-tab')
    //open dropdown if not already open
    if(!Dropdown.isOpen()) Dropdown.init(tab);
  }

});

var shortcutBarView = Backbone.View.extend({

  initialize: function() {
    this.render();
    this.$container = $('.shortcut-bar-wrapper');
    this.$shortcutBar = $('.shortcut-bar');
    this.$shortcutIcons = $('.shortcut i');
    this.$container
      .hide()
      .fadeIn(600);

    this.$shortcutBar.on({
      mouseleave: function() { Background.removeBlur() },
    });

    this.$shortcutIcons.on({
      mouseenter: function() { Background.triggerBlur(5, 0.75, 600, 100) },
      mouseout: this.scFontOut
    })

    //add condenseText jQuery function
    $.fn.condenseText = function(tracking, opacity, duration, easing) {
      return $(this)
        .css({
          letterSpacing: tracking.start + 'px',
          opacity: opacity.start
        })
        .animate({
          letterSpacing: tracking.end,
          opacity: opacity.end
        }, duration, easing)
    }
  },

  template: Handlebars.templates.shortcutBar,

  render: function() {
    var html = this.template(this.collection);
    this.$el.append(html);
  },

  events: {

  },

  scFontHover: function(elem, hoverColor) {
    //animate shortcut icon
    elem.animate({
      color: hoverColor
    }, 200);

    //insert label
    var text = elem.parent().parent().attr('id').split('-')[1].toLowerCase();
    this.$container.append("<div class='shortcut-label'>" + text + "</div>");
    var containerWidth = this.$container.width();

    //animate label
    $('div.shortcut-label')
      .css({ width: containerWidth + 'px' })
      .delay(400)
      .condenseText({ start: 15, end: 5 }, { start: 0, end: 1 }, 800, 'easeOutElastic')
  },

  scFontOut: function() {
    //animate shortcut icon
    $(this).animate({
      color: 'lightgray'
    });

    //remove label
    $('div.shortcut-label').remove();
  },

});


var categoryView = Backbone.View.extend({

  active: false,

  initialize: function() {
    this.render();
    this.$categoryViewer = $('.category-viewer');
    this.$categoryViewer.hide();
    this.categoryInit();
  },

  template: Handlebars.templates.categoryView,

  render: function() {
    var html = this.template(this.collection);
    this.$el.append(html);
  },

  category: {}, //used for manipulating category dom elements
<commit_msg>freeze animation shortcut icon hover state once clicked while navigating to external url.<commit_after>var tabsView = Backbone.View.extend({

  initialize: function() {
    this.render();
    this.getElements();
  },

  template: Handlebars.templates.tabs,

  render: function() {
    var html = this.template(this.collection);
    this.$el.append(html);
  },

  events: {
    'click .header-tab': 'triggerDropdown'
  },

  getElements: function() {
    this.$container = $('div.tabs-block'),
    this.$tabs = $('div.header-tab')
  },

  triggerDropdown: function(e) {
    var tab = $(e.target).parents('div.header-tab')
    //open dropdown if not already open
    if(!Dropdown.isOpen()) Dropdown.init(tab);
  }

});

var shortcutBarView = Backbone.View.extend({

  initialize: function() {
    this.render();
    this.$container = $('.shortcut-bar-wrapper');
    this.$shortcutBar = $('.shortcut-bar');
    this.$shortcutIcons = $('.shortcut i');
    this.$container
      .hide()
      .fadeIn(600);

    this.$shortcutBar.on({
      mouseleave: function() { Background.removeBlur() },
    });

    this.$shortcutIcons.on({
      mouseenter: function() { Background.triggerBlur(5, 0.75, 600, 100) },
      mouseleave: function() { $('div.shortcut-label').remove() },
      mouseout: this.scFontOut,
      click: function() {
        //preserve hover state while loading external link
        var elem = $(this);
        var shortcutbar = elem.parents('.shortcut-bar');
        elem
          .add(shortcutbar)
          .off('mouseleave')
          .off('mouseout');
      }
    });

    //add condenseText jQuery function
    $.fn.condenseText = function(tracking, opacity, duration, easing) {
      return $(this)
        .css({
          letterSpacing: tracking.start + 'px',
          opacity: opacity.start
        })
        .animate({
          letterSpacing: tracking.end,
          opacity: opacity.end
        }, duration, easing)
    }
  },

  template: Handlebars.templates.shortcutBar,

  render: function() {
    var html = this.template(this.collection);
    this.$el.append(html);
  },

  events: {

  },

  scFontHover: function(elem, hoverColor) {
    //animate shortcut icon
    elem.animate({
      color: hoverColor
    }, 200);

    //insert label
    var text = elem.parent().parent().attr('id').split('-')[1].toLowerCase();
    this.$container.append("<div class='shortcut-label'>" + text + "</div>");
    var containerWidth = this.$container.width();

    //animate label
    $('div.shortcut-label')
      .css({ width: containerWidth + 'px' })
      .delay(400)
      .condenseText({ start: 15, end: 5 }, { start: 0, end: 1 }, 800, 'easeOutElastic')
  },

  scFontOut: function() {
    //animate shortcut icon
    $(this).animate({
      color: 'lightgray'
    });
  },

});


var categoryView = Backbone.View.extend({

  active: false,

  initialize: function() {
    this.render();
    this.$categoryViewer = $('.category-viewer');
    this.$categoryViewer.hide();
    this.categoryInit();
  },

  template: Handlebars.templates.categoryView,

  render: function() {
    var html = this.template(this.collection);
    this.$el.append(html);
  },

  category: {}, //used for manipulating category dom elements

{'fraction_non_alphanumeric': 0.16663941128372853, 'fraction_numerical': 0.009157808667211774, 'mean_word_length': 2.752147239263804, 'pattern_counts': {'":': 0, '<': 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': '3715453', 'n_tokens_mistral': 1989, 'n_tokens_neox': 1852, 'n_words': 389}