<commit_before>var TwitTo = {
  url: "",
  remain: 140,
  output: "",

  init: function() {
    this.url = $("#url").val()
    TwitTo.remain = TwitTo.countRemain(this.url, $("#action").val(), $("#message").val())
    $("#remainCount").text(TwitTo.remain);
  },

  countRemain: function(url, action, message) {
    return 140 - url.length - action.length - message.length - 3;
  },

  onMessageUpdated: function(e) {
    var url = TwitTo.url
    var action = $("#action").val()
    var msg = $("#message").val()
    
    TwitTo.output = [action, msg, ' (', url, ')'].join('');
    TwitTo.remain = TwitTo.countRemain(url, action, msg);

    if (TwitTo.remain < 0) {
      var msg_short = msg.substring(0, msg.length + TwitTo.remain)
      TwitTo.output = [action, msg_short, ' (', url, ')'].join('')
    }

    $("#remainCount").text(TwitTo.remain)
    if (TwitTo.remain < 0) {
      $("#remainCount").css("color", "red")
    } else {
      $("#remainCount").css("color", "")
    }
  },

  buildActions: function(actions, fav_action) {
    var actionHtml = [];
    for (var a in actions) {
        var action = actions[a];
        if (action == fav_action) {
            actionHtml.push("<option selected value='" + action + "'>" + action + "</option>");
        } else {
            actionHtml.push("<option value='" + action + "'>" + action + "</option>");
        }
    }
    $(actionHtml.join('')).appendTo("#action");
  }<commit_msg>inclue action data<commit_after>var TwitTo = {
  url: "",
  remain: 140,
  output: "",

  init: function() {
    this.url = $("#url").val()
    TwitTo.remain = TwitTo.countRemain(this.url, $("#action").val(), $("#message").val())
    $("#remainCount").text(TwitTo.remain);
  },

  countRemain: function(url, action, message) {
    return 140 - url.length - action.length - message.length - 3;
  },

  onMessageUpdated: function(e) {
    var url = TwitTo.url
    var action = $("#action").val()
    var msg = $("#message").val()
    
    TwitTo.output = [action, msg, ' (', url, ')'].join('');
    TwitTo.remain = TwitTo.countRemain(url, action, msg);

    if (TwitTo.remain < 0) {
      var msg_short = msg.substring(0, msg.length + TwitTo.remain)
      TwitTo.output = [action, msg_short, ' (', url, ')'].join('')
    }

    $("#remainCount").text(TwitTo.remain)
    if (TwitTo.remain < 0) {
      $("#remainCount").css("color", "red")
    } else {
      $("#remainCount").css("color", "")
    }
  },

  buildActions: function(actions, fav_action) {
    var actionHtml = [];
    for (var a in actions) {
        var action = actions[a][1];
        var isFav  = actions[a][2]; 
        if (isFav) {
            actionHtml.push("<option selected value='" + action + "'>" + action + "</option>");
        } else {
            actionHtml.push("<option value='" + action + "'>" + action + "</option>");
        }
    }
    $(actionHtml.join('')).appendTo("#action");
  }
{'fraction_non_alphanumeric': 0.21226740179186768, 'fraction_numerical': 0.007580978635423846, 'mean_word_length': 2.7265725288831835, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '5789337', 'n_tokens_mistral': 1015, 'n_tokens_neox': 1003, 'n_words': 194}