<commit_before>(function(){
  var editor;

Template.post_submit.events = {
  'click input[type=submit]': function(e){
    e.preventDefault();
    if(!Meteor.user()){
      throwError('You must be logged in.');
      return false;
    }

    var title= $('#title').val();
    var url = $('#url').val();
    var body = $('#body').val();

    var postId = Posts.insert({
        headline: title
      , url: url
      , body: editor.exportFile()
      , user_id: Meteor.user()._id
      , author: Meteor.user().username
      , submitted: new Date().getTime()
      , votes: 0
      , comments: 0
      , score: 0
    });
    var post = Posts.findOne(postId);

    Meteor.call('upvotePost', postId);

    Session.set('selected_post', post);

    trackEvent("new post", {'post ID': postId});

    // Session.set('state', 'view_post');
    Router.navigate('posts/'+postId, {trigger: true});
  }

  ,'click .get-title-link': function(e){
    e.preventDefault();
    var url=$("#url").val();
    $(".get-title-link").addClass("loading");
    if(url){
      $.get(url, function(response){
          if ((suggestedTitle=((/<title>(.*?)<\/title>/m).exec(response.responseText))) != null){<commit_msg>Session can only store values, not objects<commit_after>(function(){
  var editor;

Template.post_submit.events = {
  'click input[type=submit]': function(e){
    e.preventDefault();
    if(!Meteor.user()){
      throwError('You must be logged in.');
      return false;
    }

    var title= $('#title').val();
    var url = $('#url').val();
    var body = $('#body').val();

    var postId = Posts.insert({
        headline: title
      , url: url
      , body: editor.exportFile()
      , user_id: Meteor.user()._id
      , author: Meteor.user().username
      , submitted: new Date().getTime()
      , votes: 0
      , comments: 0
      , score: 0
    });
    var post = Posts.findOne(postId);

    Meteor.call('upvotePost', postId);

    Session.set('selected_post_id', postId);

    trackEvent("new post", {'post ID': postId});

    // Session.set('state', 'view_post');
    Router.navigate('posts/'+postId, {trigger: true});
  }

  ,'click .get-title-link': function(e){
    e.preventDefault();
    var url=$("#url").val();
    $(".get-title-link").addClass("loading");
    if(url){
      $.get(url, function(response){
          if ((suggestedTitle=((/<title>(.*?)<\/title>/m).exec(response.responseText))) != null){
{'fraction_non_alphanumeric': 0.20339685169842586, 'fraction_numerical': 0.0024855012427506215, 'mean_word_length': 2.888888888888889, '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': '644199', 'n_tokens_mistral': 803, 'n_tokens_neox': 770, 'n_words': 159}