<commit_before>(function($) {

function s4() {
  return Math.floor((1 + Math.random()) * 0x10000)
             .toString(16)
             .substring(1);
};

function guid() {
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
         s4() + '-' + s4() + s4() + s4();
}

$(document).on('click', '.collectionAdd', function(event) {
    event.preventDefault();

    // Gather all needed information, like
    //  collection we're handling right now...
    var collection = $(event.target).parent(),
        // The prototype text for the new item...
        prototype = collection.data('prototype'),
        // And finally parse the prototype into a new clean item for insertion.
        item = $($.parseHTML(prototype
            .trim()
            .replace(/__name__label__/g, '')
            .replace(/__name__/g, guid()))[0])
            .addClass('collectionItem');

    // Now let's enter that item...
    collection.append(item);<commit_msg>unic id for order of form collections added<commit_after>(function($) {

function s4() {
  return Math.floor((1 + Math.random()) * 0x10000)
             .toString(16)
             .substring(1);
};

function guid() {
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
         s4() + '-' + s4() + s4() + s4();
}

$(document).on('click', '.collectionAdd', function(event) {
    event.preventDefault();

    // Gather all needed information, like
    //  collection we're handling right now...
    var collection = $(event.target).parent(),
        count = $('.collectionItem', collection).length,
        // The prototype text for the new item...
        prototype = collection.data('prototype'),
        // And finally parse the prototype into a new clean item for insertion.
        item = $($.parseHTML(prototype
            .trim()
            .replace(/__name__label__/g, '')
            .replace(/__name__/g, count + '-' + guid()))[0])
            .addClass('collectionItem');

    // Now let's enter that item...
    collection.append(item);
{'fraction_non_alphanumeric': 0.17841079460269865, 'fraction_numerical': 0.01999000499750125, 'mean_word_length': 2.244732576985413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4668269', 'n_tokens_mistral': 598, 'n_tokens_neox': 575, 'n_words': 152}