<commit_before>$ ->
  $("#note-card-list .description a").attr "target", "_blank"

  makeAttachmentsList = (attachments, container) ->
    ul = container.find "ul"
    ul.empty()
    attachments.attr "target", "_blank"
    if attachments.length is 0
      container.removeClass "has-data"
      $("#making-list .inner").removeClass "has-data"
      return
    container.addClass "has-data"
    $("#making-list .inner").addClass "has-data"
    for attachment in attachments
      href = attachment.getAttribute "href"
      description = attachment.getAttribute "data-description"
      name = attachment.textContent
      li = $ document.createElement("li")
      a = $ document.createElement("a")
      a.attr "href", href
      a.text name
      a.attr "alt", description
      a.attr "title", description
      a.attr "target", "_blank"
      li.append a
      ul.append li

  $(document).on "attachment-markuped", "", () ->
    makeAttachmentsList $("a.material"), $("#material-list")
    makeAttachmentsList $("a.tool"), $("#tool-list")
    makeAttachmentsList $("a.blueprint"), $("#blueprint-list")
    makeAttachmentsList $("a.attachment"), $("#references")

  $(document).on "click", "figure img", () ->
    if $(this).parent().hasClass "flex-active-slide"
      images = $(this)
      images.push $(this).parent().siblings("[class!='clone']").find("img")
      original_srcs = []
      original_srcs.push $(image).data("src") for image in images
      $.fancybox.open original_srcs,
        openEffect: "none"
        closeEffect: "none"
        padding: 0
        wrapCSS: "image-slideshow"
        helpers:
          overlay:
            css:
              "background": "rgba(0, 0, 0, 0.2)"
    else
      $.fancybox.open $(this).data("src"),
        openEffect: "none"
        closeEffect: "none"
        helpers:
          overlay:
            css:
              "background": "rgba(0, 0, 0, 0.2)"

  $(document).on "click", ".fancybox-skin", (event) ->
    event.stopPropagation()

$(window).on "load" , ->
  $('.flexslider').flexslider
    animation: "slider"
    animationSpeed: 300
    controlNav: true
    smoothHeight: true
    slideshow: false
<commit_msg>close #1326 fix markup bug with space or CRLF<commit_after>$ ->
  $("#note-card-list .description a").attr "target", "_blank"

  makeAttachmentsList = (attachments, container) ->
    ul = container.find "ul"
    ul.empty()
    attachments.attr "target", "_blank"
    filtered_attachments = attachments.filter (i) ->
      return this.textContent.replace(/[\n\s ]/g, "").length != 0
    if filtered_attachments.length is 0
      container.removeClass "has-data"
      $("#making-list .inner").removeClass "has-data"
      return
    container.addClass "has-data"
    $("#making-list .inner").addClass "has-data"
    for attachment in filtered_attachments
      href = attachment.getAttribute "href"
      description = attachment.getAttribute "data-description"
      name = attachment.textContent
      li = $ document.createElement("li")
      a = $ document.createElement("a")
      a.attr "href", href
      a.text name
      a.attr "alt", description
      a.attr "title", description
      a.attr "target", "_blank"
      li.append a
      ul.append li

  $(document).on "attachment-markuped", "", () ->
    makeAttachmentsList $("a.material"), $("#material-list")
    makeAttachmentsList $("a.tool"), $("#tool-list")
    makeAttachmentsList $("a.blueprint"), $("#blueprint-list")
    makeAttachmentsList $("a.attachment"), $("#references")

  $(document).on "click", "figure img", () ->
    if $(this).parent().hasClass "flex-active-slide"
      images = $(this)
      images.push $(this).parent().siblings("[class!='clone']").find("img")
      original_srcs = []
      original_srcs.push $(image).data("src") for image in images
      $.fancybox.open original_srcs,
        openEffect: "none"
        closeEffect: "none"
        padding: 0
        wrapCSS: "image-slideshow"
        helpers:
          overlay:
            css:
              "background": "rgba(0, 0, 0, 0.2)"
    else
      $.fancybox.open $(this).data("src"),
        openEffect: "none"
        closeEffect: "none"
        helpers:
          overlay:
            css:
              "background": "rgba(0, 0, 0, 0.2)"

  $(document).on "click", ".fancybox-skin", (event) ->
    event.stopPropagation()

$(window).on "load" , ->
  $('.flexslider').flexslider
    animation: "slider"
    animationSpeed: 300
    controlNav: true
    smoothHeight: true
    slideshow: false

{'fraction_non_alphanumeric': 0.16250276365244307, 'fraction_numerical': 0.007738226840592527, 'mean_word_length': 2.6572352465642686, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 16, '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': '7044537', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1372, 'n_words': 312}