<commit_before>var formServiceUrl = '<?php echo url_for('@editable_content_service_form') ?>';
var showServiceUrl = '<?php echo url_for('@editable_content_service_show') ?>';
var deleteServiceUrl = '<?php echo url_for('@editable_content_service_delete') ?>';
var sortableServiceurl = '<?php echo url_for('@editable_content_service_list_sort') ?>';

$(document).ready(function(){
  initializeEditableContent('body');
});

function initializeEditableContent(wrapper)
{
  wrapper = $(wrapper);
  
  initializeEditableContentArea(wrapper);
  initializeEditableContentList(wrapper);
}

function initializeEditableContentArea(wrapper)
{
  wrapper = $(wrapper);
  
  // initialize each editable content area
  $('.<?php echo $editableClassName ?>', wrapper).each(function() {
    var options = $(this).metadata();
    options.form_url = formServiceUrl;
    options.show_url = showServiceUrl;
    options.delete_url = deleteServiceUrl;

    $(this).ioEditableContent(options);
  });
}

function initializeEditableContentList(wrapper)
{
  wrapper = $(wrapper);
  
  // initialize each editable content list
  $('.<?php echo $editableListClassName ?>', wrapper).each(function() {
    var options = $(this).metadata();
    options.form_url = formServiceUrl;
    options.show_url = showServiceUrl;
    options.delete_url = deleteServiceUrl;
    options.sortable_url = sortableServiceurl;
    options.child_class = '<?php echo $editableClassName ?>';
    options.new_ele = $(this).find('.io_new_tag').eq(0);

    $(this).ioEditableContentList(options);
  });
}<commit_msg>added documentation to editable content initialization functions<commit_after>var formServiceUrl = '<?php echo url_for('@editable_content_service_form') ?>';
var showServiceUrl = '<?php echo url_for('@editable_content_service_show') ?>';
var deleteServiceUrl = '<?php echo url_for('@editable_content_service_delete') ?>';
var sortableServiceurl = '<?php echo url_for('@editable_content_service_list_sort') ?>';

$(document).ready(function(){
  initializeEditableContent('body');
});

/**
 * you can use this to reinitialize both the editable content area and editable content list items
 */
function initializeEditableContent(wrapper)
{
  initializeEditableContentArea(wrapper);
  initializeEditableContentList(wrapper);
}

/**
 * you can use this to reinitialize the editable content area
 */
function initializeEditableContentArea(wrapper)
{
  wrapper = $(wrapper);
  
  // initialize each editable content area
  $('.<?php echo $editableClassName ?>', wrapper).each(function() {
    var options = $(this).metadata();
    options.form_url = formServiceUrl;
    options.show_url = showServiceUrl;
    options.delete_url = deleteServiceUrl;

    $(this).ioEditableContent(options);
  });
}

/**
 * you can use this to reinitialize the editable content list
 */
function initializeEditableContentList(wrapper)
{
  wrapper = $(wrapper);
  
  // initialize each editable content list
  $('.<?php echo $editableListClassName ?>', wrapper).each(function() {
    var options = $(this).metadata();
    options.form_url = formServiceUrl;
    options.show_url = showServiceUrl;
    options.delete_url = deleteServiceUrl;
    options.sortable_url = sortableServiceurl;
    options.child_class = '<?php echo $editableClassName ?>';
    options.new_ele = $(this).find('.io_new_tag').eq(0);

    $(this).ioEditableContentList(options);
  });
}
{'fraction_non_alphanumeric': 0.13602832694010034, 'fraction_numerical': 0.0005901445854234287, 'mean_word_length': 5.444866920152092, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4327773', 'n_tokens_mistral': 988, 'n_tokens_neox': 982, 'n_words': 204}