<commit_before>/*********************************************************
** jQuery timeilinePlugin functions
** how to use : $('#element').timelineComment();
**              $('#element').timelineDelete();
** @parts     : opTimelinePlugin
** @author    : <NAME> <<EMAIL>>
**********************************************************/
(function($){

  $.fn.timelineComment = function(settings){
    settings = jQuery.extend({
      loader_path: '',
      callback: function(){},
    });

    return this.each(function(){
      $(this).click(function(){
        var id = $(this).attr("data-timeline-id");
        var foreign = $(this).attr('data-activity-foreign');
        var foreignId = $(this).attr('data-activity-foreign-id');
        var body = $('#comment-textarea-'+id).val();
        $timelineLoader = $(this).parent().next();
        $timelineLoader.next().text('');
        $timelineLoader.next().hide();
        $timelineLoader.show();
        $(this).parent().hide();
        $.ajax({
          url: openpne.apiBase + 'activity/post.json',
          type: 'POST',
          data: {
            body: body,
            in_reply_to_activity_id: id,
            apiKey: openpne.apiKey,
            target: foreign,
            target_id: foreignId
          },
          dataType: 'json',
          success: function(data) {
            if ('success' == data.status)
            {
              $('#comment-textarea-'+id).val('');
              $timelineLoader.hide();
              $('#timeline-post-comment-form-'+id).show();
              $postData = $('#timelineCommentTemplate').tmpl(data.data);
              $('#timeline-post-comment-form-'+id).before($postData);
            }
            else
            {
              alert(data.message);
            }
          },
          error: function(x, r, t) {
            $timelineLoader.hide();
            $timelineLoader.next().text('投稿に失敗しました');
            $timelineLoader.next().show();
            $timelineLoader.prev().show();<commit_msg>(refs #93) コメント投稿エラー時にalertでエラー表示するのを修正<commit_after>/*********************************************************
** jQuery timeilinePlugin functions
** how to use : $('#element').timelineComment();
**              $('#element').timelineDelete();
** @parts     : opTimelinePlugin
** @author    : <NAME> <<EMAIL>>
**********************************************************/
(function($){

  $.fn.timelineComment = function(settings){
    settings = jQuery.extend({
      loader_path: '',
      callback: function(){},
    });

    return this.each(function(){
      $(this).click(function(){
        var id = $(this).attr("data-timeline-id");
        var foreign = $(this).attr('data-activity-foreign');
        var foreignId = $(this).attr('data-activity-foreign-id');
        var body = $('#comment-textarea-'+id).val();
        $timelineLoader = $(this).parent().next();
        $timelineLoader.next().text('');
        $timelineLoader.next().hide();
        $timelineLoader.show();
        $(this).parent().hide();
        $.ajax({
          url: openpne.apiBase + 'activity/post.json',
          type: 'POST',
          data: {
            body: body,
            in_reply_to_activity_id: id,
            apiKey: openpne.apiKey,
            target: foreign,
            target_id: foreignId
          },
          dataType: 'json',
          success: function(data) {
            if ('success' == data.status)
            {
              $('#comment-textarea-'+id).val('');
              $timelineLoader.hide();
              $('#timeline-post-comment-form-'+id).show();
              $postData = $('#timelineCommentTemplate').tmpl(data.data);
              $('#timeline-post-comment-form-'+id).before($postData);
            }
            else
            {
              $timelineLoader.hide();
              $timelineLoader.next().text('投稿に失敗しました');
              $timelineLoader.next().show();
              $timelineLoader.prev().show();
            }
          },
          error: function(x, r, t) {
            $timelineLoader.hide();
            $timelineLoader.next().text('投稿に失敗しました');
            $timelineLoader.next().show();
            $timelineLoader.prev().show();
{'fraction_non_alphanumeric': 0.22418316241354638, 'fraction_numerical': 0.0004769854519437157, 'mean_word_length': 2.0929203539823007, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1972993', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1153, 'n_words': 170}