<commit_before>@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
  content: String,
  enableWikiLink: Boolean,
  enableRefsLink: Boolean,
  enableLineBreaks: Boolean,
  enableTaskList: Boolean,
  hasWritePermission: Boolean,
  completionContext: String,
  style: String = "",
  styleClass: String = "",
  placeholder: String = "Leave a comment",
  ariaLabel: String = "Comment body",
  elastic: Boolean = false,
  focus: Boolean = false,
  tabIndex: Int = -2,
  uid: Long = new java.util.Date().getTime())(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
<div class="tabbable">
  <ul class="nav nav-tabs fill-width" style="margin-bottom: 10px;">
    <li class="active"><a href="#tab@uid" data-toggle="tab" id="write@uid">Write</a></li>
    <li><a href="#tab@(uid + 1)" data-toggle="tab" id="preview@uid">Preview</a></li>
  </ul>
  <div class="tab-content">
    <div class="tab-pane active" style="margin-top: 4px;" id="tab@uid">
      <span id="error-content" class="error"></span>
      @textarea = {
        <textarea id="content@uid" class="form-control" name="content" placeholder="@placeholder" style="resize: vertical; @style" aria-label="@ariaLabel"
          @if(tabIndex > -2){ tabindex="@tabIndex"}
          @if(styleClass.nonEmpty){ class="@styleClass" }>@content</textarea>
      }
      @gitbucket.core.helper.html.attached(
        repository        = repository,
        completionContext = completionContext,
        generateScript    = !enableWikiLink
      )(textarea)
    </div>
    <div class="tab-pane" id="tab@(uid + 1)">
      <div class="markdown-body" id="preview-area@uid">
      </div>
    </div>
  </div>
</div>
<link  href="@helpers.assets("/vendors/google-code-prettify/prettify.css")" type="text/css" rel="stylesheet"/>
<script src="@helpers.assets("/vendors/google-code-prettify/prettify.js")"></script>
<script>
$(function(){
  @if(elastic){
    $('#content@uid').elastic();
    $('#content@uid').trigger('blur');
  }
  @if(focus){
    $('#content@uid').trigger('focus');
  }

  $('#write@uid').on('shown.bs.tab', function(){
    $('#content@uid').trigger('focus');
  });

  $('#preview@uid').click(function(){
    $('#preview-area@uid').html('<img src="@helpers.assets("/common/images/indicator.gif")"> Previewing...');
    $.post('@helpers.url(repository)/_preview', {
      content          : $('#content@uid').val(),
      enableWikiLink   : @enableWikiLink,
      enableRefsLink   : @enableRefsLink,
      enableLineBreaks : @enableLineBreaks,
      enableTaskList   : @enableTaskList
    }, function(data){
      $('#preview-area@uid').html(data);
      $('#preview-area@uid input').prop('disabled', true);
      prettyPrint();
    });
  });
});
</script>
<commit_msg>Remove unnecessary loading of google-code-prettify (#2922)<commit_after>@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
  content: String,
  enableWikiLink: Boolean,
  enableRefsLink: Boolean,
  enableLineBreaks: Boolean,
  enableTaskList: Boolean,
  hasWritePermission: Boolean,
  completionContext: String,
  style: String = "",
  styleClass: String = "",
  placeholder: String = "Leave a comment",
  ariaLabel: String = "Comment body",
  elastic: Boolean = false,
  focus: Boolean = false,
  tabIndex: Int = -2,
  uid: Long = new java.util.Date().getTime())(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
<div class="tabbable">
  <ul class="nav nav-tabs fill-width" style="margin-bottom: 10px;">
    <li class="active"><a href="#tab@uid" data-toggle="tab" id="write@uid">Write</a></li>
    <li><a href="#tab@(uid + 1)" data-toggle="tab" id="preview@uid">Preview</a></li>
  </ul>
  <div class="tab-content">
    <div class="tab-pane active" style="margin-top: 4px;" id="tab@uid">
      <span id="error-content" class="error"></span>
      @textarea = {
        <textarea id="content@uid" class="form-control" name="content" placeholder="@placeholder" style="resize: vertical; @style" aria-label="@ariaLabel"
          @if(tabIndex > -2){ tabindex="@tabIndex"}
          @if(styleClass.nonEmpty){ class="@styleClass" }>@content</textarea>
      }
      @gitbucket.core.helper.html.attached(
        repository        = repository,
        completionContext = completionContext,
        generateScript    = !enableWikiLink
      )(textarea)
    </div>
    <div class="tab-pane" id="tab@(uid + 1)">
      <div class="markdown-body" id="preview-area@uid">
      </div>
    </div>
  </div>
</div>
<script>
$(function(){
  @if(elastic){
    $('#content@uid').elastic();
    $('#content@uid').trigger('blur');
  }
  @if(focus){
    $('#content@uid').trigger('focus');
  }

  $('#write@uid').on('shown.bs.tab', function(){
    $('#content@uid').trigger('focus');
  });

  $('#preview@uid').click(function(){
    $('#preview-area@uid').html('<img src="@helpers.assets("/common/images/indicator.gif")"> Previewing...');
    $.post('@helpers.url(repository)/_preview', {
      content          : $('#content@uid').val(),
      enableWikiLink   : @enableWikiLink,
      enableRefsLink   : @enableRefsLink,
      enableLineBreaks : @enableLineBreaks,
      enableTaskList   : @enableTaskList
    }, function(data){
      $('#preview-area@uid').html(data);
      $('#preview-area@uid input').prop('disabled', true);
      prettyPrint();
    });
  });
});
</script>

{'fraction_non_alphanumeric': 0.19714126601076665, 'fraction_numerical': 0.003341377390012994, 'mean_word_length': 3.952205882352941, 'pattern_counts': {'":': 0, '<': 60, '<?xml version=': 0, '>': 62, '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': '4820085', 'n_tokens_mistral': 1747, 'n_tokens_neox': 1720, 'n_words': 299}