<commit_before>define(function (require) {
  var Base    = require('src/views/base'),
      Diary   = require('src/models/diary'),
      Comment = require('src/models/comment'),
      Tools   = require('src/helpers/tools'),
      dust    = require('dust');

  var DiaryView = Base.extend({
    el : "#wrapper",

    events : {
      'touchend #submit': 'submitComment'
    },

    submitComment : function () {
      var self      = this,
          form      = self.$el.find('.commentForm'),
          did       = form.data('did'),
          u_name    = form.find('#name'),
          u_email   = form.find('#email'),
          u_comment = form.find('#commentsTa');

      var flag1 = Tools.emptyCheck( [u_name, u_email, u_comment] );
      var flag2 = Tools.emailCheck(u_email);

      if( flag1 === true && flag2 === true ){

        var data = {
          did      : did,
          username : u_name.val(),
          email    : u_email.val(),
          comment  : u_comment.val()
        }

        this.comment.saveComment(data).done(function (resp) {
          self.insertComment(data);
          self.setCookie(data);

          // empty comment-form value
          u_comment.val('');
        });

      }

    },

    setCookie : function (userprofile) {
      Tools.setCookie('username', userprofile.username, 30);
      Tools.setCookie('email', userprofile.email, 30);
    },

    loadCookie : function () {
      var resp = {
        username:  Tools.getCookie('username'),
        email: Tools.getCookie('email')
      };<commit_msg>make response nolonger wait comment add functons done<commit_after>define(function (require) {
  var Base    = require('src/views/base'),
      Diary   = require('src/models/diary'),
      Comment = require('src/models/comment'),
      Tools   = require('src/helpers/tools'),
      dust    = require('dust');

  var DiaryView = Base.extend({
    el : "#wrapper",

    events : {
      'touchend #submit': 'submitComment'
    },

    submitComment : function () {
      var self      = this,
          form      = self.$el.find('.commentForm'),
          did       = form.data('did'),
          u_name    = form.find('#name'),
          u_email   = form.find('#email'),
          u_comment = form.find('#commentsTa');

      var flag1 = Tools.emptyCheck( [u_name, u_email, u_comment] );
      var flag2 = Tools.emailCheck(u_email);

      if( flag1 === true && flag2 === true ){

        var data = {
          did      : did,
          username : u_name.val(),
          email    : u_email.val(),
          comment  : u_comment.val()
        }

        this.comment.saveComment(data);
        this.insertComment(data);
        this.setCookie(data);

        // empty comment-form value
        u_comment.val('');

      }

    },

    setCookie : function (userprofile) {
      Tools.setCookie('username', userprofile.username, 30);
      Tools.setCookie('email', userprofile.email, 30);
    },

    loadCookie : function () {
      var resp = {
        username:  Tools.getCookie('username'),
        email: Tools.getCookie('email')
      };
{'fraction_non_alphanumeric': 0.14808813998703824, 'fraction_numerical': 0.005184705119896306, 'mean_word_length': 2.002918287937743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '118689', 'n_tokens_mistral': 935, 'n_tokens_neox': 898, 'n_words': 178}