<commit_before>M.wrap('github/jillix/bind-list/v0.1.0/main.js', function (require, module, exports) {
var List = require("./list");

module.exports = function (config) {

    config.crud = {
        create: "create",
        read:   "read",
        update: "update",
        // "delete" is considered a keywork by some browsers
        "delete": "remove"
    }

    if (config.sample) {
        // this reads the sample configuration if this is a sample list
        buildSampleConfig(config);
    }

    List(this, config);
}

function buildSampleConfig(config) {

    // (mandatory) what to render fot each data item
    config.template = {
        type: "selector", // "url", "html"
        value: ".template",
        binds: [
            {
                target: ".delete",
                on: [{
                    name: "click",
                    handler: "removeItem"
                }]
            },
            {
                on: [{
                    name: "click",
                    handler: "selectItem"
                }]
            },
            {
                attr: [
                    {
                        name: "id",
                        value: {
                            source: "id",
                            filter: [
                                { name: "prefix", args: "itm", library: "/aasdsda" }
                            ]
                        }
                    }
                ],
            },
            {
                target: ".itemText",
                html: {
                    source: "text"
                }
            }
        ]
    };

    // (mandatory) where to display rendered items
    config.container = ".content";

    // (mandatory) the CRUD operations are module operations
    config.crud = {
        create: "create",
        read:   "read",
        update: "update",
        "delete": "remove"
    };

    // (optional) options
    config.options = {
        selection: "multiple", // "single", "multiple"
        autofetch: true,
        classes: {
            selected: "selected"
        },
        // When we use a real database, we can use _id.
        // Also, if we use a database we can have the id key. *
        // e.g.: { "id": 1, "text": "This is a sample item" }
        // * default: "id"
        id: "id",
        // (optional) pagination
        pagination: {
            size: 2,
            container: ".pagination",
            // (optional) numbers
            numbers: {
                template: ".pagination-template",
                classes: {
                    active: "active",
                    item: "pagination-item",
                    before: ".prepend-before"
                },
                keywords: {
                    pageNumber: "@pageNr@",
                    active: "@active@"
                },
                options: {
                    max: 4, // Can be 0, 1, 2, 3, or greather
                    alwaysFirst: true,
                    alwaysLast: true
                }
            },
            controls: {
                next: ".next",
                previous: ".prev",
                disable: "disabled",
            },
            classes: {
                disable: "disabled"
            }
        }
    };

    // (optional) selectors as handles for core list operations
    config.controls = {
        add: ".create",
        "delete": ".delete"
    };

    // (optional) additional functionality through bind objects
    config.binds = [
        {
            target: "create",
            on: [{
                name: "click",
                emit: "newItem"
            }]
        }
    ];
}

return module; });<commit_msg>Removed 'M.wrap' line and 'return module'.<commit_after>var List = require("./list");

module.exports = function (config) {

    config.crud = {
        create: "create",
        read:   "read",
        update: "update",
        // "delete" is considered a keywork by some browsers
        "delete": "remove"
    }

    if (config.sample) {
        // this reads the sample configuration if this is a sample list
        buildSampleConfig(config);
    }

    List(this, config);
}

function buildSampleConfig(config) {

    // (mandatory) what to render fot each data item
    config.template = {
        type: "selector", // "url", "html"
        value: ".template",
        binds: [
            {
                target: ".delete",
                on: [{
                    name: "click",
                    handler: "removeItem"
                }]
            },
            {
                on: [{
                    name: "click",
                    handler: "selectItem"
                }]
            },
            {
                attr: [
                    {
                        name: "id",
                        value: {
                            source: "id",
                            filter: [
                                { name: "prefix", args: "itm", library: "/aasdsda" }
                            ]
                        }
                    }
                ],
            },
            {
                target: ".itemText",
                html: {
                    source: "text"
                }
            }
        ]
    };

    // (mandatory) where to display rendered items
    config.container = ".content";

    // (mandatory) the CRUD operations are module operations
    config.crud = {
        create: "create",
        read:   "read",
        update: "update",
        "delete": "remove"
    };

    // (optional) options
    config.options = {
        selection: "multiple", // "single", "multiple"
        autofetch: true,
        classes: {
            selected: "selected"
        },
        // When we use a real database, we can use _id.
        // Also, if we use a database we can have the id key. *
        // e.g.: { "id": 1, "text": "This is a sample item" }
        // * default: "id"
        id: "id",
        // (optional) pagination
        pagination: {
            size: 2,
            container: ".pagination",
            // (optional) numbers
            numbers: {
                template: ".pagination-template",
                classes: {
                    active: "active",
                    item: "pagination-item",
                    before: ".prepend-before"
                },
                keywords: {
                    pageNumber: "@pageNr@",
                    active: "@active@"
                },
                options: {
                    max: 4, // Can be 0, 1, 2, 3, or greather
                    alwaysFirst: true,
                    alwaysLast: true
                }
            },
            controls: {
                next: ".next",
                previous: ".prev",
                disable: "disabled",
            },
            classes: {
                disable: "disabled"
            }
        }
    };

    // (optional) selectors as handles for core list operations
    config.controls = {
        add: ".create",
        "delete": ".delete"
    };

    // (optional) additional functionality through bind objects
    config.binds = [
        {
            target: "create",
            on: [{
                name: "click",
                emit: "newItem"
            }]
        }
    ];
}
{'fraction_non_alphanumeric': 0.11817685589519651, 'fraction_numerical': 0.002319868995633188, 'mean_word_length': 0.9664609605580896, 'pattern_counts': {'":': 10, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3758327', 'n_tokens_mistral': 1912, 'n_tokens_neox': 1787, 'n_words': 480}