<commit_before>;(function($, Plugins, Card) { 'use strict';

    // Plugin constructor and defaults
    // -------------------------------

    var Crud = function(planner, options) {
        this.planner = planner;
        this.$element = $(planner.$element);
        this.options = options;

        this.currentCard = null;
    };

    Crud.DEFAULTS = {
        readOnly: true
    };

    // Prototype functions
    // -------------------

    Crud.prototype.attachDragCreation = function() {
        var self = this;

        self.$element.find('.column > div:not(.column-header)')
            .on('mousedown', function(e) {
                // Start card creation
                var $this = $(this);
                var startAttribute = Planner.Helpers.indexToAttribute($this.index() - 1);
                var assignee = [$this.parent().index() + 1];
                self.startCard(startAttribute, assignee);

                // Avoid other actions
                e.preventDefault();
            })
            .on('mouseup', function(e) {
                // End card creation
                var $this = $(this);
                var endAttribute = Planner.Helpers.indexToAttribute($this.index());
                self.endCard(endAttribute);

                // Avoid other actions
                e.preventDefault();
            });
    };

    Crud.prototype.startCard = function(startAttribute, assignee) {
        this.currentCard = new Card({start: startAttribute, assignees: assignee});
    };

    Crud.prototype.endCard = function(endAttribute) {
        this.currentCard.end = endAttribute;
        this.currentCard.generateDOM();

        // Card drawing
        this.planner.drawCard(this.currentCard);
    };

    // Crud plugin definition
    // ----------------------

    var old = $.fn.crud;

    $.fn.crud = function(option) {
        var planner = this;

        return this.$element.each(function() {
            var $this = $(this);
            var data = $this.data('pl.plugins.crud');
            var options = $.extend({}, Crud.DEFAULTS, $this.data(), typeof option === 'object' && option);

            // If this node isn't initialized, call the constructor
            if (!data) {
                $this.data('pl.plugins.crud', (data = new Crud(planner, options)));
            }

            data.attachDragCreation();
        });
    };

    $.fn.crud.constructor = Crud;

    // Crud no conflict
    // ----------------

    $.fn.crud.noConflict = function() {
        $.fn.crud = old;<commit_msg>Fixed plugin options extend<commit_after>;(function($, Plugins, Card) { 'use strict';

    // Plugin constructor and defaults
    // -------------------------------

    var Crud = function(planner, options) {
        this.planner = planner;
        this.$element = $(planner.$element);
        this.options = options;

        this.currentCard = null;
    };

    Crud.DEFAULTS = {
        readOnly: true
    };

    // Prototype functions
    // -------------------

    Crud.prototype.attachDragCreation = function() {
        var self = this;

        self.$element.find('.column > div:not(.column-header)')
            .on('mousedown', function(e) {
                // Start card creation
                var $this = $(this);
                var startAttribute = Planner.Helpers.indexToAttribute($this.index() - 1);
                var assignee = [$this.parent().index() + 1];
                self.startCard(startAttribute, assignee);

                // Avoid other actions
                e.preventDefault();
            })
            .on('mouseup', function(e) {
                // End card creation
                var $this = $(this);
                var endAttribute = Planner.Helpers.indexToAttribute($this.index());
                self.endCard(endAttribute);

                // Avoid other actions
                e.preventDefault();
            });
    };

    Crud.prototype.startCard = function(startAttribute, assignee) {
        this.currentCard = new Card({start: startAttribute, assignees: assignee});
    };

    Crud.prototype.endCard = function(endAttribute) {
        this.currentCard.end = endAttribute;
        this.currentCard.generateDOM();

        // Card drawing
        this.planner.drawCard(this.currentCard);
    };

    // Crud plugin definition
    // ----------------------

    var old = $.fn.crud;

    $.fn.crud = function(option) {
        var planner = this;

        return this.$element.each(function() {
            var $this = $(this);
            var data = $this.data('pl.plugins.crud');
            var options = $.extend({}, Crud.DEFAULTS, $this.data('pl.planner').options, typeof option === 'object' && option);

            // If this node isn't initialized, call the constructor
            if (!data) {
                $this.data('pl.plugins.crud', (data = new Crud(planner, options)));
            }

            data.attachDragCreation();
        });
    };

    $.fn.crud.constructor = Crud;

    // Crud no conflict
    // ----------------

    $.fn.crud.noConflict = function() {
        $.fn.crud = old;
{'fraction_non_alphanumeric': 0.16594743036484896, 'fraction_numerical': 0.0007846214201647705, 'mean_word_length': 1.5700604838709677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3912496', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1325, 'n_words': 284}