<commit_before><style>
</style>

<template>
  <div class="drawer">
    <div class="compose">
      <div class="compose-content">
        <div class="compose-header">
          <div class="content">
            <img class="avatar" :src="user.profile_image_url" />
          	<span>Tweeting from</span>@{{ user.screen_name }}
          </div>
          <div class="gradient"></div>
          <img :src="user.profile_banner_url" />
        </div>
        <div class="compose-antiscroll">
          <div class="compose-container">
            {{{ $t('message.hello') }}}
            <form action="/" method="HEAD" onsubmit="return false;">
              <div class="compose-input-container">
                <textarea id="tweet" class="compose-input" placeholder="Tweet here bby" @input="characterCount"></textarea>
              </div>
              <div class="pull-right compose-actions">
                <span class="js-remaining-character-count">140</span> 
                <input type="submit" class="btn btn-primary" id="send" value="Send">
              </div>
            </form>
          </div>
        </div>  
      </div>
    </div>
  </div>
</template>

<script>
const twitter = require('twitter-text')

export default {
  props: ['user'],
  methods: {
    characterCount (e) {
      var remain = 140 - twitter.getTweetLength($('#tweet').val())
      $('.js-remaining-character-count').text(remain)
    }
  }
}
</script><commit_msg>disable sending of tweet when it's longer than 140 characters<commit_after><style>
</style>

<template>
  <div class="drawer">
    <div class="compose">
      <div class="compose-content">
        <div class="compose-header">
          <div class="content">
            <img class="avatar" :src="user.profile_image_url" />
          	<span>Tweeting from</span>@{{ user.screen_name }}
          </div>
          <div class="gradient"></div>
          <img :src="user.profile_banner_url" />
        </div>
        <div class="compose-antiscroll">
          <div class="compose-container">
            {{{ $t('message.hello') }}}
            <form action="/" method="HEAD" onsubmit="return false;">
              <div class="compose-input-container">
                <textarea id="tweet" class="compose-input" placeholder="Tweet here bby" @input="characterCount"></textarea>
              </div>
              <div class="pull-right compose-actions">
                <span class="js-remaining-character-count">140</span> 
                <input type="submit" class="btn btn-primary" id="send" value="Send">
              </div>
            </form>
          </div>
        </div>  
      </div>
    </div>
  </div>
</template>

<script>
const twitter = require('twitter-text')

export default {
  props: ['user'],
  methods: {
    characterCount (e) {
      var remain = 140 - twitter.getTweetLength($('#tweet').val())
      $('.js-remaining-character-count').text(remain)
 
      if (remain <= 0) {
        $('#send').prop('disabled', true)
      } else {
        $('#send').prop('disabled', false)
      }
    }
  }
}
</script>
{'fraction_non_alphanumeric': 0.1775822743564679, 'fraction_numerical': 0.005213424568263278, 'mean_word_length': 2.1879543094496365, 'pattern_counts': {'":': 0, '<': 78, '<?xml version=': 0, '>': 77, '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': '4002063', 'n_tokens_mistral': 958, 'n_tokens_neox': 921, 'n_words': 178}