<commit_before># This is a manifest file that'll be compiled into including all the files listed below.
# Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
# be included in the compiled file accessible from http://example.com/assets/application.js
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
# the compiled file.
#
#= require jquery
#= require jquery_ujs
#= require redactor
#= require bootstrap
#= require_tree .

loadTextEditor = (elem) ->
  elem.find(".js-editor").redactor()

checkPageType = ->
  redirect_url_input = $('#page_url')
  if ($('#page_page_type option:selected').val() == 'redirect')
    redirect_url_input.removeAttr('disabled')
  else
    redirect_url_input.attr('disabled', 'disabled')

sortableBrick = ->
  $(".brick-list").each (idx, elem) ->
    $(elem).sortable(
      handle: '.brick-item-header',
      axis: "y",
      update: (event, ui) ->
         $(this).find(".brick-item").each (idx, elem) ->
            $(this).find("input.position-field").val(idx+1)
            $(this).children('form').trigger('submit')
      )

$(document).ajaxSuccess ->
  loadTextEditor($("body"))
  sortableBrick()

$(document).ready ->
  loadTextEditor($(document));
  checkPageType()
  sortableBrick()
  $('#page_page_type').change ->
    checkPageType()
<commit_msg>remove semicolon, reenable sortable call<commit_after># This is a manifest file that'll be compiled into including all the files listed below.
# Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
# be included in the compiled file accessible from http://example.com/assets/application.js
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
# the compiled file.
#
#= require jquery
#= require jquery_ujs
#= require redactor
#= require bootstrap
#= require_tree .

loadTextEditor = (elem) ->
  elem.find(".js-editor").redactor()

checkPageType = ->
  redirect_url_input = $('#page_url')
  if ($('#page_page_type option:selected').val() == 'redirect')
    redirect_url_input.removeAttr('disabled')
  else
    redirect_url_input.attr('disabled', 'disabled')

sortableBrick = ->
  $(".brick-list").each (idx, elem) ->
    $(elem).sortable(
      handle: '.brick-item-header',
      axis: "y",
      update: (event, ui) ->
         #$(this).find(".brick-item").each (idx, elem) ->
            #$(this).find("input.position-field").val(idx+1)
            #$(this).children('form').trigger('submit')
      )

$(document).ajaxSuccess ->
  loadTextEditor($("body"))
  sortableBrick()

$(document).ready ->
  loadTextEditor($(document))
  checkPageType()
  sortableBrick()
  $('#page_page_type').change ->
    checkPageType()

{'fraction_non_alphanumeric': 0.1553153153153153, 'fraction_numerical': 0.0007207207207207207, 'mean_word_length': 3.8959435626102294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '2010605', 'n_tokens_mistral': 851, 'n_tokens_neox': 836, 'n_words': 222}