<commit_before>'use strict';

var $ = require('jquery');
var Marionette = require('backbone.marionette');
var template = require('../templates/barenus_feed_item.hbs');

module.exports = Marionette.ItemView.extend({
  tagName: 'div',
  className: 'nm-bn-post js-nm-bn-post col-md-12',
  template: template,
  events: {
    'click .js-nm-bn-post-see-more': 'seeMorePost',
    'click .js-nm-bn-toggle-comments': 'toggleComments',
    'click .js-nm-bn-share-fb': 'sharePostFacebook',
    'click .js-nm-bn-share-tw': 'sharePostTwitter'
  },
  seeMorePost: function (event) {
    var $postMessage = $(event.target).closest('.nm-bn-post-message-container');
    $postMessage.addClass('nm-bn-show-message');
    $postMessage.find('.nm-bn-post-full-message').addClass('animated fadeIn');
  },
  toggleComments: function (event) {
    var $post = $(event.target).closest('.js-nm-bn-post');
    var $comments = $post.find('.js-nm-bn-comments');
    var count = this.model.get('comments').data.length;
    var suffix = count > 1 ? 's' : '';
    if ($post.hasClass('nm-bn-show-comments')) {
      $comments.addClass('animated fadeOut');
      var duration = parseInt($comments.css('animation-duration'));
      duration = isNaN(duration) ? 800 : duration * 1000 - 200;
      setTimeout(function() {
        $post.removeClass('nm-bn-show-comments');
      }, duration);
      $(event.target).text('Show ' + count + ' Comment' + suffix);
    } else {
      $comments.removeClass('animated fadeOut');
      $post.addClass('nm-bn-show-comments');
      $comments.addClass('animated fadeIn');
      $(event.target).text('Hide Comment' + suffix);
    }
  },
  sharePostFacebook : function (event) {
    window.open('http://www.facebook.com/sharer.php?u=' +
      encodeURIComponent(this.model.get('postUrl')), '', 'width=660,height=350');
  }
});<commit_msg>Use a ratio instead of -200<commit_after>'use strict';

var $ = require('jquery');
var Marionette = require('backbone.marionette');
var template = require('../templates/barenus_feed_item.hbs');

module.exports = Marionette.ItemView.extend({
  tagName: 'div',
  className: 'nm-bn-post js-nm-bn-post col-md-12',
  template: template,
  events: {
    'click .js-nm-bn-post-see-more': 'seeMorePost',
    'click .js-nm-bn-toggle-comments': 'toggleComments',
    'click .js-nm-bn-share-fb': 'sharePostFacebook',
    'click .js-nm-bn-share-tw': 'sharePostTwitter'
  },
  seeMorePost: function (event) {
    var $postMessage = $(event.target).closest('.nm-bn-post-message-container');
    $postMessage.addClass('nm-bn-show-message');
    $postMessage.find('.nm-bn-post-full-message').addClass('animated fadeIn');
  },
  toggleComments: function (event) {
    var $post = $(event.target).closest('.js-nm-bn-post');
    var $comments = $post.find('.js-nm-bn-comments');
    var count = this.model.get('comments').data.length;
    var suffix = count > 1 ? 's' : '';
    if ($post.hasClass('nm-bn-show-comments')) {
      $comments.addClass('animated fadeOut');
      var duration = parseInt($comments.css('animation-duration'));
      duration = isNaN(duration) ? 800 : duration * 1000 * 0.8;
      setTimeout(function() {
        $post.removeClass('nm-bn-show-comments');
      }, duration);
      $(event.target).text('Show ' + count + ' Comment' + suffix);
    } else {
      $comments.removeClass('animated fadeOut');
      $post.addClass('nm-bn-show-comments');
      $comments.addClass('animated fadeIn');
      $(event.target).text('Hide Comment' + suffix);
    }
  },
  sharePostFacebook : function (event) {
    window.open('http://www.facebook.com/sharer.php?u=' +
      encodeURIComponent(this.model.get('postUrl')), '', 'width=660,height=350');
  }
});
{'fraction_non_alphanumeric': 0.19339111592632718, 'fraction_numerical': 0.010834236186348862, 'mean_word_length': 3.6220275344180224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5037117', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1210, 'n_words': 193}